blob: 3059ccdffb458a5dc7eef86959f9a0900f2f9214 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
//@ run-rustfix
struct S;
trait Trait {
fn foo() {}
}
impl Trait for &mut S {}
trait Trait2 {
fn bar() {}
}
impl Trait2 for &S {}
impl Trait2 for &mut S {}
fn main() {
let _ = &str::from("value");
//~^ ERROR the trait bound `str: From<_>` is not satisfied
//~| ERROR the size for values of type `str` cannot be known at compilation time
let _ = &mut S::foo();
//~^ ERROR the trait bound `S: Trait` is not satisfied
let _ = &S::foo();
//~^ ERROR the trait bound `S: Trait` is not satisfied
let _ = S::foo();
//~^ ERROR the trait bound `S: Trait` is not satisfied
let _ = &mut S::bar();
//~^ ERROR the trait bound `S: Trait2` is not satisfied
let _ = &S::bar();
//~^ ERROR the trait bound `S: Trait2` is not satisfied
}
|