]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr
Point at opaque and closure type definitions in type errors
[rust.git] / src / test / ui / type-alias-impl-trait / never_reveal_concrete_type.stderr
1 error[E0308]: mismatched types
2   --> $DIR/never_reveal_concrete_type.rs:13:27
3    |
4 LL | type NoReveal = impl std::fmt::Debug;
5    | ------------------------------------- this is the found opaque type
6 ...
7 LL |     let _: &'static str = x;
8    |            ------------   ^ expected `&str`, found opaque type
9    |            |
10    |            expected due to this
11    |
12    = note: expected reference `&'static str`
13             found opaque type `NoReveal`
14
15 error[E0605]: non-primitive cast: `NoReveal` as `&'static str`
16   --> $DIR/never_reveal_concrete_type.rs:14:13
17    |
18 LL |     let _ = x as &'static str;
19    |             ^^^^^^^^^^^^^^^^^
20    |
21    = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
22
23 error: aborting due to 2 previous errors
24
25 Some errors have detailed explanations: E0308, E0605.
26 For more information about an error, try `rustc --explain E0308`.