diff options
| author | Ralf Jung <post@ralfj.de> | 2024-11-07 08:59:43 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-11-08 09:16:00 +0100 |
| commit | e3010e84dbf2e06424c91c5a3d4206c1911813bd (patch) | |
| tree | e79c95932b5c88f5313d5eb5e45b3c3c41ed7b9f /tests/ui/extern | |
| parent | 78bb5ee79e0261e8e47476b631da02acc1cb03ef (diff) | |
| download | rust-e3010e84dbf2e06424c91c5a3d4206c1911813bd.tar.gz rust-e3010e84dbf2e06424c91c5a3d4206c1911813bd.zip | |
remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead
Diffstat (limited to 'tests/ui/extern')
| -rw-r--r-- | tests/ui/extern/extern-with-type-bounds.rs | 11 | ||||
| -rw-r--r-- | tests/ui/extern/extern-with-type-bounds.stderr | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/tests/ui/extern/extern-with-type-bounds.rs b/tests/ui/extern/extern-with-type-bounds.rs index 99e9801fd40..3fbddfc99a6 100644 --- a/tests/ui/extern/extern-with-type-bounds.rs +++ b/tests/ui/extern/extern-with-type-bounds.rs @@ -1,18 +1,17 @@ #![feature(intrinsics, rustc_attrs)] -extern "rust-intrinsic" { - // Real example from libcore - #[rustc_safe_intrinsic] - fn type_id<T: ?Sized + 'static>() -> u64; +// Intrinsics are the only (?) extern blocks supporting generics. +// Once intrinsics have to be declared via `#[rustc_intrinsic]`, +// the entire support for generics in extern fn can probably be removed. +extern "rust-intrinsic" { // Silent bounds made explicit to make sure they are actually // resolved. fn transmute<T: Sized, U: Sized>(val: T) -> U; // Bounds aren't checked right now, so this should work // even though it's incorrect. - #[rustc_safe_intrinsic] - fn size_of<T: Clone>() -> usize; + fn size_of_val<T: Clone>(x: *const T) -> usize; // Unresolved bounds should still error. fn align_of<T: NoSuchTrait>() -> usize; diff --git a/tests/ui/extern/extern-with-type-bounds.stderr b/tests/ui/extern/extern-with-type-bounds.stderr index 42448d9e924..893947e831f 100644 --- a/tests/ui/extern/extern-with-type-bounds.stderr +++ b/tests/ui/extern/extern-with-type-bounds.stderr @@ -1,5 +1,5 @@ error[E0405]: cannot find trait `NoSuchTrait` in this scope - --> $DIR/extern-with-type-bounds.rs:18:20 + --> $DIR/extern-with-type-bounds.rs:17:20 | LL | fn align_of<T: NoSuchTrait>() -> usize; | ^^^^^^^^^^^ not found in this scope |
