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

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

13 lines
287 B
Rust
Raw Normal View History

2023-01-18 17:21:12 -06:00
#![feature(pointer_sized_trait)]
use std::marker::PointerSized;
fn require_pointer_sized(_: impl PointerSized) {}
fn main() {
require_pointer_sized(1usize);
require_pointer_sized(1u16);
//~^ ERROR `u16` needs to be a pointer-sized type
require_pointer_sized(&1i16);
}