-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Enforce type of const param correctly in MIR typeck #138283
base: master
Are you sure you want to change the base?
Enforce type of const param correctly in MIR typeck #138283
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
… r=<try> Enforce type of const param correctly in MIR typeck Properly intercepts and then annotates the type for a `ConstKind::Param` in the MIR. This code should probably be cleaned up, it's kinda spaghetti, but no better structure really occurred to me when writing this case. We could probably gate this behind the feature gate or add a fast path when the args have no free regions if perf is bad. r? `@BoxyUwU`
This comment has been minimized.
This comment has been minimized.
Forgor the stderr test, will push when try build is done. |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
c745d61
to
9926d69
Compare
This comment has been minimized.
This comment has been minimized.
9926d69
to
a026bdb
Compare
Finished benchmarking commit (f102e38): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (primary 2.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 769.881s -> 768.249s (-0.21%) |
Can you add a test case that doesn't rely on #![feature(adt_const_params, unsized_const_params)]
use std::marker::ConstParamTy_;
trait Trait<'a> {
type Assoc: ConstParamTy_;
}
fn foo<'a, const N: <u8 as Trait<'static>>::Assoc>()
where
for<'b> u8: Trait<'b>
{
// Should error but doesn't on nightly
let _: <u8 as Trait<'a>>::Assoc = N;
} I don't think you can do it without |
a026bdb
to
b9c77ef
Compare
Added a test with a fun trick to create a type that has invariant lifetimes but also is @rustbot ready |
b9c77ef
to
2097cda
Compare
thx gamer, r=me if/when CI passes |
☔ The latest upstream changes (presumably #138416) made this pull request unmergeable. Please resolve the merge conflicts. |
2097cda
to
c3c5b92
Compare
This comment has been minimized.
This comment has been minimized.
c3c5b92
to
0160c60
Compare
Properly intercepts and then annotates the type for a
ConstKind::Param
in the MIR.This code should probably be cleaned up, it's kinda spaghetti, but no better structure really occurred to me when writing this case.
We could probably gate this behind the feature gate or add a fast path when the args have no free regions if perf is bad.
r? @BoxyUwU