fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
1.1 KiB27 linesraw
1error[E0599]: no method named `get_a` found for type `&Self` in the current scope
2  --> $DIR/constrain-trait.rs:15:31
3   |
4LL |         println!("{:?}", self.get_a());
5   |                               ^^^^^ method not found in `&Self`
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 `get_a`, perhaps you need to add another supertrait for it:
9   |
10LL | trait UseString: std::fmt::Debug + GetString {
11   |                                  ^^^^^^^^^^^
12
13error[E0599]: no method named `get_a` found for type `&Self` in the current scope
14  --> $DIR/constrain-trait.rs:21:31
15   |
16LL |         println!("{:?}", self.get_a());
17   |                               ^^^^^ method not found in `&Self`
18   |
19   = help: items from traits can only be used if the type parameter is bounded by the trait
20help: the following trait defines an item `get_a`, perhaps you need to add a supertrait for it:
21   |
22LL | trait UseString2: GetString {
23   |                 ^^^^^^^^^^^
24
25error: aborting due to 2 previous errors
26
27For more information about this error, try `rustc --explain E0599`.