-
-
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.
|
@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. |
f550532 to
4bd0e65
Compare
|
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. |
|
@rustbot ready |
|
@bors try jobs=dist-x86_64-linux-alt |
This comment has been minimized.
This comment has been minimized.
…s, r=<try> Port `#[rustc_legacy_const_generics]` to use attribute parser try-job: dist-x86_64-linux-alt
|
@bors r=jonathanbrouwer,jdonszelmann |
…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
…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 4 pull requests Successful merges: - #150000 (Port `#[rustc_legacy_const_generics]` to use attribute parser ) - #150060 (autodiff: emit an error if we fail to find libEnzyme) - #150070 (Partially revert #147888 and print warning if LLVM CMake dir is missing when building Enzyme) - #150072 (Port #[no_link] to use attribute parser) r? `@ghost` `@rustbot` modify labels: rollup
Small PR that ports the
#[rustc_legacy_const_generics]to use the new attribute parser!r? JonathanBrouwer