about summary refs log tree commit diff
path: root/tests/ui/suggestions/no-method-found-suggest-trait-args.stderr
blob: 3dcd4667fa09949ad5aacd8d4add666815e7d044 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
error[E0599]: no method named `method` found for type parameter `T` in the current scope
  --> $DIR/no-method-found-suggest-trait-args.rs:15:11
   |
LL | fn foo<T>(value: T) {
   |        - method `method` not found for this type parameter
...
LL |     value.method();
   |           ^^^^^^ method not found in `T`
   |
   = help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `method`, perhaps you need to restrict type parameter `T` with it:
   |
LL | fn foo<T: Trait</* I */>>(value: T) {
   |         ++++++++++++++++

error[E0599]: no method named `method2` found for type parameter `T` in the current scope
  --> $DIR/no-method-found-suggest-trait-args.rs:17:11
   |
LL | fn foo<T>(value: T) {
   |        - method `method2` not found for this type parameter
...
LL |     value.method2();
   |           ^^^^^^^ method not found in `T`
   |
   = help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `method2`, perhaps you need to restrict type parameter `T` with it:
   |
LL | fn foo<T: Trait2</* 'a, A, B */>>(value: T) {
   |         ++++++++++++++++++++++++

error[E0599]: no method named `method` found for type parameter `impl Copy` in the current scope
  --> $DIR/no-method-found-suggest-trait-args.rs:24:11
   |
LL | fn bar(value: impl Copy) {
   |               --------- method `method` not found for this type parameter
...
LL |     value.method();
   |           ^^^^^^ method not found in `impl Copy`
   |
   = help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `method`, perhaps you need to restrict type parameter `impl Copy` with it:
   |
LL | fn bar(value: impl Copy + Trait</* I */>) {
   |                         ++++++++++++++++

error[E0599]: no method named `method2` found for type parameter `impl Copy` in the current scope
  --> $DIR/no-method-found-suggest-trait-args.rs:26:11
   |
LL | fn bar(value: impl Copy) {
   |               --------- method `method2` not found for this type parameter
...
LL |     value.method2();
   |           ^^^^^^^ method not found in `impl Copy`
   |
   = help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `method2`, perhaps you need to restrict type parameter `impl Copy` with it:
   |
LL | fn bar(value: impl Copy + Trait2</* 'a, A, B */>) {
   |                         ++++++++++++++++++++++++

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0599`.