Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
e8177c7
Document adding unstable compiler flags
Herrtian May 31, 2026
29d4c21
Document compiler flag sign-off guidance
Herrtian Jun 1, 2026
f9afba1
Link UnstableOptions docs
Herrtian Jun 2, 2026
d4c125f
Merge pull request #2886 from Herrtian/document-unstable-compiler-fla…
BoxyUwU Jun 5, 2026
0584a91
Expand `attributes.md`
JonathanBrouwer Jun 5, 2026
e4d9400
Add a chapter about attribute parsing
JonathanBrouwer Jun 5, 2026
86afbeb
Add attribute-parsing.md to summary
JonathanBrouwer Jun 5, 2026
e24ebcc
Merge pull request #2892 from JonathanBrouwer/attributes
BoxyUwU Jun 5, 2026
a59e8b1
Fix formatting in attribute-parsing documentation
reddevilmidzy Jun 5, 2026
272085e
Merge pull request rust-lang/rustc-dev-guide#2893 from reddevilmidzy/…
reddevilmidzy Jun 5, 2026
a6c2a42
Update MSVC LLDB 22 advice
jieyouxu Jun 6, 2026
c082ac7
Merge pull request #2895 from jieyouxu/msvc-lldb-22
jieyouxu Jun 6, 2026
3bfb1dc
Update autodiff installation guide
sgasho Jun 7, 2026
3083614
update outdated sentences
sgasho Jun 7, 2026
4d92360
Merge pull request #2896 from sgasho/autodiff-now-supports-arm64-mac
ZuseZ4 Jun 7, 2026
bc9a2bc
Use new name for `custom_messages` in triagebot config
Urgau Jun 7, 2026
65561bd
Merge pull request #2897 from Urgau/triagebot-custom_messages-new
Urgau Jun 7, 2026
dbaa761
start sentences with upper case letter
tshepang Jun 12, 2026
ee6ded7
Merge pull request #2898 from rust-lang/tshepang-patch-1
tshepang Jun 12, 2026
7cf7d95
Start basic docs for pre-stabilization CI job
jieyouxu Jun 12, 2026
1aff423
Include current test invocations
jieyouxu Jun 12, 2026
ee93757
Merge pull request #2899 from jieyouxu/pre-stab-ci
jieyouxu Jun 12, 2026
dbd3e97
Update stale GenericArgs example
cuishuang Jun 13, 2026
f5f3418
adjust --keep-stage-std section
tshepang Jun 15, 2026
e7c73dd
remove the overemphasis
tshepang Jun 15, 2026
fcc8f57
use more normal text
tshepang Jun 15, 2026
4dfd30e
Merge pull request #2901 from rust-lang/tshepang-patch-2
tshepang Jun 15, 2026
bfb4911
make more clear the content is in current book
tshepang Jun 15, 2026
2d9b134
Merge pull request #2902 from rust-lang/tshepang-patch-1
tshepang Jun 15, 2026
21ad7d0
Merge pull request #2900 from cuishuang/main
BoxyUwU Jun 15, 2026
b3c2501
Improve diagnostic argument wording
solunolab Jun 17, 2026
d49d06a
Merge pull request #2903 from reflecttypefor/my_feature
tshepang Jun 17, 2026
dfeb0df
update pre-stabilization CI job chapter
lqd Jun 19, 2026
ef8c9ed
Remove workaround for copying code
GuillaumeGomez Jun 19, 2026
a8aac4b
Merge pull request #2904 from lqd/rename-job
lqd Jun 19, 2026
75776a1
Prepare for merging from rust-lang/rust
invalid-email-address Jun 20, 2026
7981ccd
Merge ref '8c75e93c5c76' from rust-lang/rust
invalid-email-address Jun 20, 2026
35cfb60
Merge pull request #2905 from rust-lang/rustc-pull
tshepang Jun 20, 2026
d1aa02b
sembr src/building/suggested.md
tshepang Jun 20, 2026
a61e7c5
sembr src/lang-items.md
tshepang Jun 20, 2026
3ae3714
reflow
tshepang Jun 20, 2026
6660828
sembr src/autodiff/installation.md
tshepang Jun 20, 2026
2c24fc5
sembr src/hir/attribute-parsing.md
tshepang Jun 20, 2026
232df11
improve and update hir/attribute-parsing.md
tshepang Jun 20, 2026
0c95f9c
sembr src/attributes.md
tshepang Jun 20, 2026
d88ada9
sembr src/offload/usage.md
tshepang Jun 20, 2026
22b0639
sembr src/normalization.md
tshepang Jun 20, 2026
ea7b20a
improve normalization.md
tshepang Jun 20, 2026
9927026
sembr src/tests/misc.md
tshepang Jun 20, 2026
3adf150
improve tests/misc.md
tshepang Jun 20, 2026
069106b
sembr src/tests/directives.md
tshepang Jun 20, 2026
81755a5
sembr src/building/quickstart.md
tshepang Jun 20, 2026
e31f44b
improve building/quickstart.md
tshepang Jun 20, 2026
0c4b330
sembr src/autodiff/internals.md
tshepang Jun 20, 2026
882dcbd
improve autodiff/internals.md
tshepang Jun 20, 2026
42a6a2e
sembr src/tests/running.md
tshepang Jun 20, 2026
c68942a
sembr src/autodiff/debugging.md
tshepang Jun 20, 2026
2154d0c
improve autodiff/debugging.md
tshepang Jun 20, 2026
8c5fec7
Merge pull request #2907 from rust-lang/tshepang/sembr
tshepang Jun 20, 2026
1c28fb0
Rollup merge of #158137 - GuillaumeGomez:copy-source-code, r=Urgau
JonathanBrouwer Jun 20, 2026
bd81ccf
Rollup merge of #158177 - tshepang:rdg-sync, r=tshepang
JonathanBrouwer Jun 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/doc/rustc-dev-guide/ci/sembr/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,10 @@ html comment closing
";
assert_eq!(expected, lengthen_lines(original, 50));
}

#[test]
#[ignore]
fn should_pass() {
let original = "if you see `input isn't interesting! verify interesting-ness test`.";
assert_eq!(original, comply(original));
}
2 changes: 1 addition & 1 deletion src/doc/rustc-dev-guide/rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
49b19d32b9f01a5aa606f3bf2e90e6e0aa462c03
8c75e93c5c7671c29f3e8c096b7acf56822ed23a
2 changes: 2 additions & 0 deletions src/doc/rustc-dev-guide/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- [Cranelift codegen backend](./tests/codegen-backend-tests/cg_clif.md)
- [GCC codegen backend](./tests/codegen-backend-tests/cg_gcc.md)
- [Performance testing](./tests/perf.md)
- [Pre-stabilization CI job for the next solver and polonius alpha](./tests/x86_64-gnu-next-trait-solver-polonius-ci-job.md)
- [Misc info](./tests/misc.md)
- [Debugging the compiler](./compiler-debugging.md)
- [Using the tracing/logging instrumentation](./tracing.md)
Expand Down Expand Up @@ -129,6 +130,7 @@
- [Lang Items](./lang-items.md)
- [The HIR (High-level IR)](./hir.md)
- [Lowering AST to HIR](./hir/lowering.md)
- [Attribute Parsing](./hir/attribute-parsing.md)
- [Debugging](./hir/debugging.md)
- [Ambig/Unambig Types and Consts](./ambig-unambig-ty-and-consts.md)
- [The THIR (Typed High-level IR)](./thir.md)
Expand Down
25 changes: 17 additions & 8 deletions src/doc/rustc-dev-guide/src/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,55 @@ Attributes come in two types: *inert* (or *built-in*) and *active* (*non-builtin
## Builtin/inert attributes

These attributes are defined in the compiler itself, in
[`compiler/rustc_feature/src/builtin_attrs.rs`][builtin_attrs].
[`compiler/rustc_feature/src/builtin_attrs.rs`][builtin_attrs] and in the [attribute parsers][attr_parsing].

Examples include `#[allow]` and `#[macro_use]`.

[builtin_attrs]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_feature/builtin_attrs/index.html
[attr_parsing]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_attr_parsing/index.html

These attributes have several important characteristics:
* They are always in scope, and do not participate in typical path-based resolution.
* They cannot be renamed. For example, `use allow as foo` will compile, but writing `#[foo]` will
produce an error.
* They cannot be renamed.
For example, `use allow as foo` will compile, but writing `#[foo]` will produce an error.
* They are 'inert', meaning they are left as-is by the macro expansion code.
As a result, any behavior comes as a result of the compiler explicitly checking for their presence.
For example, lint-related code explicitly checks for `#[allow]`, `#[warn]`, `#[deny]`, and
`#[forbid]`, rather than the behavior coming from the expansion of the attributes themselves.

For more information on these attributes, see the chapter about [attribute parsing][attr-parsing-chapter].

[attr-parsing-chapter]: ./hir/attribute-parsing.md

## 'Non-builtin'/'active' attributes

These attributes are defined by a crate - either the standard library, or a proc-macro crate.

**Important**: Many non-builtin attributes, such as `#[derive]`, are still considered part of the
core Rust language. However, they are **not** called 'builtin attributes', since they have a
core Rust language.
However, they are **not** called 'builtin attributes', since they have a
corresponding definition in the standard library.

Definitions of non-builtin attributes take two forms:

1. Proc-macro attributes, defined via a function annotated with `#[proc_macro_attribute]` in a
proc-macro crate.
2. AST-based attributes, defined in the standard library. These attributes have special 'stub'
2. AST-based attributes, defined in the standard library.
These attributes have special 'stub'
macros defined in places like [`library/core/src/macros/mod.rs`][core_macros].

[core_macros]: https://github.com/rust-lang/rust/blob/HEAD/library/core/src/macros/mod.rs

These definitions exist to allow the macros to participate in typical path-based resolution - they
can be imported, re-exported, and renamed just like any other item definition. However, the body of
the definition is empty. Instead, the macro is annotated with the `#[rustc_builtin_macro]`
can be imported, re-exported, and renamed just like any other item definition.
However, the body of the definition is empty.
Instead, the macro is annotated with the `#[rustc_builtin_macro]`
attribute, which tells the compiler to run a corresponding function in `rustc_builtin_macros`.

All non-builtin attributes have the following characteristics:
* Like all other definitions (e.g. structs), they must be brought into scope via an import.
Many standard library attributes are included in the prelude - this is why writing `#[derive]`
works without an import.
* They participate in macro expansion. The implementation of the macro may leave the attribute
* They participate in macro expansion.
The implementation of the macro may leave the attribute
target unchanged, modify the target, produce new AST nodes, or remove the target entirely.
Loading
Loading