]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr
Tweak "non-primitive cast" error
[rust.git] / src / test / ui / type-alias-impl-trait / never_reveal_concrete_type.stderr
index 07962e36da1e66905187e1574575389e0e197e85..360633bba622b9cf462f090b39729fa783a18fd8 100644 (file)
@@ -1,6 +1,9 @@
 error[E0308]: mismatched types
   --> $DIR/never_reveal_concrete_type.rs:13:27
    |
+LL | type NoReveal = impl std::fmt::Debug;
+   | ------------------------------------- the found opaque type
+...
 LL |     let _: &'static str = x;
    |            ------------   ^ expected `&str`, found opaque type
    |            |
@@ -13,9 +16,7 @@ error[E0605]: non-primitive cast: `NoReveal` as `&'static str`
   --> $DIR/never_reveal_concrete_type.rs:14:13
    |
 LL |     let _ = x as &'static str;
-   |             ^^^^^^^^^^^^^^^^^
-   |
-   = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
+   |             ^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
 
 error: aborting due to 2 previous errors