Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#43168 - pnkfelix:check-attr-gating, r=aturon
Slew of builtin-attribute gating tests Slew of builtin-attribute "gating" tests for issue rust-lang#43106. Some stray observations: * I don't know if its a good thing that so many attributes allow inputs which are silently discarded. (I made heavy use of that in writing my tests, but that was more out of curiosity than necessity.) * The difference between crate-level and non-crate-level behavior is quite significant in some cases. Definitely worth making sure one has tests for both cases. (Not as clear whether it was worthwhile trying the various other AST forms like `fn f()` vs `struct S;`) * `#[no_builtins]` and `#[no_mangle]` occur twice on the `BUILTIN_ATTRIBUTES` list. Thats almost certainly a bug. (Filed as rust-lang#43148) * We are maximally liberal in what we allow for `#[test]` and `#[bench]` when one compiles without `--test`. * We allow `#[no_mangle]` on arbitrary AST nodes, but only warn about potential misuse on `fn` * We allow `#[cold]`, `#[must_use]`, `#[windows_subsystem]`, and `#[no_builtins]` on arbitrary AST nodes. I don't know off-hand what the semantics are for e.g. a `#[cold] type T = ...;` * We allow crate-level `#![inline]`. That's probably a bug since its otherwise restricted to `fn` items
- Loading branch information