---
source: https://iinventedlight.com/library/notes/rust-keywords.md
title: "Rust keywords: reserved words and raw identifiers with r#"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT OR Apache-2.0 (The Rust Project Developers); MIT OR Apache-2.0 (The Rust Project Developers); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: The Rust Project Developers, Appendix A: Keywords; The Rust Project Developers, Appendix A: Keywords (source). MIT OR Apache-2.0 (https://raw.githubusercontent.com/rust-lang/book/main/LICENSE-MIT). Copyright the Rust Project Developers."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-27
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-27
as_of: 2026-11-27
confidence: medium
untested: "Not reproduced (2026-11-27). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: rust-keywords"
tags: [rust, keywords, raw-identifiers, reserved, r-hash]
client: Librarian
sources:
  - id: S1
    title: "Appendix A: Keywords"
    publisher: The Rust Project Developers
    url: https://doc.rust-lang.org/book/appendix-01-keywords.html
    accessed: 2026-11-27
    license: "MIT OR Apache-2.0"
  - id: S2
    title: "Appendix A: Keywords (source)"
    publisher: The Rust Project Developers
    url: https://raw.githubusercontent.com/rust-lang/book/main/src/appendix-01-keywords.md
    accessed: 2026-11-27
    license: "MIT OR Apache-2.0"
---
# Rust keywords: reserved words and raw identifiers with r#
**Answer:** Appendix A lists Rust keywords reserved for current or future use; they cannot be ordinary identifiers, except as raw identifiers with an r# prefix.

## Keywords in use and reserved for later

Appendix A lists keywords reserved for current or future use by the language. They cannot be used as identifiers, except as raw identifiers.

The appendix treats identifiers as the names you give to things such as functions, fields, modules, crates, and lifetimes.

The appendix lists keywords currently in use, including as, async, await, and break.

as performs primitive casting, disambiguates the specific trait containing an item, or renames items in use statements.

union is a keyword only when used in a union declaration.

Words reserved for possible future use, with no functionality yet, include abstract, become, box, do, final, gen, macro, override, priv, try, typeof, unsized, virtual, and yield.

## Raw identifiers

Raw identifiers are the syntax that lets you use keywords where they would not normally be allowed. You use a raw identifier by prefixing a keyword with r#.

A function named match will not compile. Naming it r#match, and calling r#match, does compile.

The r# prefix is needed on the function name in the definition and also where main calls the function.

Raw identifiers let you pick reserved words as names, and help when integrating with a language where those words are not keywords.

## See also

- [rust-variables-and-mutability](https://iinventedlight.com/library/notes/rust-variables-and-mutability/)
- [rust-functions](https://iinventedlight.com/library/notes/rust-functions/)
- [rust-match](https://iinventedlight.com/library/notes/rust-match/)

## Claims

- id: C1
  claim: These keywords are reserved for current or future use by Rust and cannot be ordinary identifiers.
  source: S1
  evidence: "keywords that are reserved for current or future use by the Rust language"

- id: C2
  claim: A raw identifier is a keyword prefixed with r#.
  source: S2
  evidence: "You use a raw identifier by prefixing a keyword with `r#`."

- id: C3
  claim: Some keywords, including box, try, and yield, are reserved for future use.
  source: S1
  evidence: "The following keywords do not yet have any functionality but are reserved"

## Sources

- [S1] Appendix A: Keywords. The Rust Project Developers. https://doc.rust-lang.org/book/appendix-01-keywords.html . License: MIT OR Apache-2.0. Accessed 2026-11-27.

- [S2] Appendix A: Keywords (source). The Rust Project Developers. https://raw.githubusercontent.com/rust-lang/book/main/src/appendix-01-keywords.md . License: MIT OR Apache-2.0. Accessed 2026-11-27.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Rust Project Developers, Appendix A: Keywords; The Rust Project Developers, Appendix A: Keywords (source). MIT OR Apache-2.0 (https://raw.githubusercontent.com/rust-lang/book/main/LICENSE-MIT). Copyright the Rust Project Developers. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
