fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0599]: no method named `method` found for reference `&T` in the current scope 2 --> $DIR/issue-21673.rs:6:7 3 | 4LL | x.method() 5 | ^^^^^^ method not found in `&T` 6 | 7 = help: items from traits can only be used if the type parameter is bounded by the trait 8help: the following trait defines an item `method`, perhaps you need to restrict type parameter `T` with it: 9 | 10LL | fn call_method<T: std::fmt::Debug + Foo>(x: &T) { 11 | +++++ 12 13error[E0599]: no method named `method` found for type parameter `T` in the current scope 14 --> $DIR/issue-21673.rs:10:7 15 | 16LL | fn call_method_2<T>(x: T) { 17 | - method `method` not found for this type parameter 18LL | x.method() 19 | ^^^^^^ method not found in `T` 20 | 21 = help: items from traits can only be used if the type parameter is bounded by the trait 22help: the following trait defines an item `method`, perhaps you need to restrict type parameter `T` with it: 23 | 24LL | fn call_method_2<T: Foo>(x: T) { 25 | +++++ 26 27error: aborting due to 2 previous errors 28 29For more information about this error, try `rustc --explain E0599`.