-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Move const trait bounds checks to MIR constck #109557
Conversation
LL | f(&UnconstDrop); | ||
| + | ||
LL | f(&mut UnconstDrop); | ||
| ++++ | ||
LL | &f(UnconstDrop); | ||
| + | ||
LL | &mut f(UnconstDrop); | ||
| ++++ |
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.
This is a regression that has something to do with the spans and how trait selection is different in typeck and constck. I will look into 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.
It looks like the span of the ObligationCause
is what caused this. Kind of hard to fix since we don't have access to the machinery that typeck can use.
@@ -1,3 +1,17 @@ | |||
error[E0277]: the trait bound `[closure@$DIR/issue-93647.rs:2:6: 2:8]: Fn<()>` is not satisfied |
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.
Should the message say that we expect a const
bound here too?
📌 Commit c02569683951662e5bde9ebc681235e01ed8a168 has been approved by It is now in the queue for this repository. |
@bors p=1 fixes stable regressions |
⌛ Testing commit c02569683951662e5bde9ebc681235e01ed8a168 with merge 6f6f4caf07539ad18b0d0345e1a041635eda3cdf... |
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
@bors retry: spurious |
@bors retry |
⌛ Testing commit c02569683951662e5bde9ebc681235e01ed8a168 with merge 47b10403e4c0c841f3c427479288049d82377ac2... |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
legit tidy failure |
Fixes rust-lang#109543. When checking paths in HIR typeck, we don't want to check for const predicates since all we want might just be a function pointer. Therefore we move this to MIR constck and check that bounds are met during MIR constck.
c025696
to
054009d
Compare
Fixed |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (6066037): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesThis benchmark run did not return any relevant results for this metric. |
@oli-obk is the stable backport nomination meant for a theoretical 1.68.3 (if it will ever be discussed) or this fix can wait for the next stable (20th, April i.e. ~3 weeks from now)? |
Fixes #109543. When checking paths in HIR typeck, we don't want to check for const predicates since all we want might just be a function pointer. Therefore we move this to MIR constck and check that bounds are met during MIR constck.
r? @oli-obk