-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Port #[rustc_legacy_const_generics] to use attribute parser
#150000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Port #[rustc_legacy_const_generics] to use attribute parser
#150000
Conversation
|
Some changes occurred in compiler/rustc_hir/src/attrs Some changes occurred in compiler/rustc_attr_parsing Some changes occurred in compiler/rustc_passes/src/check_attr.rs |
2c36833 to
9e9e9a4
Compare
This comment has been minimized.
This comment has been minimized.
|
@rusbot author |
@jdonszelmann I think you pinged the wrong account earlier |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2f0fddb to
5daf590
Compare
This comment has been minimized.
This comment has been minimized.
|
Make sure to squash these commits later |
9a71d29 to
108cdd1
Compare
|
r? jdonszelmann |
|
I'm having trouble getting ahold of the attributes using the I have the following code that compiles, but it doesn't actually actually work (tests fail because of missing const function arguments) let Res::Def(DefKind::Fn, def_id) = self.partial_res_map.get(&expr.id)?.full_res()? else {
return None;
};
// We only support cross-crate argument rewriting. Uses
// within the same crate should be updated to use the new
// const generics style.
if def_id.is_local() {
return None;
}
if !expr.attrs.is_empty() {
dbg!(&expr.attrs);
}
let Some(hir::Attribute::Parsed(AttributeKind::RustcLegacyConstGenerics { fn_indexes, .. })) = AttributeParser::parse_limited(tcx.sess, &expr.attrs, sym::rustc_legacy_const_generics, expr.span, expr.id, Some(tcx.features())) else {
return None;
};
Some(fn_indexes.iter().map(|(num, _)| *num).collect())I think it's that the I did a read of the CI results and it does seem like the performance issues are big. |
|
Reminder, once the PR becomes ready for a review, use |
108cdd1 to
2d245a4
Compare
This comment has been minimized.
This comment has been minimized.
511bed0 to
98a10a8
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
@rustbot author |
98a10a8 to
ee55202
Compare
|
@rustbot ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me,jana after Jana is also happy and possibly after fixing my last nitpick
ee55202 to
f550532
Compare
|
@bors r=jonathanbrouwer,jdonszelmann |
|
@bors rollup |
…generic_args, r=jonathanbrouwer,jdonszelmann Port `#[rustc_legacy_const_generics]` to use attribute parser Small PR that ports the `#[rustc_legacy_const_generics]` to use the new attribute parser! r? JonathanBrouwer
Rollup of 9 pull requests Successful merges: - #148756 (Warn on codegen attributes on required trait methods) - #148790 (Add new Tier-3 target: riscv64im-unknown-none-elf) - #149271 (feat: dlopen Enzyme) - #149354 (Bootstrap config: libgccjit libs dir) - #149459 (std: sys: fs: uefi: Implement set_times and set_perm) - #149950 (Simplify how inline asm handles `MaybeUninit`) - #150000 (Port `#[rustc_legacy_const_generics]` to use attribute parser ) - #150014 (Metadata loader cleanups) - #150021 (document that mpmc channels deliver an item to (at most) one receiver) r? `@ghost` `@rustbot` modify labels: rollup
…generic_args, r=jonathanbrouwer,jdonszelmann Port `#[rustc_legacy_const_generics]` to use attribute parser Small PR that ports the `#[rustc_legacy_const_generics]` to use the new attribute parser! r? JonathanBrouwer
Rollup of 8 pull requests Successful merges: - #148756 (Warn on codegen attributes on required trait methods) - #148790 (Add new Tier-3 target: riscv64im-unknown-none-elf) - #149271 (feat: dlopen Enzyme) - #149459 (std: sys: fs: uefi: Implement set_times and set_perm) - #149950 (Simplify how inline asm handles `MaybeUninit`) - #150000 (Port `#[rustc_legacy_const_generics]` to use attribute parser ) - #150014 (Metadata loader cleanups) - #150021 (document that mpmc channels deliver an item to (at most) one receiver) r? `@ghost` `@rustbot` modify labels: rollup
|
Looks like this failed in rollup due to docs relying on a removed import: #150030 (comment) @bors r- |
|
☔ The latest upstream changes (presumably #143924) made this pull request unmergeable. Please resolve the merge conflicts. |
Small PR that ports the
#[rustc_legacy_const_generics]to use the new attribute parser!r? JonathanBrouwer