add test files

This commit is contained in:
SparrowLii 2021-12-20 10:39:02 +08:00
parent 5b2a7606ae
commit 643484416b
2 changed files with 24 additions and 0 deletions

View file

@ -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() {}

View file

@ -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`.