-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #92112 - SparrowLii:issue92010, r=cjgillot
Fix the error of checking `base_expr` twice in type_changing_struct_update Fixes #92010
- Loading branch information
Showing
3 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...est/ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#[derive(Clone)] | ||
struct P<T> { | ||
x: T, | ||
y: f64, | ||
} | ||
|
||
impl<T> P<T> { | ||
fn y(&self, y: f64) -> Self { P{y, .. self.clone() } } | ||
//~^ mismatched types [E0308] | ||
} | ||
|
||
fn main() {} |
12 changes: 12 additions & 0 deletions
12
...ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/issue-92010-trait-bound-not-satisfied.rs:8:43 | ||
| | ||
LL | 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>` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |