rust/tests/ui/traits/new-solver/pointer-like.rs
2023-02-07 19:05:53 +00:00

15 lines
293 B
Rust

// compile-flags: -Ztrait-solver=next
#![feature(pointer_like_trait)]
use std::marker::PointerLike;
fn require_(_: impl PointerLike) {}
fn main() {
require_(1usize);
require_(1u16);
//~^ ERROR `u16` needs to have the same alignment and size as a pointer
require_(&1i16);
}