-
Notifications
You must be signed in to change notification settings - Fork 13.4k
rustc 1.59.0-nightly (c5ecc1570 2021-12-15): panic when trait bound not satisfied #92010
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Output on stable: error[E0308]: mismatched types
--> <source>:8:43
|
8 | fn y(&self, y: f64) -> Self { P{y, .. self.clone() } }
| ^^^^^^^^^^^^ expected struct `P`, found `&P<T>`
|
= note: expected struct `P<T>`
found reference `&P<T>` (An awkward but correct error - without searched nightlies: from nightly-2021-10-16 to nightly-2021-11-28 bisected with cargo-bisect-rustc v0.6.1Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --preserve --start=2021-10-16 --end=2021-11-28 --regress=ice @rustbot label regression-from-stable-to-beta |
Probably #90035? |
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group. @rustbot label -I-prioritize +P-medium |
I think this is a duplicate of #91502, and I also put up a fix in #91538 (along with both @SparrowLii in #92112 and @Aaron1011 in #92083) which has been waiting for a review for quite some time.. Not sure which one of our PRs should be approved, but at least one of them should :^) -- re: #92112, I agree with Aaron that this is the simpler and more targeted fix for the bug, so I'll just close mine after this gets approved probably. (edit: made it clearer who I was referring to in the original comment - lol, sorry) |
thanks @compiler-errors for the note! I'll also add (as a self-reminder) that in #92083 Aaron also mentions that #92112 might be a better fix. |
Code
The following code:
triggers a panic in the compiler (see below). All works as expected if I write
impl<T: Clone>
.Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: