blob: 00b92b42bb5cd1f5d6b4768ff54da844296e5141 (
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 _ = <&mut S>::foo();
//~^ ERROR the trait bound `S: Trait` is not satisfied
let _ = <&mut 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
}
|