diff options
| author | Yuval Dolev <yuvaldolev2@gmail.com> | 2021-10-28 00:05:38 +0300 |
|---|---|---|
| committer | Yuval Dolev <yuvaldolev2@gmail.com> | 2021-10-29 15:49:55 +0300 |
| commit | e2151497bfb65945102619e019adb677b2f3ed31 (patch) | |
| tree | 02624ffec0a7c3b98108988d89842455201627d3 /src | |
| parent | 37f70a0e1e04086aee7ae57fbefd6d4071953506 (diff) | |
Skip suggestions for the AsRef trait
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/typeck/issue-89806.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/typeck/issue-89806.stderr | 26 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/test/ui/typeck/issue-89806.rs b/src/test/ui/typeck/issue-89806.rs new file mode 100644 index 00000000000..69cec08652a --- /dev/null +++ b/src/test/ui/typeck/issue-89806.rs @@ -0,0 +1,3 @@ +fn main() { + 0u8.as_ref(); //~ ERROR no method named `as_ref` found for type `u8` in the current scope +} diff --git a/src/test/ui/typeck/issue-89806.stderr b/src/test/ui/typeck/issue-89806.stderr new file mode 100644 index 00000000000..9a54fac5261 --- /dev/null +++ b/src/test/ui/typeck/issue-89806.stderr @@ -0,0 +1,26 @@ +error[E0599]: no method named `as_ref` found for type `u8` in the current scope + --> $DIR/issue-89806.rs:2:9 + | +LL | 0u8.as_ref(); + | ^^^^^^ method not found in `u8` + | + ::: $SRC_DIR/core/src/pin.rs:LL:COL + | +LL | pub fn as_ref(&self) -> Pin<&P::Target> { + | ------ + | | + | the method is available for `Pin<&mut u8>` here + | the method is available for `Pin<&u8>` here + | +help: consider wrapping the receiver expression with the appropriate type + | +LL | Pin::new(&mut 0u8).as_ref(); + | +++++++++++++ + +help: consider wrapping the receiver expression with the appropriate type + | +LL | Pin::new(&0u8).as_ref(); + | ++++++++++ + + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. |
