rustc_attr_ir: fix up lang_items imports - #160782
Conversation
|
Some changes occurred to the CTFE machinery These commits modify the If this was unintentional then you should revert the changes before this PR is merged. Some changes occurred in match lowering cc @Nadrieril Some changes occurred in match checking cc @Nadrieril
cc @rust-lang/clippy This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @vakaras Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to constck cc @fee1-dead Some changes occurred in compiler/rustc_attr_parsing cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_sanitizers cc @rcvalle Some changes occurred in compiler/rustc_attr_ir cc @jdonszelmann, @JonathanBrouwer Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor Some changes occurred in compiler/rustc_passes/src/check_attr.rs cc @jdonszelmann, @JonathanBrouwer HIR ty lowering was modified cc @fmease changes to the core type system cc @lcnr Some changes occurred in compiler/rustc_ast_lowering/src/format.rs cc @m-ou-se
cc @bjorn3 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Reminder, once the PR becomes ready for a review, use |
|
Some changes occurred in coverage instrumentation. cc @Zalathar
Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri |
|
@rustbot ready I think we should not attempt to merge this in a rollup :) But we best do it today (in the weekend) to minimize disruption. |
| // removing it. | ||
| // This was added in <https://github.com/rust-lang/rust/pull/123302>. | ||
| if tcx.is_lang_item(trait_def_id, rustc_hir::LangItem::Sized) { | ||
| if tcx.is_lang_item(trait_def_id, rustc_hir::attrs::lang::LangItem::Sized) { |
There was a problem hiding this comment.
nit: this can just use the import
There was a problem hiding this comment.
If this is the only thing I find I'd lean towards not fixing it as to not restart PR ci
| @@ -57,7 +57,7 @@ This macro can be used in the following ways: | |||
| * `find_attr!(tcx, <def_id>, Variant(...))` to find an attribute on a def id. | |||
| * `find_attr!(tcx, <hir_id>, Variant(...))` to find an attribute on a HIR id. | |||
| * `find_attr!(tcx, crate, Variant(...))` to find an attribute on the current crate. | |||
| * `find_attr!(attrs, Variant(...))` to find an attribute in attrs, a `&[hir::Attribute]`. | |||
| * `find_attr!(attrs, Variant(...))` to find an attribute in attrs, a `&[Attribute]`. | |||
There was a problem hiding this comment.
This PR in quite a few cases makes it ambiguous which Attribute type is meant, (ast::Attribute or hir::attrs::Attribute = rustc_attr_ir::Attribute), which I don't really like
There was a problem hiding this comment.
I was planning to fix up the guide later, this is an accidental search and replace.
There was a problem hiding this comment.
Note that not all of the dev guide can be updated in this PR because it will run link checker and the links are hardcoded to https://doc.rust-lang.org/nightly/nightly-rustc
| @@ -790,7 +789,7 @@ fn handle_auto_cfg_hide_show(cfg_info: &mut CfgInfo, attr: &CfgHideShow) { | |||
| } | |||
| } | |||
|
|
|||
| pub(crate) fn extract_cfg_from_attrs<'a, I: Iterator<Item = &'a hir::Attribute> + Clone>( | |||
| pub(crate) fn extract_cfg_from_attrs<'a, I: Iterator<Item = &'a Attribute> + Clone>( | |||
There was a problem hiding this comment.
here as well by importing the attribute type
There was a problem hiding this comment.
Why was this rename done? I think the old name is more clear, since this file is about lang items, not about the entire language
There was a problem hiding this comment.
it's shorter, and the attribute is #[lang = ..], not #[lang_item = ...]. Happy to revert it if you want.
There was a problem hiding this comment.
The attribute name is the only place where lang is used, they're called lang items everywhere else
There was a problem hiding this comment.
I think I'm leaning towards splitting up this PR because there is some stuff that I'd still like to have some time to think about, such as having the rustc_hir::attrs re-export, and keeping this PR open for longer than a few days is impossible because it will conflict with absolutely everything.
One change that is quite a large part of the diff of this PR that I'm happy to merge is importing LangItem everywhere, instead of calling it hir::LangItem, maybe we can start with this?
This comment has been minimized.
This comment has been minimized.
Sure, let's start there :) |
lang_items imports
|
@rustbot ready This is only the lang_items related imports. It looks like some unrelated things also got formatted 🤔 |
This comment has been minimized.
This comment has been minimized.
|
|
||
| // Check for newlines in the chunk | ||
| let newlines_test = lsx_vseqi_b::<{b'\n' as i32}>(chunk); | ||
| let newlines_test = lsx_vseqi_b::<{ b'\n' as i32 }>(chunk); |
There was a problem hiding this comment.
Hmmm this PR contains quite a few formatting changes like this, I think all of them are improvements so it's fine to keep them but wonder what causes it
There was a problem hiding this comment.
I had to use cargo fmt to format clippy, but I'm pretty sure I always was in the clippy root when I did 🤔
View all comments
Cleanup after splitting attributes from rustc_hir.
It's a big one and maybe annoying to merge without conflicts but I figured it's best to just get it done and over with. If it turns out to be too big to merge at once it should be possible to split it up tho :>
r? @JonathanBrouwer