|
| 1 | +error[E0599]: no method named `writ` found for type parameter `T` in the current scope |
| 2 | + --> $DIR/similar-method-out-of-scope-trait.rs:25:12 |
| 3 | + | |
| 4 | +LL | fn generic<T: writer::Write>(writer: T) { |
| 5 | + | - method `writ` not found for this type parameter |
| 6 | +LL | writer.writ(); |
| 7 | + | ^^^^ |
| 8 | + | |
| 9 | +help: there is a method `write` with a similar name |
| 10 | + | |
| 11 | +LL | writer.write(); |
| 12 | + | + |
| 13 | + |
| 14 | +error[E0599]: no method named `writ` found for reference `&dyn writer::Write` in the current scope |
| 15 | + --> $DIR/similar-method-out-of-scope-trait.rs:30:12 |
| 16 | + | |
| 17 | +LL | writer.writ(); |
| 18 | + | ^^^^ |
| 19 | + | |
| 20 | +help: there is a method `write` with a similar name |
| 21 | + | |
| 22 | +LL | writer.write(); |
| 23 | + | + |
| 24 | + |
| 25 | +error[E0599]: no method named `write_all` found for struct `Writer` in the current scope |
| 26 | + --> $DIR/similar-method-out-of-scope-trait.rs:36:12 |
| 27 | + | |
| 28 | +LL | pub struct Writer; |
| 29 | + | ----------------- method `write_all` not found for this struct |
| 30 | +... |
| 31 | +LL | fn write_all(&self) {} |
| 32 | + | --------- the method is available for `Writer` here |
| 33 | +... |
| 34 | +LL | writer.write_all(); |
| 35 | + | ^^^^^^^^^ method not found in `Writer` |
| 36 | + | |
| 37 | + = help: items from traits can only be used if the trait is in scope |
| 38 | +help: trait `Write` which provides `write_all` is implemented but not in scope; perhaps you want to import it |
| 39 | + | |
| 40 | +LL + use crate::writer::Write; |
| 41 | + | |
| 42 | + |
| 43 | +error[E0599]: no method named `reed` found for struct `Writer` in the current scope |
| 44 | + --> $DIR/similar-method-out-of-scope-trait.rs:38:12 |
| 45 | + | |
| 46 | +LL | pub struct Writer; |
| 47 | + | ----------------- method `reed` not found for this struct |
| 48 | +... |
| 49 | +LL | writer.reed(); |
| 50 | + | ^^^^ |
| 51 | + | |
| 52 | +help: there is a method `read` with a similar name |
| 53 | + | |
| 54 | +LL - writer.reed(); |
| 55 | +LL + writer.read(); |
| 56 | + | |
| 57 | + |
| 58 | +error[E0599]: no method named `flus` found for struct `Writer` in the current scope |
| 59 | + --> $DIR/similar-method-out-of-scope-trait.rs:40:12 |
| 60 | + | |
| 61 | +LL | pub struct Writer; |
| 62 | + | ----------------- method `flus` not found for this struct |
| 63 | +... |
| 64 | +LL | writer.flus(); |
| 65 | + | ^^^^ |
| 66 | + | |
| 67 | +help: there is a method `flush` with a similar name |
| 68 | + | |
| 69 | +LL | writer.flush(); |
| 70 | + | + |
| 71 | + |
| 72 | +error[E0599]: no method named `method` found for struct `ByValue` in the current scope |
| 73 | + --> $DIR/similar-method-out-of-scope-trait.rs:82:21 |
| 74 | + | |
| 75 | +LL | pub struct ByValue; |
| 76 | + | ------------------ method `method` not found for this struct |
| 77 | +... |
| 78 | +LL | fn method(&self) {} |
| 79 | + | ------ the method is available for `ByValue` here |
| 80 | +... |
| 81 | +LL | hidden::ByValue.method(); |
| 82 | + | ^^^^^^ |
| 83 | + | |
| 84 | + = help: items from traits can only be used if the trait is in scope |
| 85 | +help: trait `Hidden` which provides `method` is implemented but not in scope; perhaps you want to import it |
| 86 | + | |
| 87 | +LL + use crate::hidden::Hidden; |
| 88 | + | |
| 89 | +help: there is a method `method2` with a similar name |
| 90 | + | |
| 91 | +LL | hidden::ByValue.method2(); |
| 92 | + | + |
| 93 | + |
| 94 | +error[E0599]: no method named `method` found for struct `Ambiguous` in the current scope |
| 95 | + --> $DIR/similar-method-out-of-scope-trait.rs:84:23 |
| 96 | + | |
| 97 | +LL | pub struct Ambiguous; |
| 98 | + | -------------------- method `method` not found for this struct |
| 99 | +... |
| 100 | +LL | fn method(&self) {} |
| 101 | + | ------ the method is available for `Ambiguous` here |
| 102 | +... |
| 103 | +LL | hidden::Ambiguous.method(); |
| 104 | + | ^^^^^^ |
| 105 | + | |
| 106 | + = help: items from traits can only be used if the trait is in scope |
| 107 | +help: trait `HiddenRef` which provides `method` is implemented but not in scope; perhaps you want to import it |
| 108 | + | |
| 109 | +LL + use crate::hidden::HiddenRef; |
| 110 | + | |
| 111 | +help: there is a method `method2` with a similar name |
| 112 | + | |
| 113 | +LL | hidden::Ambiguous.method2(); |
| 114 | + | + |
| 115 | + |
| 116 | +error[E0599]: no method named `method` found for struct `Inherent` in the current scope |
| 117 | + --> $DIR/similar-method-out-of-scope-trait.rs:86:22 |
| 118 | + | |
| 119 | +LL | pub struct Inherent; |
| 120 | + | ------------------- method `method` not found for this struct |
| 121 | +... |
| 122 | +LL | fn method(&self) {} |
| 123 | + | ------ the method is available for `Inherent` here |
| 124 | +... |
| 125 | +LL | hidden::Inherent.method(); |
| 126 | + | ^^^^^^ |
| 127 | + | |
| 128 | + = help: items from traits can only be used if the trait is in scope |
| 129 | +help: trait `Hidden` which provides `method` is implemented but not in scope; perhaps you want to import it |
| 130 | + | |
| 131 | +LL + use crate::hidden::Hidden; |
| 132 | + | |
| 133 | +help: there is a method `method2` with a similar name |
| 134 | + | |
| 135 | +LL | hidden::Inherent.method2(); |
| 136 | + | + |
| 137 | + |
| 138 | +error: aborting due to 8 previous errors |
| 139 | + |
| 140 | +For more information about this error, try `rustc --explain E0599`. |
0 commit comments