-
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
fix [type error] for error E0029 and E0277 #106499
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jackh726 (or someone else) soon. Please see the contribution instructions for more information. |
You'll need to fix this:
Remove one trailing line from that file (some editors will show a single trailing line as no line at all, and some will show them, if you remove all trailing empty lines tidy will also complain). |
r? @estebank |
c1131e6
to
7f3cfff
Compare
You need to re |
7f3cfff
to
dc3c056
Compare
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
Outdated
Show resolved
Hide resolved
if self.point_at_returns_when_relevant(&mut err, &obligation) { | ||
err.delay_as_bug(); | ||
} |
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.
To mirror what compiler-errors said, here you could instead check if obligation.predicate.references_error()
, instead of changing point_at_returns_when_relevant
.
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.
I tried, but it didn't work, thus obligation.predicate.references_error()
behaves differently from ty_references_error()
.
I've changed point_at_returns_when_relevant()
as Michael suggested, which works well.
dc3c056
to
01161d4
Compare
I think |
I'd have to agree :) |
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Outdated
Show resolved
Hide resolved
check explicitly for the type references error if ty.references_error() is true change the error to be err.delay_as_bug() and prevent the error E0029 and E0277 from emitting out this fix rust-lang#105946
01161d4
to
10dbcf0
Compare
@bors r+ |
Rollup of 5 pull requests Successful merges: - rust-lang#106400 (Point at expressions where inference refines an unexpected type) - rust-lang#106491 (Fix error-index redirect to work with the back button.) - rust-lang#106494 (Add regression test for rust-lang#58355) - rust-lang#106499 (fix [type error] for error E0029 and E0277) - rust-lang#106502 (rustdoc: remove legacy user-select CSS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
check explicitly for the type references error
if ty.references_error() is true change the error to be err.delay_as_bug() and prevent the error E0029 and E0277 from emitting out this fix #105946