Skip to content

Commit

Permalink
add test files
Browse files Browse the repository at this point in the history
  • Loading branch information
SparrowLii committed Dec 20, 2021
1 parent 5b2a760 commit 6434844
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
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() {}
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`.

0 comments on commit 6434844

Please sign in to comment.