]> git.lizzy.rs Git - rust.git/blob - tests/ui/extern/extern-with-type-bounds.rs
Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc
[rust.git] / tests / ui / extern / extern-with-type-bounds.rs
1 #![feature(intrinsics)]
2
3 extern "rust-intrinsic" {
4     // Real example from libcore
5     #[rustc_safe_intrinsic]
6     fn type_id<T: ?Sized + 'static>() -> u64;
7
8     // Silent bounds made explicit to make sure they are actually
9     // resolved.
10     fn transmute<T: Sized, U: Sized>(val: T) -> U;
11
12     // Bounds aren't checked right now, so this should work
13     // even though it's incorrect.
14     #[rustc_safe_intrinsic]
15     fn size_of<T: Clone>() -> usize;
16
17     // Unresolved bounds should still error.
18     fn align_of<T: NoSuchTrait>() -> usize;
19     //~^ ERROR cannot find trait `NoSuchTrait` in this scope
20 }
21
22 fn main() {}