-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Resolve lifetimes for const generic defaults #93669
Conversation
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
can you add a test for struct Foo<'a, const N: usize = {
let x: &'a ();
3
}>(&'a ()); completely missed lifetimes in const param defaults, this should error. after that r=me, thanks |
missed lifetimes in const parameter defaults, which are currently stable on |
r? @lcnr |
ede78b2
to
bcf9884
Compare
done. this catches that too, since the logic of detecting non- |
@@ -0,0 +1,10 @@ | |||
struct Foo< | |||
'a, |
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.
haha rustfmt is so weird, i swear i didn't do this
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.
^^
thanks for the fix ❤️ @bors r+ rollup |
📌 Commit bcf9884 has been approved by |
… r=lcnr Resolve lifetimes for const generic defaults We weren't visiting the const generic default argument in `rustc_resolve::late::lifetimes`. This seems to fix the issue, and we deny any non-`'static` lifetimes anyways. Fixes rust-lang#93647
…askrgr Rollup of 9 pull requests Successful merges: - rust-lang#91939 (Clarify error on casting larger integers to char) - rust-lang#92300 (mips64-openwrt-linux-musl: Add Tier 3 target) - rust-lang#92383 (Add new target armv7-unknown-linux-uclibceabi (softfloat)) - rust-lang#92651 (Remove "up here" arrow on item-infos) - rust-lang#93556 (Change struct expr pretty printing to match rustfmt style) - rust-lang#93649 (Add regression tests for issue 80309) - rust-lang#93657 (Update CPU idle tracking for apple hosts) - rust-lang#93659 (Refactor conditional) - rust-lang#93669 (Resolve lifetimes for const generic defaults) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
That was fixed separately by rust-lang/rust#93669 Closes #1109
…thewjasper update comment wrt const param defaults after rust-lang#93669 i looked through all other uses of `GenericParamKind::Const` again to detect if we missed the `default` there as well, but afaict we really only missed lifetime resolution '^^ at least i found an outdated comment :3
…ulacrum [beta] backports This backports: * Complete removal of #[main] attribute from compiler rust-lang#93753 * Resolve lifetimes for const generic defaults rust-lang#93669 * backport llvm fix for issue 91671. rust-lang#93426 * Fix invalid special casing of the unreachable! macro rust-lang#93179 * Fix hashing for windows paths containing a CurDir component rust-lang#93697 r? `@Mark-Simulacrum`
We weren't visiting the const generic default argument in
rustc_resolve::late::lifetimes
. This seems to fix the issue, and we deny any non-'static
lifetimes anyways.Fixes #93647