Repository navigation
some Attribute/AttributeExt cleanups - #164744
Conversation
|
cc @rust-lang/clippy Some changes occurred in compiler/rustc_passes/src/check_attr.rs cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_attr_ir |
|
|
This comment has been minimized.
This comment has been minimized.
|
❌ Commit cb9333a has been unapproved due to PR CI failure. Reapprove it with |
|
oh right, miri |
|
cc @rust-lang/miri |
| .next() | ||
| .is_none() | ||
| { | ||
| #[allow(deprecated)] |
There was a problem hiding this comment.
Please add a comment explaining why we use a deprecated API here.
There was a problem hiding this comment.
(also an expect would be nice)
There was a problem hiding this comment.
The api isn't really deprecrated, it's more "don't use this for parsed attributes".
There was a problem hiding this comment.
Maybe there's a better way to communicate that than deprecation then, e.g. via naming?
| into_iter, | ||
| into_try_type, | ||
| intra_doc_pointers, | ||
| intrinsic_fallback_is_spec, |
There was a problem hiding this comment.
FWIW we could use this functionality the interner as to add Miri-specific symbols in Miri rather than having to add them here. I am fine either way.
|
I think that's all feedback addressed. FWIW, I am exploring ideas on how to handle tool attributes better, so hopefully at some point it'll feel better than having to allow deprecated methods and such ;) |
|
@bors r+ rollup |
…uwer Rollup of 5 pull requests Successful merges: - #162395 (Make more float intrinsics generic) - #164636 (Remove `record_*` macros from the metadata encoder) - #164624 (make `RustaceansAreAwesome` satisfy projection clauses) - #164695 ([tiny] Include trait definition line when pointing at assoc function in E0308) - #164744 (some `Attribute`/`AttributeExt` cleanups)
Rollup merge of #164744 - mejrs:attr_cleanup, r=JonathanBrouwer some `Attribute`/`AttributeExt` cleanups r? @JonathanBrouwer
…uwer Rollup of 5 pull requests Successful merges: - rust-lang/rust#162395 (Make more float intrinsics generic) - rust-lang/rust#164636 (Remove `record_*` macros from the metadata encoder) - rust-lang/rust#164624 (make `RustaceansAreAwesome` satisfy projection clauses) - rust-lang/rust#164695 ([tiny] Include trait definition line when pointing at assoc function in E0308) - rust-lang/rust#164744 (some `Attribute`/`AttributeExt` cleanups)
…uwer Rollup of 5 pull requests Successful merges: - rust-lang/rust#162395 (Make more float intrinsics generic) - rust-lang/rust#164636 (Remove `record_*` macros from the metadata encoder) - rust-lang/rust#164624 (make `RustaceansAreAwesome` satisfy projection clauses) - rust-lang/rust#164695 ([tiny] Include trait definition line when pointing at assoc function in E0308) - rust-lang/rust#164744 (some `Attribute`/`AttributeExt` cleanups)
…uwer Rollup of 5 pull requests Successful merges: - rust-lang/rust#162395 (Make more float intrinsics generic) - rust-lang/rust#164636 (Remove `record_*` macros from the metadata encoder) - rust-lang/rust#164624 (make `RustaceansAreAwesome` satisfy projection clauses) - rust-lang/rust#164695 ([tiny] Include trait definition line when pointing at assoc function in E0308) - rust-lang/rust#164744 (some `Attribute`/`AttributeExt` cleanups)
…uwer Rollup of 5 pull requests Successful merges: - rust-lang/rust#162395 (Make more float intrinsics generic) - rust-lang/rust#164636 (Remove `record_*` macros from the metadata encoder) - rust-lang/rust#164624 (make `RustaceansAreAwesome` satisfy projection clauses) - rust-lang/rust#164695 ([tiny] Include trait definition line when pointing at assoc function in E0308) - rust-lang/rust#164744 (some `Attribute`/`AttributeExt` cleanups)
…r,ada4a make tool_attrs method to retrieve tool attributes. Some followup work on rust-lang#164744 (comment) Short of some kind of parsing/checking framework for tool attributes (which will be a lot of work), I think this is the best solution. cc @ada4a maybe you're interested in reviewing this as well, there are some clippy changes here too.
…r,ada4a make tool_attrs method to retrieve tool attributes. Some followup work on rust-lang#164744 (comment) Short of some kind of parsing/checking framework for tool attributes (which will be a lot of work), I think this is the best solution. cc @ada4a maybe you're interested in reviewing this as well, there are some clippy changes here too.
…r,ada4a make tool_attrs method to retrieve tool attributes. Some followup work on rust-lang#164744 (comment) Short of some kind of parsing/checking framework for tool attributes (which will be a lot of work), I think this is the best solution. cc @ada4a maybe you're interested in reviewing this as well, there are some clippy changes here too.
Rollup merge of #164900 - mejrs:tool_attrs, r=JonathanBrouwer,ada4a make tool_attrs method to retrieve tool attributes. Some followup work on #164744 (comment) Short of some kind of parsing/checking framework for tool attributes (which will be a lot of work), I think this is the best solution. cc @ada4a maybe you're interested in reviewing this as well, there are some clippy changes here too.
make tool_attrs method to retrieve tool attributes. Some followup work on rust-lang/rust#164744 (comment) Short of some kind of parsing/checking framework for tool attributes (which will be a lot of work), I think this is the best solution. cc @ada4a maybe you're interested in reviewing this as well, there are some clippy changes here too.
make tool_attrs method to retrieve tool attributes. Some followup work on rust-lang/rust#164744 (comment) Short of some kind of parsing/checking framework for tool attributes (which will be a lot of work), I think this is the best solution. cc @ada4a maybe you're interested in reviewing this as well, there are some clippy changes here too.
make tool_attrs method to retrieve tool attributes. Some followup work on rust-lang/rust#164744 (comment) Short of some kind of parsing/checking framework for tool attributes (which will be a lot of work), I think this is the best solution. cc @ada4a maybe you're interested in reviewing this as well, there are some clippy changes here too.
some `Attribute`/`AttributeExt` cleanups r? @JonathanBrouwer
…uwer Rollup of 5 pull requests Successful merges: - rust-lang/rust#162395 (Make more float intrinsics generic) - rust-lang/rust#164636 (Remove `record_*` macros from the metadata encoder) - rust-lang/rust#164624 (make `RustaceansAreAwesome` satisfy projection clauses) - rust-lang/rust#164695 ([tiny] Include trait definition line when pointing at assoc function in E0308) - rust-lang/rust#164744 (some `Attribute`/`AttributeExt` cleanups)
The automatic toolchain upgrade has been stuck since nightly-2026-10-24 (model-checking#5061). This brings the toolchain to nightly-2026-11-11, in four commits: 1. **nightly-2026-10-24.** rust-lang/rust#164744 removed `Attribute::span`, `get_normal_item` and `TyCtxt::get_attrs_by_path`; Kani's `kanitool::*` attributes are unparsed tool attributes, so `attrs_by_path` and `attr_span` read them directly. rust-lang/rust#162395 made `ceil`, `floor`, `trunc`, `round`, `round_ties_even`, `sqrt`, `powf`, `powi` and `fma` generic, with fallback bodies; the one for `powi` calls `__powisf2`/`__powidf2`, which CBMC does not model, so Kani keeps its CBMC models for f32 and f64 (`uses_kani_model`, shared by codegen and reachability). 2. **nightly-2026-11-11.** Tool attributes are now `Attribute::Tool` and lost `meta_item_list`/`is_word`; `AbiAlign` and `GenericArgsRef` were removed; `rustc_abi::Float::X87F80` is reported as unsupported, like `f16b`; and a new clippy lint. Two less obvious ones: - Cargo now reports only the hashed rlib of each Kani library (`libstd-<hash>.rlib`), while the driver links `libstd.rlib` by name, so every test failed to find `std`. `build-kani` renames Kani's rlibs to `lib<crate>.rlib` in the sysroot (renamed, not copied, so rustc never sees two candidates). - Calling a closure through a function pointer argument can now take a pointer to a capture-free closure, which the uninit checker rejected as unsupported (`uninit/delayed-ub` lost its expected failure). Zero-sized closures and function items have no bytes to track. 3. **A model of the `derive(Debug)` helpers.** rust-lang/rust#164726 made `derive(Debug)` pass all names as one space-separated string, which `Formatter::debug_struct_fields_finish` and `Formatter::debug_c_like_enum_write_str` split with `memchr`. Its word-at-a-time loop depends on pointer alignment, and verifying any derived `Debug` became orders of magnitude slower: | Nightly | rust-lang/rust#164726 | `cargo-kani/iss2857` | |---|---|---| | 2026-10-24 | no | 46s | | 2026-10-29 | no | 44s | | 2026-10-30 | yes | > 15 min (stopped) | | 2026-11-11 | yes | > 58 min, 9 GB (stopped) | | 2026-11-11, this PR | yes | 53s | Kani now replaces those two helpers (the `debug_struct_field{1..5}_finish` helpers forward to the first) with models that split the same string with a byte loop and format through the same public builders. `docs/src/soundness.md` lists them as assumptions. 4. **LLBC: zero-sized constants.** MIR now assigns `()` to the return place after the last call of a unit function (`_0 = ()`) as a zero-sized constant, which the LLBC backend did not translate (`todo!()`). It now builds zero-sized tuples and structs field by field, as in model-checking#5045; each LLBC expected output gains that one line. ### Testing - `kani-regression.sh` passes on nightly-2026-11-11 (run in a container with CBMC 6.11.0), apart from `script-based-pre/compiler_defaults` (needs `jq`) and `script-based-pre/cbmc_truncated_results` (depends on the memory limit), which fail only in that container. `kani-llbc-regression.sh` passes (the LLBC build and clippy with `-D warnings`, 20 expected tests and the cargo suite), and `kani-fmt.sh --check` and workspace clippy pass. - `library/kani/src/fmt_model_tests.rs` compares the models with the real `derive(Debug)` output natively (named, tuple and unit structs, more than five fields, nesting, `{:#?}`, widths, C-like enums with raw and non-ASCII names). Checking exact formatter output inside Kani takes over nine minutes per harness, with or without the models, so this is a native test; `tests/kani/FmtDerive` checks that Kani verifies formatting of each shape through the models (84s). - `cargo-kani/iss2857` is the performance regression test. Resolves model-checking#5061 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. --------- Signed-off-by: Felipe R. Monteiro <[email protected]>
View all comments
r? @JonathanBrouwer