Closed
Description
trait Zoo {
type X;
}
impl Zoo for u16 {
type X = usize;
}
fn foo(abc: <u16 as Zoo>::X) {}
fn main() {
let x: *const u8 = foo as _;
}
Errors:
Compiling playground v0.0.1 (file:///playground)
error[E0605]: non-primitive cast: `fn(<u16 as Zoo>::X) {foo}` as `*const u8`
--> src/main.rs:13:24
|
13 | let x: *const u8 = foo as _;
| ^^^^^^^^
|
= note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
error: aborting due to previous error
For more information about this error, try `rustc --explain E0605`.
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
Seems like this should work.