-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Delayed bug audit #121285
Delayed bug audit #121285
Conversation
Some changes occurred in match checking cc @Nadrieril |
bdad5b9
to
f96c99b
Compare
☔ The latest upstream changes (presumably #120576) made this pull request unmergeable. Please resolve the merge conflicts. |
f96c99b
to
939277d
Compare
I rebased. |
☔ The latest upstream changes (presumably #121383) made this pull request unmergeable. Please resolve the merge conflicts. |
Sorry, I'm kind of swamped and don't currently have the patience to review this as closely as it deserves r? compiler |
r? @lcnr |
939277d
to
d7ecac8
Compare
let result: Result<_, ErrorGuaranteed> = self | ||
.param_env | ||
.and(type_op::normalize::Normalize::new(ty)) | ||
.fully_perform(self.infcx, span) | ||
else { | ||
.fully_perform(self.infcx, span); | ||
let Ok(TypeOpOutput { output: norm_ty, constraints: c, .. }) = result else { | ||
// Note: this path is currently not reached in any test, so | ||
// any example that triggers this would be worth minimizing | ||
// and converting into a test. | ||
tcx.dcx().span_delayed_bug(span, format!("failed to normalize {ty:?}")); | ||
continue; | ||
}; | ||
|
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.
why this change?
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.
The commit message explains it:
The existing code calls a function that returns `Result<_,
ErrorGuaranteed>`, and then calls `span_delayed_bug` pointlessly in the
`Err` case.
The comment was added since I first wrote this, I will remove it. Or I could instead insert a span_bug
here.
The existing code calls a function that returns `Result<_, ErrorGuaranteed>`, and then calls `span_delayed_bug` pointlessly in the `Err` case.
I find the function much easier to read this way. Thanks to @kadiwa4 for the suggestion.
…_ribs`. `Resolver::report_error` always emits (this commit makes that clearer), so the `span_delayed_bug` is unnecessary.
Also change its return type to `Result`.
By returning error guarantees from a few functions it relies on.
By storing error guarantees in `RegionErrors`.
To make them more concise and similar to each other.
d7ecac8
to
a8a486c
Compare
New code is up, hopefully it addresses all the comments. |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (9afdb8d): comparison URL. Overall result: ✅ improvements - 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. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 651.401s -> 650.65s (-0.12%) |
This wasn't expected to have any effect on performance. I suspect the (good) results are just noise. |
I went through all the calls to
delayed_bug
andspan_delayed_bug
and found a few places where they could be avoided.r? @compiler-errors