rust/tests/ui/traits/new-solver/pointer-like.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
278 B
Rust
Raw Normal View History

2023-02-07 12:02:20 -06:00
// 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 ABI as a pointer
2023-02-07 12:02:20 -06:00
require_(&1i16);
}