diff options
Diffstat (limited to 'gcc/testsuite/rust/compile')
178 files changed, 548 insertions, 1 deletions
diff --git a/gcc/testsuite/rust/compile/bounds1.rs b/gcc/testsuite/rust/compile/bounds1.rs index 1ace9fb..a02e6f6 100644 --- a/gcc/testsuite/rust/compile/bounds1.rs +++ b/gcc/testsuite/rust/compile/bounds1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + mod core { mod ops { #[lang = "add"] diff --git a/gcc/testsuite/rust/compile/canonical_paths1.rs b/gcc/testsuite/rust/compile/canonical_paths1.rs index 193e7b5..bd6f3b2 100644 --- a/gcc/testsuite/rust/compile/canonical_paths1.rs +++ b/gcc/testsuite/rust/compile/canonical_paths1.rs @@ -1,4 +1,7 @@ // { dg-additional-options "-w -fdump-tree-gimple -frust-crate=example" } +#[lang = "sized"] +pub trait Sized {} + struct Foo(i32); trait TR { diff --git a/gcc/testsuite/rust/compile/cast_generics.rs b/gcc/testsuite/rust/compile/cast_generics.rs index 7d18596..469fa94 100644 --- a/gcc/testsuite/rust/compile/cast_generics.rs +++ b/gcc/testsuite/rust/compile/cast_generics.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + fn test<T>(a: T) -> T { a } diff --git a/gcc/testsuite/rust/compile/closure_no_type_anno.rs b/gcc/testsuite/rust/compile/closure_no_type_anno.rs index ff2c8b8..b647da7 100644 --- a/gcc/testsuite/rust/compile/closure_no_type_anno.rs +++ b/gcc/testsuite/rust/compile/closure_no_type_anno.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + #[lang = "fn_once"] trait FnOnce<Args> { type Output; diff --git a/gcc/testsuite/rust/compile/complex_qualified_path_in_expr.rs b/gcc/testsuite/rust/compile/complex_qualified_path_in_expr.rs index 6244a6b..5036410 100644 --- a/gcc/testsuite/rust/compile/complex_qualified_path_in_expr.rs +++ b/gcc/testsuite/rust/compile/complex_qualified_path_in_expr.rs @@ -1,4 +1,7 @@ -struct S; // { dg-warning "struct is never constructed" "" { target *-*-* } .-1 } +#[lang = "sized"] +pub trait Sized {} + +struct S; // { dg-warning "struct is never constructed" } impl S { fn f() -> i32 { return 0; } // { dg-warning "associated function is never used" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/const-issue1440.rs b/gcc/testsuite/rust/compile/const-issue1440.rs index 2529a1c..3a2989c 100644 --- a/gcc/testsuite/rust/compile/const-issue1440.rs +++ b/gcc/testsuite/rust/compile/const-issue1440.rs @@ -1,6 +1,9 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] +#[lang = "sized"] +pub trait Sized {} + mod intrinsics { extern "rust-intrinsic" { pub fn wrapping_add<T>(a: T, b: T) -> T; diff --git a/gcc/testsuite/rust/compile/const_generics_1.rs b/gcc/testsuite/rust/compile/const_generics_1.rs index bcad8ee..5d4ca64 100644 --- a/gcc/testsuite/rust/compile/const_generics_1.rs +++ b/gcc/testsuite/rust/compile/const_generics_1.rs @@ -3,6 +3,9 @@ // There are errors about unused generic parameters, but we can't handle that yet. // Still, this code is invalid Rust. +#[lang = "sized"] +pub trait Sized {} + mod sain { struct Foo<const N: usize>; struct Bar<T, const N: usize>; diff --git a/gcc/testsuite/rust/compile/const_generics_8.rs b/gcc/testsuite/rust/compile/const_generics_8.rs index b0bb262..c781083 100644 --- a/gcc/testsuite/rust/compile/const_generics_8.rs +++ b/gcc/testsuite/rust/compile/const_generics_8.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Bidule<const N: i32 = 15> {} enum Bidoule<const N: i32 = 15> {} diff --git a/gcc/testsuite/rust/compile/derive_macro1.rs b/gcc/testsuite/rust/compile/derive_macro1.rs index 1318228..779aad78e 100644 --- a/gcc/testsuite/rust/compile/derive_macro1.rs +++ b/gcc/testsuite/rust/compile/derive_macro1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub trait Clone { fn clone(&self) -> Self; } diff --git a/gcc/testsuite/rust/compile/derive_macro3.rs b/gcc/testsuite/rust/compile/derive_macro3.rs index 35284d8..1c7d473 100644 --- a/gcc/testsuite/rust/compile/derive_macro3.rs +++ b/gcc/testsuite/rust/compile/derive_macro3.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub trait Clone { fn clone(&self) -> Self; } diff --git a/gcc/testsuite/rust/compile/derive_macro4.rs b/gcc/testsuite/rust/compile/derive_macro4.rs index 564555f..7802e8f 100644 --- a/gcc/testsuite/rust/compile/derive_macro4.rs +++ b/gcc/testsuite/rust/compile/derive_macro4.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub trait Copy {} pub trait Clone { fn clone(&self) -> Self; diff --git a/gcc/testsuite/rust/compile/derive_macro6.rs b/gcc/testsuite/rust/compile/derive_macro6.rs index 0254754..b7bf7a7 100644 --- a/gcc/testsuite/rust/compile/derive_macro6.rs +++ b/gcc/testsuite/rust/compile/derive_macro6.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub trait Copy {} pub trait Clone { fn clone(&self) -> Self; diff --git a/gcc/testsuite/rust/compile/expected_type_args2.rs b/gcc/testsuite/rust/compile/expected_type_args2.rs index 7945420..11a70be 100644 --- a/gcc/testsuite/rust/compile/expected_type_args2.rs +++ b/gcc/testsuite/rust/compile/expected_type_args2.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A>(A); fn main() { diff --git a/gcc/testsuite/rust/compile/expected_type_args3.rs b/gcc/testsuite/rust/compile/expected_type_args3.rs index ba07239..7003f7a 100644 --- a/gcc/testsuite/rust/compile/expected_type_args3.rs +++ b/gcc/testsuite/rust/compile/expected_type_args3.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A>(A); impl Foo { diff --git a/gcc/testsuite/rust/compile/generics1.rs b/gcc/testsuite/rust/compile/generics1.rs index de1bbf5..e9bdb3a 100644 --- a/gcc/testsuite/rust/compile/generics1.rs +++ b/gcc/testsuite/rust/compile/generics1.rs @@ -1,5 +1,8 @@ // { dg-error "expected .i32. got .i8." "" { target *-*-* } 0 } +#[lang = "sized"] +pub trait Sized {} + struct GenericStruct<T>(T, usize); fn main() { diff --git a/gcc/testsuite/rust/compile/generics11.rs b/gcc/testsuite/rust/compile/generics11.rs index 4d3b9e1..10b5880 100644 --- a/gcc/testsuite/rust/compile/generics11.rs +++ b/gcc/testsuite/rust/compile/generics11.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<T>(T, bool); impl<T> Foo<T> { diff --git a/gcc/testsuite/rust/compile/generics12.rs b/gcc/testsuite/rust/compile/generics12.rs index f1ac8b0..b32f566 100644 --- a/gcc/testsuite/rust/compile/generics12.rs +++ b/gcc/testsuite/rust/compile/generics12.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + fn main() { bar(); // { dg-error "type annotations needed" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/generics2.rs b/gcc/testsuite/rust/compile/generics2.rs index 5812b13..fc203ab 100644 --- a/gcc/testsuite/rust/compile/generics2.rs +++ b/gcc/testsuite/rust/compile/generics2.rs @@ -1,5 +1,8 @@ // { dg-error "expected .i32. got .i8." "" { target *-*-* } 0 } +#[lang = "sized"] +pub trait Sized {} + struct GenericStruct<T>(T, usize); fn main() { diff --git a/gcc/testsuite/rust/compile/generics3.rs b/gcc/testsuite/rust/compile/generics3.rs index 2d42105..e28953c 100644 --- a/gcc/testsuite/rust/compile/generics3.rs +++ b/gcc/testsuite/rust/compile/generics3.rs @@ -1,4 +1,7 @@ // { dg-error "expected .i32. got .i8." "" { target *-*-* } 0 } +#[lang = "sized"] +pub trait Sized {} + struct GenericStruct<T>(T, usize); fn main() { diff --git a/gcc/testsuite/rust/compile/generics4.rs b/gcc/testsuite/rust/compile/generics4.rs index e8fe23c..31b681a 100644 --- a/gcc/testsuite/rust/compile/generics4.rs +++ b/gcc/testsuite/rust/compile/generics4.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct GenericStruct<T>(T, usize); fn main() { diff --git a/gcc/testsuite/rust/compile/generics6.rs b/gcc/testsuite/rust/compile/generics6.rs index ad5b682..00b93c3 100644 --- a/gcc/testsuite/rust/compile/generics6.rs +++ b/gcc/testsuite/rust/compile/generics6.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A> { a: A, } diff --git a/gcc/testsuite/rust/compile/generics7.rs b/gcc/testsuite/rust/compile/generics7.rs index aeb91a6..f2cd607 100644 --- a/gcc/testsuite/rust/compile/generics7.rs +++ b/gcc/testsuite/rust/compile/generics7.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A> { a: A, } diff --git a/gcc/testsuite/rust/compile/generics8.rs b/gcc/testsuite/rust/compile/generics8.rs index ceefc5d..99df0c9 100644 --- a/gcc/testsuite/rust/compile/generics8.rs +++ b/gcc/testsuite/rust/compile/generics8.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A, B>(A, B); impl<T> Foo<i32, T> { diff --git a/gcc/testsuite/rust/compile/if_let_expr.rs b/gcc/testsuite/rust/compile/if_let_expr.rs index ffa367b..7bab19a 100644 --- a/gcc/testsuite/rust/compile/if_let_expr.rs +++ b/gcc/testsuite/rust/compile/if_let_expr.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub enum Option<T> { None, Some(T), diff --git a/gcc/testsuite/rust/compile/issue-1005.rs b/gcc/testsuite/rust/compile/issue-1005.rs index 46c85ee..15d4bef 100644 --- a/gcc/testsuite/rust/compile/issue-1005.rs +++ b/gcc/testsuite/rust/compile/issue-1005.rs @@ -1,4 +1,7 @@ // { dg-additional-options "-w" } +#[lang = "sized"] +pub trait Sized {} + impl<T> *const T { fn test(self) {} } diff --git a/gcc/testsuite/rust/compile/issue-1019.rs b/gcc/testsuite/rust/compile/issue-1019.rs index aea86a8..1f77ba9 100644 --- a/gcc/testsuite/rust/compile/issue-1019.rs +++ b/gcc/testsuite/rust/compile/issue-1019.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait A<T> { type Output; diff --git a/gcc/testsuite/rust/compile/issue-1031.rs b/gcc/testsuite/rust/compile/issue-1031.rs index a9049de..cd1da47 100644 --- a/gcc/testsuite/rust/compile/issue-1031.rs +++ b/gcc/testsuite/rust/compile/issue-1031.rs @@ -1,5 +1,8 @@ #![feature(intrinsics)] +#[lang = "sized"] +pub trait Sized {} + extern "rust-intrinsic" { #[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")] pub fn offset<T>(dst: *const T, offset: isize) -> *const T; diff --git a/gcc/testsuite/rust/compile/issue-1034.rs b/gcc/testsuite/rust/compile/issue-1034.rs index 23d7700..d40005e 100644 --- a/gcc/testsuite/rust/compile/issue-1034.rs +++ b/gcc/testsuite/rust/compile/issue-1034.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo<T> { type Output; diff --git a/gcc/testsuite/rust/compile/issue-1128.rs b/gcc/testsuite/rust/compile/issue-1128.rs index 462426b..8960ebb 100644 --- a/gcc/testsuite/rust/compile/issue-1128.rs +++ b/gcc/testsuite/rust/compile/issue-1128.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub trait Hasher { fn write(&mut self, bytes: &[u8]); fn write_u8(&mut self, i: u8) { diff --git a/gcc/testsuite/rust/compile/issue-1129-2.rs b/gcc/testsuite/rust/compile/issue-1129-2.rs index 25d30fa..cfe01b5 100644 --- a/gcc/testsuite/rust/compile/issue-1129-2.rs +++ b/gcc/testsuite/rust/compile/issue-1129-2.rs @@ -1,4 +1,7 @@ // { dg-additional-options "-w" } +#[lang = "sized"] +pub trait Sized {} + pub trait Hasher { fn finish(&self) -> u64; fn write(&mut self, bytes: &[u8]); diff --git a/gcc/testsuite/rust/compile/issue-1130.rs b/gcc/testsuite/rust/compile/issue-1130.rs index 6d265cb..115e6aa 100644 --- a/gcc/testsuite/rust/compile/issue-1130.rs +++ b/gcc/testsuite/rust/compile/issue-1130.rs @@ -1,6 +1,9 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] +#[lang = "sized"] +pub trait Sized {} + mod mem { extern "rust-intrinsic" { fn size_of<T>() -> usize; diff --git a/gcc/testsuite/rust/compile/issue-1131.rs b/gcc/testsuite/rust/compile/issue-1131.rs index 5cb9caf..86eeb98 100644 --- a/gcc/testsuite/rust/compile/issue-1131.rs +++ b/gcc/testsuite/rust/compile/issue-1131.rs @@ -1,5 +1,8 @@ #![feature(intrinsics)] +#[lang = "sized"] +pub trait Sized {} + extern "rust-intrinsic" { fn size_of<T>() -> usize; fn offset<T>(dst: *const T, offset: isize) -> *const T; diff --git a/gcc/testsuite/rust/compile/issue-1165.rs b/gcc/testsuite/rust/compile/issue-1165.rs index f588969..a637823 100644 --- a/gcc/testsuite/rust/compile/issue-1165.rs +++ b/gcc/testsuite/rust/compile/issue-1165.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<T>(T); fn main() { diff --git a/gcc/testsuite/rust/compile/issue-1173.rs b/gcc/testsuite/rust/compile/issue-1173.rs index 5c2a917..a8fd93e 100644 --- a/gcc/testsuite/rust/compile/issue-1173.rs +++ b/gcc/testsuite/rust/compile/issue-1173.rs @@ -2,6 +2,9 @@ #![feature(intrinsics)] +#[lang = "sized"] +pub trait Sized {} + mod mem { extern "rust-intrinsic" { pub fn transmute<U, V>(_: U) -> V; diff --git a/gcc/testsuite/rust/compile/issue-1235.rs b/gcc/testsuite/rust/compile/issue-1235.rs index 098b337..7c85ac4 100644 --- a/gcc/testsuite/rust/compile/issue-1235.rs +++ b/gcc/testsuite/rust/compile/issue-1235.rs @@ -1,4 +1,7 @@ // { dg-additional-options "-w" } +#[lang = "sized"] +pub trait Sized {} + struct FatPtr<T> { data: *const T, len: usize, diff --git a/gcc/testsuite/rust/compile/issue-1237.rs b/gcc/testsuite/rust/compile/issue-1237.rs index 54a51df..79b60b0 100644 --- a/gcc/testsuite/rust/compile/issue-1237.rs +++ b/gcc/testsuite/rust/compile/issue-1237.rs @@ -1,6 +1,9 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] +#[lang = "sized"] +pub trait Sized {} + mod intrinsics { extern "rust-intrinsic" { pub fn offset<T>(ptr: *const T, count: isize) -> *const T; diff --git a/gcc/testsuite/rust/compile/issue-1289.rs b/gcc/testsuite/rust/compile/issue-1289.rs index 3d7716a..9251d79 100644 --- a/gcc/testsuite/rust/compile/issue-1289.rs +++ b/gcc/testsuite/rust/compile/issue-1289.rs @@ -1,5 +1,8 @@ #![feature(intrinsics)] +#[lang = "sized"] +pub trait Sized {} + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/compile/issue-1383.rs b/gcc/testsuite/rust/compile/issue-1383.rs index cca12e8..dac4b2a 100644 --- a/gcc/testsuite/rust/compile/issue-1383.rs +++ b/gcc/testsuite/rust/compile/issue-1383.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub fn generic_function<X>(a: X) -> X { a } diff --git a/gcc/testsuite/rust/compile/issue-1447.rs b/gcc/testsuite/rust/compile/issue-1447.rs index e0543e6..6d58f7a 100644 --- a/gcc/testsuite/rust/compile/issue-1447.rs +++ b/gcc/testsuite/rust/compile/issue-1447.rs @@ -1,4 +1,7 @@ // { dg-options "-w" } +#[lang = "sized"] +pub trait Sized {} + struct PhantomData<T>; struct Hasher<S> { diff --git a/gcc/testsuite/rust/compile/issue-1589.rs b/gcc/testsuite/rust/compile/issue-1589.rs index 79a5866..45f2415 100644 --- a/gcc/testsuite/rust/compile/issue-1589.rs +++ b/gcc/testsuite/rust/compile/issue-1589.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub trait A: B {} // { dg-error "trait cycle detected" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/issue-1725-1.rs b/gcc/testsuite/rust/compile/issue-1725-1.rs index 1ace9fb..a02e6f6 100644 --- a/gcc/testsuite/rust/compile/issue-1725-1.rs +++ b/gcc/testsuite/rust/compile/issue-1725-1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + mod core { mod ops { #[lang = "add"] diff --git a/gcc/testsuite/rust/compile/issue-1725-2.rs b/gcc/testsuite/rust/compile/issue-1725-2.rs index 8bfd0bb..01ed287 100644 --- a/gcc/testsuite/rust/compile/issue-1725-2.rs +++ b/gcc/testsuite/rust/compile/issue-1725-2.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + mod core { mod ops { #[lang = "add"] diff --git a/gcc/testsuite/rust/compile/issue-1773.rs b/gcc/testsuite/rust/compile/issue-1773.rs index c627ac0..a4542aea0 100644 --- a/gcc/testsuite/rust/compile/issue-1773.rs +++ b/gcc/testsuite/rust/compile/issue-1773.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo<T> { type A; diff --git a/gcc/testsuite/rust/compile/issue-1786.rs b/gcc/testsuite/rust/compile/issue-1786.rs index f73b63d..1c46fee 100644 --- a/gcc/testsuite/rust/compile/issue-1786.rs +++ b/gcc/testsuite/rust/compile/issue-1786.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + #[lang = "clone"] trait Clone { fn clone(&self) -> Self; diff --git a/gcc/testsuite/rust/compile/issue-1893.rs b/gcc/testsuite/rust/compile/issue-1893.rs index 6be1d6d..46c53e9 100644 --- a/gcc/testsuite/rust/compile/issue-1893.rs +++ b/gcc/testsuite/rust/compile/issue-1893.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub enum Option<T> { None, Some(T), diff --git a/gcc/testsuite/rust/compile/issue-1901.rs b/gcc/testsuite/rust/compile/issue-1901.rs index b2a7080..dd41ff8 100644 --- a/gcc/testsuite/rust/compile/issue-1901.rs +++ b/gcc/testsuite/rust/compile/issue-1901.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + mod intrinsics { extern "rust-intrinsic" { pub fn offset<T>(ptr: *const T, count: isize) -> *const T; diff --git a/gcc/testsuite/rust/compile/issue-1930.rs b/gcc/testsuite/rust/compile/issue-1930.rs index ab30ccc..071b3da 100644 --- a/gcc/testsuite/rust/compile/issue-1930.rs +++ b/gcc/testsuite/rust/compile/issue-1930.rs @@ -1,4 +1,7 @@ // { dg-options "-w" } +#[lang = "sized"] +pub trait Sized {} + fn test<T>(x: *mut T) { let x = x as *mut u8; } diff --git a/gcc/testsuite/rust/compile/issue-1981.rs b/gcc/testsuite/rust/compile/issue-1981.rs index 9ad2a55..b1637ac 100644 --- a/gcc/testsuite/rust/compile/issue-1981.rs +++ b/gcc/testsuite/rust/compile/issue-1981.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + mod intrinsics { extern "rust-intrinsic" { pub fn offset<T>(ptr: *const T, count: isize) -> *const T; diff --git a/gcc/testsuite/rust/compile/issue-2019-1.rs b/gcc/testsuite/rust/compile/issue-2019-1.rs index f359ea4..e91e347 100644 --- a/gcc/testsuite/rust/compile/issue-2019-1.rs +++ b/gcc/testsuite/rust/compile/issue-2019-1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + #[lang = "add"] pub trait Add<RHS = Self> { type Output; diff --git a/gcc/testsuite/rust/compile/issue-2019-2.rs b/gcc/testsuite/rust/compile/issue-2019-2.rs index 37c8e30..9f7c0c0 100644 --- a/gcc/testsuite/rust/compile/issue-2019-2.rs +++ b/gcc/testsuite/rust/compile/issue-2019-2.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + #[lang = "add"] pub trait Add<RHS = Self> { type Output; diff --git a/gcc/testsuite/rust/compile/issue-2019-3.rs b/gcc/testsuite/rust/compile/issue-2019-3.rs index 6789038..c95ce43 100644 --- a/gcc/testsuite/rust/compile/issue-2019-3.rs +++ b/gcc/testsuite/rust/compile/issue-2019-3.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + macro_rules! forward_ref_binop { (impl $imp:ident, $method:ident for $t:ty, $u:ty) => { forward_ref_binop!(impl $imp, $method for $t, $u, diff --git a/gcc/testsuite/rust/compile/issue-2036.rs b/gcc/testsuite/rust/compile/issue-2036.rs index d145975..8701b20 100644 --- a/gcc/testsuite/rust/compile/issue-2036.rs +++ b/gcc/testsuite/rust/compile/issue-2036.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Hash<H> { fn hash2(&self, hasher: &H) -> u64; } diff --git a/gcc/testsuite/rust/compile/issue-2037.rs b/gcc/testsuite/rust/compile/issue-2037.rs index ec27a0d..8adcb97 100644 --- a/gcc/testsuite/rust/compile/issue-2037.rs +++ b/gcc/testsuite/rust/compile/issue-2037.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { fn bar(&mut self, other: &mut Foo); } diff --git a/gcc/testsuite/rust/compile/issue-2070.rs b/gcc/testsuite/rust/compile/issue-2070.rs index 46f3520..981e599 100644 --- a/gcc/testsuite/rust/compile/issue-2070.rs +++ b/gcc/testsuite/rust/compile/issue-2070.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { fn get(self) -> i32; } diff --git a/gcc/testsuite/rust/compile/issue-2105.rs b/gcc/testsuite/rust/compile/issue-2105.rs index 7d1c9a1..28f170e 100644 --- a/gcc/testsuite/rust/compile/issue-2105.rs +++ b/gcc/testsuite/rust/compile/issue-2105.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub enum Option<T> { Some(T), None, diff --git a/gcc/testsuite/rust/compile/issue-2106.rs b/gcc/testsuite/rust/compile/issue-2106.rs index a4f235c..4af57c8 100644 --- a/gcc/testsuite/rust/compile/issue-2106.rs +++ b/gcc/testsuite/rust/compile/issue-2106.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo(u32); // { dg-warning "struct is never constructed" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/issue-2135.rs b/gcc/testsuite/rust/compile/issue-2135.rs index 563345e..9f4d3e1 100644 --- a/gcc/testsuite/rust/compile/issue-2135.rs +++ b/gcc/testsuite/rust/compile/issue-2135.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub trait Foo<A> { fn foo(self, _: A) -> u16; } diff --git a/gcc/testsuite/rust/compile/issue-2136-1.rs b/gcc/testsuite/rust/compile/issue-2136-1.rs index fcf1efc..f0af551 100644 --- a/gcc/testsuite/rust/compile/issue-2136-1.rs +++ b/gcc/testsuite/rust/compile/issue-2136-1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub trait Foo { fn foo(); } diff --git a/gcc/testsuite/rust/compile/issue-2136-2.rs b/gcc/testsuite/rust/compile/issue-2136-2.rs index 7317f3f..b25820d 100644 --- a/gcc/testsuite/rust/compile/issue-2136-2.rs +++ b/gcc/testsuite/rust/compile/issue-2136-2.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct S; impl S { diff --git a/gcc/testsuite/rust/compile/issue-2139.rs b/gcc/testsuite/rust/compile/issue-2139.rs index 77bf78d..3b9ad95 100644 --- a/gcc/testsuite/rust/compile/issue-2139.rs +++ b/gcc/testsuite/rust/compile/issue-2139.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub trait Foo { fn foo(); } diff --git a/gcc/testsuite/rust/compile/issue-2142.rs b/gcc/testsuite/rust/compile/issue-2142.rs index 7a8bb2a..a3ec228 100644 --- a/gcc/testsuite/rust/compile/issue-2142.rs +++ b/gcc/testsuite/rust/compile/issue-2142.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + #[lang = "fn_once"] pub trait FnOnce<Args> { #[lang = "fn_once_output"] diff --git a/gcc/testsuite/rust/compile/issue-2165.rs b/gcc/testsuite/rust/compile/issue-2165.rs index 199bc13..5bbde65 100644 --- a/gcc/testsuite/rust/compile/issue-2165.rs +++ b/gcc/testsuite/rust/compile/issue-2165.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub trait Alpha<T = Self> { type Beta; } diff --git a/gcc/testsuite/rust/compile/issue-2166.rs b/gcc/testsuite/rust/compile/issue-2166.rs index f333888..318f0a6 100644 --- a/gcc/testsuite/rust/compile/issue-2166.rs +++ b/gcc/testsuite/rust/compile/issue-2166.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Add { type Output; diff --git a/gcc/testsuite/rust/compile/issue-2190-1.rs b/gcc/testsuite/rust/compile/issue-2190-1.rs index 3e43e54..057d7c7 100644 --- a/gcc/testsuite/rust/compile/issue-2190-1.rs +++ b/gcc/testsuite/rust/compile/issue-2190-1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + #[lang = "deref"] trait Deref { type Target; diff --git a/gcc/testsuite/rust/compile/issue-2190-2.rs b/gcc/testsuite/rust/compile/issue-2190-2.rs index 48ab72b..1c93338 100644 --- a/gcc/testsuite/rust/compile/issue-2190-2.rs +++ b/gcc/testsuite/rust/compile/issue-2190-2.rs @@ -1,4 +1,7 @@ // { dg-options "-w" } +#[lang = "sized"] +pub trait Sized {} + #[lang = "deref"] trait Deref { type Target; diff --git a/gcc/testsuite/rust/compile/issue-2195.rs b/gcc/testsuite/rust/compile/issue-2195.rs index c955df4..fc158c3 100644 --- a/gcc/testsuite/rust/compile/issue-2195.rs +++ b/gcc/testsuite/rust/compile/issue-2195.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct A<T> { // { dg-warning "struct is never constructed" "" { target *-*-* } .-1 } f: *const T, diff --git a/gcc/testsuite/rust/compile/issue-2238.rs b/gcc/testsuite/rust/compile/issue-2238.rs index b0c7e36..38871b3 100644 --- a/gcc/testsuite/rust/compile/issue-2238.rs +++ b/gcc/testsuite/rust/compile/issue-2238.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + fn main() { struct Foo; diff --git a/gcc/testsuite/rust/compile/issue-2304.rs b/gcc/testsuite/rust/compile/issue-2304.rs index 243cf10..8313033 100644 --- a/gcc/testsuite/rust/compile/issue-2304.rs +++ b/gcc/testsuite/rust/compile/issue-2304.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + #[lang = "add"] pub trait Add<RHS = Self> { type Output; diff --git a/gcc/testsuite/rust/compile/issue-2375.rs b/gcc/testsuite/rust/compile/issue-2375.rs new file mode 100644 index 0000000..a61fef8 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-2375.rs @@ -0,0 +1,14 @@ +#[lang = "sized"] +pub trait Sized {} + +pub trait Trait { + fn foo(&self) -> Self + where + Self: Sized; +} + +pub fn static_foo<T: Trait + ?Sized>(_b: &T) {} + +pub fn dynamic_bar(a: &dyn Trait) { + static_foo(a) +} diff --git a/gcc/testsuite/rust/compile/issue-850.rs b/gcc/testsuite/rust/compile/issue-850.rs index 531cbf4..e42b557 100644 --- a/gcc/testsuite/rust/compile/issue-850.rs +++ b/gcc/testsuite/rust/compile/issue-850.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/compile/issue-855.rs b/gcc/testsuite/rust/compile/issue-855.rs index f48e3a1..9e450dd 100644 --- a/gcc/testsuite/rust/compile/issue-855.rs +++ b/gcc/testsuite/rust/compile/issue-855.rs @@ -1,5 +1,8 @@ pub use result::Result::{self, Err, Ok}; +#[lang = "sized"] +pub trait Sized {} + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/compile/issue-925.rs b/gcc/testsuite/rust/compile/issue-925.rs index 930b192..2d536a5 100644 --- a/gcc/testsuite/rust/compile/issue-925.rs +++ b/gcc/testsuite/rust/compile/issue-925.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct S; trait A { fn foo(&self); diff --git a/gcc/testsuite/rust/compile/macro-issue1400.rs b/gcc/testsuite/rust/compile/macro-issue1400.rs index 971bd77..5c51b78 100644 --- a/gcc/testsuite/rust/compile/macro-issue1400.rs +++ b/gcc/testsuite/rust/compile/macro-issue1400.rs @@ -1,5 +1,8 @@ // { dg-additional-options "-w" } +#[lang = "sized"] +pub trait Sized {} + macro_rules! foo { ( ( $( $Trait: ident ),+ ) for $Ty: ident ) => { $( diff --git a/gcc/testsuite/rust/compile/macro20.rs b/gcc/testsuite/rust/compile/macro20.rs index 9f3cbca..e03455b 100644 --- a/gcc/testsuite/rust/compile/macro20.rs +++ b/gcc/testsuite/rust/compile/macro20.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + macro_rules! define_trait { ($assoc:ident, $i:item) => { type $assoc; diff --git a/gcc/testsuite/rust/compile/macro23.rs b/gcc/testsuite/rust/compile/macro23.rs index afaca9b..a6a2afd 100644 --- a/gcc/testsuite/rust/compile/macro23.rs +++ b/gcc/testsuite/rust/compile/macro23.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + macro_rules! maybe_impl { ($left:ident, $right:ident, $l_fn:ident, $r_fn:ident) => { fn $l_fn(value: T) -> Maybe<T> { diff --git a/gcc/testsuite/rust/compile/macro40.rs b/gcc/testsuite/rust/compile/macro40.rs index 7151f3a..f9d048e 100644 --- a/gcc/testsuite/rust/compile/macro40.rs +++ b/gcc/testsuite/rust/compile/macro40.rs @@ -1,5 +1,8 @@ // { dg-additional-options "-w" } +#[lang = "sized"] +pub trait Sized {} + macro_rules! t { () => { i32 diff --git a/gcc/testsuite/rust/compile/macro54.rs b/gcc/testsuite/rust/compile/macro54.rs index afb20263..d3b3f80 100644 --- a/gcc/testsuite/rust/compile/macro54.rs +++ b/gcc/testsuite/rust/compile/macro54.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + macro_rules! foo { () => {"foo"}; (number) => { 12 }; diff --git a/gcc/testsuite/rust/compile/name_resolution2.rs b/gcc/testsuite/rust/compile/name_resolution2.rs index 343f628..7e4f5a1 100644 --- a/gcc/testsuite/rust/compile/name_resolution2.rs +++ b/gcc/testsuite/rust/compile/name_resolution2.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Bar; trait Foo { diff --git a/gcc/testsuite/rust/compile/name_resolution4.rs b/gcc/testsuite/rust/compile/name_resolution4.rs index 1c138e8..b2eadbe 100644 --- a/gcc/testsuite/rust/compile/name_resolution4.rs +++ b/gcc/testsuite/rust/compile/name_resolution4.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { fn foo(&self) {} // { dg-warning "unused name" } } diff --git a/gcc/testsuite/rust/compile/nested_generic.rs b/gcc/testsuite/rust/compile/nested_generic.rs index 6c31099..322b3c5 100644 --- a/gcc/testsuite/rust/compile/nested_generic.rs +++ b/gcc/testsuite/rust/compile/nested_generic.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub struct A<T>(T); pub struct B<T>(T); diff --git a/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg.rs b/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg.rs index fbe79f0..ba1042a 100644 --- a/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg.rs +++ b/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { type A; diff --git a/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg2.rs b/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg2.rs index ba5d9a3..a2662c2 100644 --- a/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg2.rs +++ b/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg2.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { type A; diff --git a/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg3.rs b/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg3.rs index 72c1b95..b4342e8 100644 --- a/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg3.rs +++ b/gcc/testsuite/rust/compile/parse_associated_type_as_generic_arg3.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Bar { type B; diff --git a/gcc/testsuite/rust/compile/parse_complex_generic_application.rs b/gcc/testsuite/rust/compile/parse_complex_generic_application.rs index d5c7bf4..02877dd 100644 --- a/gcc/testsuite/rust/compile/parse_complex_generic_application.rs +++ b/gcc/testsuite/rust/compile/parse_complex_generic_application.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub enum Either<T, E> { Left(T), Right(E), diff --git a/gcc/testsuite/rust/compile/parse_complex_generic_application2.rs b/gcc/testsuite/rust/compile/parse_complex_generic_application2.rs index 0361931..5ebc94f 100644 --- a/gcc/testsuite/rust/compile/parse_complex_generic_application2.rs +++ b/gcc/testsuite/rust/compile/parse_complex_generic_application2.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub enum Either<L, R> { Left(L), Right(R), diff --git a/gcc/testsuite/rust/compile/path_as_generic_arg.rs b/gcc/testsuite/rust/compile/path_as_generic_arg.rs index 35b3160..21baf80 100644 --- a/gcc/testsuite/rust/compile/path_as_generic_arg.rs +++ b/gcc/testsuite/rust/compile/path_as_generic_arg.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub enum Result<T, E> { Ok(T), Err(E), diff --git a/gcc/testsuite/rust/compile/privacy4.rs b/gcc/testsuite/rust/compile/privacy4.rs index d1ce0af..648b7b9 100644 --- a/gcc/testsuite/rust/compile/privacy4.rs +++ b/gcc/testsuite/rust/compile/privacy4.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + mod orange { mod green { fn bean<T>(value: T) -> T { diff --git a/gcc/testsuite/rust/compile/privacy6.rs b/gcc/testsuite/rust/compile/privacy6.rs index 487ed02..1680c24 100644 --- a/gcc/testsuite/rust/compile/privacy6.rs +++ b/gcc/testsuite/rust/compile/privacy6.rs @@ -1,5 +1,8 @@ // { dg-additional-options "-w" } +#[lang = "sized"] +pub trait Sized {} + struct Adt; enum EAdt { V0, diff --git a/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs b/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs index 310da66..a5f0c2b 100644 --- a/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs +++ b/gcc/testsuite/rust/compile/sizeof-stray-infer-var-bug.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + mod mem { extern "rust-intrinsic" { pub fn size_of<T>() -> usize; diff --git a/gcc/testsuite/rust/compile/stmt_with_block_dot.rs b/gcc/testsuite/rust/compile/stmt_with_block_dot.rs index ae623c3..c7037af 100644 --- a/gcc/testsuite/rust/compile/stmt_with_block_dot.rs +++ b/gcc/testsuite/rust/compile/stmt_with_block_dot.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub struct A(i32, i32); trait Clone { diff --git a/gcc/testsuite/rust/compile/torture/associated_types1.rs b/gcc/testsuite/rust/compile/torture/associated_types1.rs index bf181df..2be7037 100644 --- a/gcc/testsuite/rust/compile/torture/associated_types1.rs +++ b/gcc/testsuite/rust/compile/torture/associated_types1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub trait Foo { type A; diff --git a/gcc/testsuite/rust/compile/torture/forward_decl_5.rs b/gcc/testsuite/rust/compile/torture/forward_decl_5.rs index 73a47fe..670ab0a 100644 --- a/gcc/testsuite/rust/compile/torture/forward_decl_5.rs +++ b/gcc/testsuite/rust/compile/torture/forward_decl_5.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub fn main() { let a; a = foo { a: 123, b: 456f32 }; diff --git a/gcc/testsuite/rust/compile/torture/generics1.rs b/gcc/testsuite/rust/compile/torture/generics1.rs index 87bcdc8..b32eddd 100644 --- a/gcc/testsuite/rust/compile/torture/generics1.rs +++ b/gcc/testsuite/rust/compile/torture/generics1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo { a: f32, b: bool, diff --git a/gcc/testsuite/rust/compile/torture/generics10.rs b/gcc/testsuite/rust/compile/torture/generics10.rs index 8473d49..1a17e84 100644 --- a/gcc/testsuite/rust/compile/torture/generics10.rs +++ b/gcc/testsuite/rust/compile/torture/generics10.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<T>(T); struct Bar<T> { diff --git a/gcc/testsuite/rust/compile/torture/generics11.rs b/gcc/testsuite/rust/compile/torture/generics11.rs index 3c8f5ba..9d5e719 100644 --- a/gcc/testsuite/rust/compile/torture/generics11.rs +++ b/gcc/testsuite/rust/compile/torture/generics11.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<T>(T, u32); type TypeAlias = Foo<i32>; diff --git a/gcc/testsuite/rust/compile/torture/generics12.rs b/gcc/testsuite/rust/compile/torture/generics12.rs index f31be58..9347b24 100644 --- a/gcc/testsuite/rust/compile/torture/generics12.rs +++ b/gcc/testsuite/rust/compile/torture/generics12.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct GenericStruct<T>(T, usize); impl GenericStruct<i32> { diff --git a/gcc/testsuite/rust/compile/torture/generics13.rs b/gcc/testsuite/rust/compile/torture/generics13.rs index 9eb598f..00b26ec 100644 --- a/gcc/testsuite/rust/compile/torture/generics13.rs +++ b/gcc/testsuite/rust/compile/torture/generics13.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A> { a: A, // { dg-warning "field is never read" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/torture/generics14.rs b/gcc/testsuite/rust/compile/torture/generics14.rs index e51a407..5be39eb 100644 --- a/gcc/testsuite/rust/compile/torture/generics14.rs +++ b/gcc/testsuite/rust/compile/torture/generics14.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A> { a: A, // { dg-warning "field is never read" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/torture/generics15.rs b/gcc/testsuite/rust/compile/torture/generics15.rs index c16a67c..2b1f31c 100644 --- a/gcc/testsuite/rust/compile/torture/generics15.rs +++ b/gcc/testsuite/rust/compile/torture/generics15.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<T>(T, bool); impl Foo<i32> { diff --git a/gcc/testsuite/rust/compile/torture/generics16.rs b/gcc/testsuite/rust/compile/torture/generics16.rs index 15b9d7b..a9fa2eb 100644 --- a/gcc/testsuite/rust/compile/torture/generics16.rs +++ b/gcc/testsuite/rust/compile/torture/generics16.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<T>(T, bool); impl Foo<i32> { diff --git a/gcc/testsuite/rust/compile/torture/generics17.rs b/gcc/testsuite/rust/compile/torture/generics17.rs index d523149..9a04158 100644 --- a/gcc/testsuite/rust/compile/torture/generics17.rs +++ b/gcc/testsuite/rust/compile/torture/generics17.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<T>(T); impl<X> Foo<X> { diff --git a/gcc/testsuite/rust/compile/torture/generics18.rs b/gcc/testsuite/rust/compile/torture/generics18.rs index 4c98b86..cb7b1fa 100644 --- a/gcc/testsuite/rust/compile/torture/generics18.rs +++ b/gcc/testsuite/rust/compile/torture/generics18.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<T>(T); impl<X> Foo<X> { diff --git a/gcc/testsuite/rust/compile/torture/generics19.rs b/gcc/testsuite/rust/compile/torture/generics19.rs index 9a5b4cb..c98599f 100644 --- a/gcc/testsuite/rust/compile/torture/generics19.rs +++ b/gcc/testsuite/rust/compile/torture/generics19.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<X, Y>(X, Y); impl<T> Foo<u32, T> { diff --git a/gcc/testsuite/rust/compile/torture/generics2.rs b/gcc/testsuite/rust/compile/torture/generics2.rs index da0ab99..e720b42 100644 --- a/gcc/testsuite/rust/compile/torture/generics2.rs +++ b/gcc/testsuite/rust/compile/torture/generics2.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo(f32, bool); struct GenericStruct<T>(T, usize); diff --git a/gcc/testsuite/rust/compile/torture/generics20.rs b/gcc/testsuite/rust/compile/torture/generics20.rs index 8fe1cff..92b022e 100644 --- a/gcc/testsuite/rust/compile/torture/generics20.rs +++ b/gcc/testsuite/rust/compile/torture/generics20.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A, B>(A, B); impl<T> Foo<T, T> { diff --git a/gcc/testsuite/rust/compile/torture/generics21.rs b/gcc/testsuite/rust/compile/torture/generics21.rs index dc4e935..1c74ea4 100644 --- a/gcc/testsuite/rust/compile/torture/generics21.rs +++ b/gcc/testsuite/rust/compile/torture/generics21.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + fn callee<T>(t: &T) -> i32 { // { dg-warning "unused name" "" { target *-*-* } .-1 } 32 diff --git a/gcc/testsuite/rust/compile/torture/generics22.rs b/gcc/testsuite/rust/compile/torture/generics22.rs index 465ebb0..b838e6e 100644 --- a/gcc/testsuite/rust/compile/torture/generics22.rs +++ b/gcc/testsuite/rust/compile/torture/generics22.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + fn callee<T>(t: (T, bool)) -> i32 { // { dg-warning "unused name" "" { target *-*-* } .-1 } 32 diff --git a/gcc/testsuite/rust/compile/torture/generics23.rs b/gcc/testsuite/rust/compile/torture/generics23.rs index 2169e36..bf4dfb5 100644 --- a/gcc/testsuite/rust/compile/torture/generics23.rs +++ b/gcc/testsuite/rust/compile/torture/generics23.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A = f32>(A); fn main() { diff --git a/gcc/testsuite/rust/compile/torture/generics24.rs b/gcc/testsuite/rust/compile/torture/generics24.rs index 0de45a8..ce782c0 100644 --- a/gcc/testsuite/rust/compile/torture/generics24.rs +++ b/gcc/testsuite/rust/compile/torture/generics24.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A = (isize, char)> { a: A, } diff --git a/gcc/testsuite/rust/compile/torture/generics25.rs b/gcc/testsuite/rust/compile/torture/generics25.rs index e7792e3..4fe952a 100644 --- a/gcc/testsuite/rust/compile/torture/generics25.rs +++ b/gcc/testsuite/rust/compile/torture/generics25.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A, B = (A, A)>(A, B); fn main() { diff --git a/gcc/testsuite/rust/compile/torture/generics26.rs b/gcc/testsuite/rust/compile/torture/generics26.rs index 522e16f..0111add 100644 --- a/gcc/testsuite/rust/compile/torture/generics26.rs +++ b/gcc/testsuite/rust/compile/torture/generics26.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + // github issue #415 fn test<A, B>(a: A, b: B) -> (A, B) { (a, b) diff --git a/gcc/testsuite/rust/compile/torture/generics27.rs b/gcc/testsuite/rust/compile/torture/generics27.rs index 9871638..c4ca4db 100644 --- a/gcc/testsuite/rust/compile/torture/generics27.rs +++ b/gcc/testsuite/rust/compile/torture/generics27.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + // github issue #415 fn test<A>(a: &A) -> &A { a diff --git a/gcc/testsuite/rust/compile/torture/generics28.rs b/gcc/testsuite/rust/compile/torture/generics28.rs index 8cee8b0..c1ffd9c 100644 --- a/gcc/testsuite/rust/compile/torture/generics28.rs +++ b/gcc/testsuite/rust/compile/torture/generics28.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A, B>(A, B); impl Foo<i32, f32> { diff --git a/gcc/testsuite/rust/compile/torture/generics29.rs b/gcc/testsuite/rust/compile/torture/generics29.rs index e09a104..e9c693e 100644 --- a/gcc/testsuite/rust/compile/torture/generics29.rs +++ b/gcc/testsuite/rust/compile/torture/generics29.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A, B>(A, B); impl Foo<i32, f32> { diff --git a/gcc/testsuite/rust/compile/torture/generics3.rs b/gcc/testsuite/rust/compile/torture/generics3.rs index ceec8f7..4c5dabc 100644 --- a/gcc/testsuite/rust/compile/torture/generics3.rs +++ b/gcc/testsuite/rust/compile/torture/generics3.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + fn test<T>(a: T) -> T { a } diff --git a/gcc/testsuite/rust/compile/torture/generics30.rs b/gcc/testsuite/rust/compile/torture/generics30.rs index 229f6d1..24ae58f 100644 --- a/gcc/testsuite/rust/compile/torture/generics30.rs +++ b/gcc/testsuite/rust/compile/torture/generics30.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A, B>(A, B); impl<T> Foo<T, f32> { diff --git a/gcc/testsuite/rust/compile/torture/generics31.rs b/gcc/testsuite/rust/compile/torture/generics31.rs index 68ad4bf..f8e2f36 100644 --- a/gcc/testsuite/rust/compile/torture/generics31.rs +++ b/gcc/testsuite/rust/compile/torture/generics31.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A, B>(A, B); impl<T> Foo<T, f32> { diff --git a/gcc/testsuite/rust/compile/torture/generics32.rs b/gcc/testsuite/rust/compile/torture/generics32.rs index 21b9cae..49c4539 100644 --- a/gcc/testsuite/rust/compile/torture/generics32.rs +++ b/gcc/testsuite/rust/compile/torture/generics32.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A, B>(A, B); impl<T> Foo<T, f32> { diff --git a/gcc/testsuite/rust/compile/torture/generics4.rs b/gcc/testsuite/rust/compile/torture/generics4.rs index 915cc49..54bdf56 100644 --- a/gcc/testsuite/rust/compile/torture/generics4.rs +++ b/gcc/testsuite/rust/compile/torture/generics4.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<T> { a: T, // { dg-warning "field is never read" "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/torture/generics5.rs b/gcc/testsuite/rust/compile/torture/generics5.rs index b7f4302..df27fdd 100644 --- a/gcc/testsuite/rust/compile/torture/generics5.rs +++ b/gcc/testsuite/rust/compile/torture/generics5.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + fn test<T>(a: T) -> T { a } diff --git a/gcc/testsuite/rust/compile/torture/generics6.rs b/gcc/testsuite/rust/compile/torture/generics6.rs index 5456b6d..16b85fb 100644 --- a/gcc/testsuite/rust/compile/torture/generics6.rs +++ b/gcc/testsuite/rust/compile/torture/generics6.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<T>(T); struct Bar<T> { diff --git a/gcc/testsuite/rust/compile/torture/generics7.rs b/gcc/testsuite/rust/compile/torture/generics7.rs index e8e5ca6..66454d6 100644 --- a/gcc/testsuite/rust/compile/torture/generics7.rs +++ b/gcc/testsuite/rust/compile/torture/generics7.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<T>(T); struct Bar { diff --git a/gcc/testsuite/rust/compile/torture/generics8.rs b/gcc/testsuite/rust/compile/torture/generics8.rs index 036d855..bc6d09b 100644 --- a/gcc/testsuite/rust/compile/torture/generics8.rs +++ b/gcc/testsuite/rust/compile/torture/generics8.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct GenericStruct<T>(T, usize); impl<T> GenericStruct<T> { diff --git a/gcc/testsuite/rust/compile/torture/generics9.rs b/gcc/testsuite/rust/compile/torture/generics9.rs index 307c34f..3d9d748 100644 --- a/gcc/testsuite/rust/compile/torture/generics9.rs +++ b/gcc/testsuite/rust/compile/torture/generics9.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct GenericStruct<T>(T, usize); impl<T> GenericStruct<T> { diff --git a/gcc/testsuite/rust/compile/torture/intrinsics-2.rs b/gcc/testsuite/rust/compile/torture/intrinsics-2.rs index 6b2339f..a6cd8f8 100644 --- a/gcc/testsuite/rust/compile/torture/intrinsics-2.rs +++ b/gcc/testsuite/rust/compile/torture/intrinsics-2.rs @@ -2,6 +2,9 @@ #![feature(intrinsics)] +#[lang = "sized"] +pub trait Sized {} + extern "rust-intrinsic" { pub fn size_of<T>() -> usize; } diff --git a/gcc/testsuite/rust/compile/torture/intrinsics-6.rs b/gcc/testsuite/rust/compile/torture/intrinsics-6.rs index 4e510e1..0e26345 100644 --- a/gcc/testsuite/rust/compile/torture/intrinsics-6.rs +++ b/gcc/testsuite/rust/compile/torture/intrinsics-6.rs @@ -1,5 +1,8 @@ #![feature(intrinsics)] +#[lang = "sized"] +pub trait Sized {} + extern "rust-intrinsic" { pub fn unchecked_add<T>(x: T, y: T) -> T; pub fn unchecked_sub<T>(x: T, y: T) -> T; diff --git a/gcc/testsuite/rust/compile/torture/intrinsics-7.rs b/gcc/testsuite/rust/compile/torture/intrinsics-7.rs index da85fff..754aacb 100644 --- a/gcc/testsuite/rust/compile/torture/intrinsics-7.rs +++ b/gcc/testsuite/rust/compile/torture/intrinsics-7.rs @@ -1,5 +1,8 @@ #![feature(intrinsics)] +#[lang = "sized"] +pub trait Sized {} + extern "rust-intrinsic" { pub fn unchecked_add<T>(x: T, y: T) -> T; // { dg-error "unchecked operation intrinsics can only be used with basic integer types .got .NotAdd.." "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/torture/intrinsics-8.rs b/gcc/testsuite/rust/compile/torture/intrinsics-8.rs index 8788da5..deb19bd 100644 --- a/gcc/testsuite/rust/compile/torture/intrinsics-8.rs +++ b/gcc/testsuite/rust/compile/torture/intrinsics-8.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + mod intrinsics { extern "rust-intrinsic" { pub fn add_with_overflow<T>(x: T, y: T) -> (T, bool); diff --git a/gcc/testsuite/rust/compile/torture/issue-1024.rs b/gcc/testsuite/rust/compile/torture/issue-1024.rs index a8503ce..819e329 100644 --- a/gcc/testsuite/rust/compile/torture/issue-1024.rs +++ b/gcc/testsuite/rust/compile/torture/issue-1024.rs @@ -1,5 +1,8 @@ #![feature(intrinsics)] +#[lang = "sized"] +pub trait Sized {} + extern "rust-intrinsic" { pub fn size_of<T>() -> usize; } diff --git a/gcc/testsuite/rust/compile/torture/issue-1075.rs b/gcc/testsuite/rust/compile/torture/issue-1075.rs index 201a241..d23774b 100644 --- a/gcc/testsuite/rust/compile/torture/issue-1075.rs +++ b/gcc/testsuite/rust/compile/torture/issue-1075.rs @@ -1,6 +1,9 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] +#[lang = "sized"] +pub trait Sized {} + extern "rust-intrinsic" { #[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")] pub fn offset<T>(dst: *const T, offset: isize) -> *const T; diff --git a/gcc/testsuite/rust/compile/torture/issue-1432.rs b/gcc/testsuite/rust/compile/torture/issue-1432.rs index 0269823..5b526fd 100644 --- a/gcc/testsuite/rust/compile/torture/issue-1432.rs +++ b/gcc/testsuite/rust/compile/torture/issue-1432.rs @@ -1,5 +1,9 @@ // { dg-additional-options "-w" } #![feature(intrinsics)] + +#[lang = "sized"] +pub trait Sized {} + mod intrinsics { extern "rust-intrinsic" { #[rustc_const_stable(feature = "const_int_wrapping", since = "1.40.0")] diff --git a/gcc/testsuite/rust/compile/torture/issue-1555.rs b/gcc/testsuite/rust/compile/torture/issue-1555.rs index adb4891..bee8952 100644 --- a/gcc/testsuite/rust/compile/torture/issue-1555.rs +++ b/gcc/testsuite/rust/compile/torture/issue-1555.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/compile/torture/issue-368.rs b/gcc/testsuite/rust/compile/torture/issue-368.rs index 18bc9bd..775e70d 100644 --- a/gcc/testsuite/rust/compile/torture/issue-368.rs +++ b/gcc/testsuite/rust/compile/torture/issue-368.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct S; fn foo<S>(s: S) -> S { diff --git a/gcc/testsuite/rust/compile/torture/issue-808.rs b/gcc/testsuite/rust/compile/torture/issue-808.rs index 2e5a81f..4186d54 100644 --- a/gcc/testsuite/rust/compile/torture/issue-808.rs +++ b/gcc/testsuite/rust/compile/torture/issue-808.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub trait Foo { type Target; diff --git a/gcc/testsuite/rust/compile/torture/issue-862.rs b/gcc/testsuite/rust/compile/torture/issue-862.rs index c1a4609..d9ac912 100644 --- a/gcc/testsuite/rust/compile/torture/issue-862.rs +++ b/gcc/testsuite/rust/compile/torture/issue-862.rs @@ -1,4 +1,8 @@ // { dg-additional-options "-w" } + +#[lang = "sized"] +pub trait Sized {} + extern "C" { fn printf(s: *const i8, ...); } diff --git a/gcc/testsuite/rust/compile/torture/issue-893-2.rs b/gcc/testsuite/rust/compile/torture/issue-893-2.rs index 88a865d..3df27b8 100644 --- a/gcc/testsuite/rust/compile/torture/issue-893-2.rs +++ b/gcc/testsuite/rust/compile/torture/issue-893-2.rs @@ -1,4 +1,7 @@ // { dg-additional-options "-w" } +#[lang = "sized"] +pub trait Sized {} + struct Foo<T>(T); impl<T> Foo<T> { fn new<Y>(a: T, b: Y) -> Self { diff --git a/gcc/testsuite/rust/compile/torture/issue-893.rs b/gcc/testsuite/rust/compile/torture/issue-893.rs index d8245f3..f96b5c3 100644 --- a/gcc/testsuite/rust/compile/torture/issue-893.rs +++ b/gcc/testsuite/rust/compile/torture/issue-893.rs @@ -1,4 +1,7 @@ // { dg-additional-options "-w" } +#[lang = "sized"] +pub trait Sized {} + struct Foo<T>(T); impl<T> Foo<T> { fn new<Y>(a: T, b: Y) -> Self { diff --git a/gcc/testsuite/rust/compile/torture/must_use2.rs b/gcc/testsuite/rust/compile/torture/must_use2.rs index 466f7ee..cf6643e 100644 --- a/gcc/testsuite/rust/compile/torture/must_use2.rs +++ b/gcc/testsuite/rust/compile/torture/must_use2.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait A { #[must_use] fn test() -> i32; diff --git a/gcc/testsuite/rust/compile/torture/nested_fn2.rs b/gcc/testsuite/rust/compile/torture/nested_fn2.rs index 7040c86..ad7a10b 100644 --- a/gcc/testsuite/rust/compile/torture/nested_fn2.rs +++ b/gcc/testsuite/rust/compile/torture/nested_fn2.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub fn main() { fn test<T>(x: T) -> T { x diff --git a/gcc/testsuite/rust/compile/torture/phantom_data.rs b/gcc/testsuite/rust/compile/torture/phantom_data.rs index 89e76ae..d6c5adc 100644 --- a/gcc/testsuite/rust/compile/torture/phantom_data.rs +++ b/gcc/testsuite/rust/compile/torture/phantom_data.rs @@ -1,4 +1,7 @@ // { dg-options "-w" } +#[lang = "sized"] +pub trait Sized {} + #[lang = "phantom_data"] struct PhantomData<T>; diff --git a/gcc/testsuite/rust/compile/torture/range-lang-item1.rs b/gcc/testsuite/rust/compile/torture/range-lang-item1.rs index 8694616..604fee8 100644 --- a/gcc/testsuite/rust/compile/torture/range-lang-item1.rs +++ b/gcc/testsuite/rust/compile/torture/range-lang-item1.rs @@ -1,4 +1,7 @@ // { dg-additional-options "-w" } +#[lang = "sized"] +pub trait Sized {} + #[lang = "RangeFull"] pub struct RangeFull; diff --git a/gcc/testsuite/rust/compile/torture/traits1.rs b/gcc/testsuite/rust/compile/torture/traits1.rs index 9035773..8929501 100644 --- a/gcc/testsuite/rust/compile/torture/traits1.rs +++ b/gcc/testsuite/rust/compile/torture/traits1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { fn bar() -> i32; } diff --git a/gcc/testsuite/rust/compile/torture/traits11.rs b/gcc/testsuite/rust/compile/torture/traits11.rs index 41c82f0..02383a5 100644 --- a/gcc/testsuite/rust/compile/torture/traits11.rs +++ b/gcc/testsuite/rust/compile/torture/traits11.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { type A; diff --git a/gcc/testsuite/rust/compile/torture/traits12.rs b/gcc/testsuite/rust/compile/torture/traits12.rs index a55b965..8648022 100644 --- a/gcc/testsuite/rust/compile/torture/traits12.rs +++ b/gcc/testsuite/rust/compile/torture/traits12.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { type A; diff --git a/gcc/testsuite/rust/compile/torture/traits13.rs b/gcc/testsuite/rust/compile/torture/traits13.rs index 326f039..5d9c819 100644 --- a/gcc/testsuite/rust/compile/torture/traits13.rs +++ b/gcc/testsuite/rust/compile/torture/traits13.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Trait { const FOO: usize; type Target; diff --git a/gcc/testsuite/rust/compile/torture/traits14.rs b/gcc/testsuite/rust/compile/torture/traits14.rs index 8bca0d5..ab546a8 100644 --- a/gcc/testsuite/rust/compile/torture/traits14.rs +++ b/gcc/testsuite/rust/compile/torture/traits14.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo<T> { type A; diff --git a/gcc/testsuite/rust/compile/torture/traits15.rs b/gcc/testsuite/rust/compile/torture/traits15.rs index c8c40b7..c1863a8 100644 --- a/gcc/testsuite/rust/compile/torture/traits15.rs +++ b/gcc/testsuite/rust/compile/torture/traits15.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo<T> { type A; diff --git a/gcc/testsuite/rust/compile/torture/traits16.rs b/gcc/testsuite/rust/compile/torture/traits16.rs index afc4a86..8c8e682 100644 --- a/gcc/testsuite/rust/compile/torture/traits16.rs +++ b/gcc/testsuite/rust/compile/torture/traits16.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait A { fn a() -> i32 { 123 diff --git a/gcc/testsuite/rust/compile/torture/traits17.rs b/gcc/testsuite/rust/compile/torture/traits17.rs index 6da8bcb..268c2bd 100644 --- a/gcc/testsuite/rust/compile/torture/traits17.rs +++ b/gcc/testsuite/rust/compile/torture/traits17.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait A { fn a() -> i32 { 123 diff --git a/gcc/testsuite/rust/compile/torture/traits18.rs b/gcc/testsuite/rust/compile/torture/traits18.rs index 63319dd..512152e 100644 --- a/gcc/testsuite/rust/compile/torture/traits18.rs +++ b/gcc/testsuite/rust/compile/torture/traits18.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo<'a> {} trait Bar { diff --git a/gcc/testsuite/rust/compile/torture/traits19.rs b/gcc/testsuite/rust/compile/torture/traits19.rs index 4412656..4be898d 100644 --- a/gcc/testsuite/rust/compile/torture/traits19.rs +++ b/gcc/testsuite/rust/compile/torture/traits19.rs @@ -1,4 +1,7 @@ // { dg-additional-options "-w" } +#[lang = "sized"] +pub trait Sized {} + trait Get { type Value; fn get(&self) -> &<Self as Get>::Value; diff --git a/gcc/testsuite/rust/compile/torture/traits2.rs b/gcc/testsuite/rust/compile/torture/traits2.rs index fc6eb60..a9dca94 100644 --- a/gcc/testsuite/rust/compile/torture/traits2.rs +++ b/gcc/testsuite/rust/compile/torture/traits2.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { fn bar() -> i32; } diff --git a/gcc/testsuite/rust/compile/torture/traits3.rs b/gcc/testsuite/rust/compile/torture/traits3.rs index deeb81e..d805da5 100644 --- a/gcc/testsuite/rust/compile/torture/traits3.rs +++ b/gcc/testsuite/rust/compile/torture/traits3.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub trait Foo { fn Bar(self) -> i32; } diff --git a/gcc/testsuite/rust/compile/torture/traits4.rs b/gcc/testsuite/rust/compile/torture/traits4.rs index 67b012c..49c4db2 100644 --- a/gcc/testsuite/rust/compile/torture/traits4.rs +++ b/gcc/testsuite/rust/compile/torture/traits4.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { type A; type B; diff --git a/gcc/testsuite/rust/compile/torture/traits5.rs b/gcc/testsuite/rust/compile/torture/traits5.rs index 445b065..c60a259 100644 --- a/gcc/testsuite/rust/compile/torture/traits5.rs +++ b/gcc/testsuite/rust/compile/torture/traits5.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { type A; type B; diff --git a/gcc/testsuite/rust/compile/torture/traits6.rs b/gcc/testsuite/rust/compile/torture/traits6.rs index 260dde3..f117353 100644 --- a/gcc/testsuite/rust/compile/torture/traits6.rs +++ b/gcc/testsuite/rust/compile/torture/traits6.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { type A; diff --git a/gcc/testsuite/rust/compile/torture/traits7.rs b/gcc/testsuite/rust/compile/torture/traits7.rs index 7bc3384..8e4472d 100644 --- a/gcc/testsuite/rust/compile/torture/traits7.rs +++ b/gcc/testsuite/rust/compile/torture/traits7.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { const A: i32; diff --git a/gcc/testsuite/rust/compile/torture/traits8.rs b/gcc/testsuite/rust/compile/torture/traits8.rs index 459032f..cc0875b 100644 --- a/gcc/testsuite/rust/compile/torture/traits8.rs +++ b/gcc/testsuite/rust/compile/torture/traits8.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { fn default() -> i32; } diff --git a/gcc/testsuite/rust/compile/torture/traits9.rs b/gcc/testsuite/rust/compile/torture/traits9.rs index 89e4bf1..3a7c37f 100644 --- a/gcc/testsuite/rust/compile/torture/traits9.rs +++ b/gcc/testsuite/rust/compile/torture/traits9.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { fn default() -> i32; fn get(self) -> i32; diff --git a/gcc/testsuite/rust/compile/torture/transmute-size-check-1.rs b/gcc/testsuite/rust/compile/torture/transmute-size-check-1.rs index 461a35d..6d34fb1 100644 --- a/gcc/testsuite/rust/compile/torture/transmute-size-check-1.rs +++ b/gcc/testsuite/rust/compile/torture/transmute-size-check-1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + mod mem { extern "rust-intrinsic" { fn size_of<T>() -> usize; diff --git a/gcc/testsuite/rust/compile/torture/transmute1.rs b/gcc/testsuite/rust/compile/torture/transmute1.rs index af9a55d..b2a0d07 100644 --- a/gcc/testsuite/rust/compile/torture/transmute1.rs +++ b/gcc/testsuite/rust/compile/torture/transmute1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + mod mem { extern "rust-intrinsic" { fn size_of<T>() -> usize; diff --git a/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs b/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs index 0c6772b..cbb92fe 100644 --- a/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs +++ b/gcc/testsuite/rust/compile/torture/uninit-intrinsic-1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + mod intrinsics { extern "rust-intrinsic" { pub fn uninit<T>() -> T; diff --git a/gcc/testsuite/rust/compile/torture/utf8_identifiers.rs b/gcc/testsuite/rust/compile/torture/utf8_identifiers.rs index 7fb86eb..eeee01c 100644 --- a/gcc/testsuite/rust/compile/torture/utf8_identifiers.rs +++ b/gcc/testsuite/rust/compile/torture/utf8_identifiers.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + pub fn f() { let crab = (); diff --git a/gcc/testsuite/rust/compile/traits1.rs b/gcc/testsuite/rust/compile/traits1.rs index 355064e..68f5abb 100644 --- a/gcc/testsuite/rust/compile/traits1.rs +++ b/gcc/testsuite/rust/compile/traits1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { fn Bar() -> i32 {} // { dg-error "expected .i32. got .()." "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/traits10.rs b/gcc/testsuite/rust/compile/traits10.rs index f8f551b..da6c155 100644 --- a/gcc/testsuite/rust/compile/traits10.rs +++ b/gcc/testsuite/rust/compile/traits10.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo(i32); trait Bar { diff --git a/gcc/testsuite/rust/compile/traits11.rs b/gcc/testsuite/rust/compile/traits11.rs index d06e47d..ac8ccdf 100644 --- a/gcc/testsuite/rust/compile/traits11.rs +++ b/gcc/testsuite/rust/compile/traits11.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo(i32); trait A { diff --git a/gcc/testsuite/rust/compile/traits12.rs b/gcc/testsuite/rust/compile/traits12.rs index b170692..b194e07 100644 --- a/gcc/testsuite/rust/compile/traits12.rs +++ b/gcc/testsuite/rust/compile/traits12.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait A<T> { type Output; diff --git a/gcc/testsuite/rust/compile/traits2.rs b/gcc/testsuite/rust/compile/traits2.rs index 376b3c9..3631a09 100644 --- a/gcc/testsuite/rust/compile/traits2.rs +++ b/gcc/testsuite/rust/compile/traits2.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { fn Bar() -> i32 {} // { dg-error "expected .i32. got .()." "" { target *-*-* } .-1 } diff --git a/gcc/testsuite/rust/compile/traits3.rs b/gcc/testsuite/rust/compile/traits3.rs index d6d0814..119132f 100644 --- a/gcc/testsuite/rust/compile/traits3.rs +++ b/gcc/testsuite/rust/compile/traits3.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { type A; diff --git a/gcc/testsuite/rust/compile/traits4.rs b/gcc/testsuite/rust/compile/traits4.rs index 486301d..4388b5e 100644 --- a/gcc/testsuite/rust/compile/traits4.rs +++ b/gcc/testsuite/rust/compile/traits4.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { const A: i32; diff --git a/gcc/testsuite/rust/compile/traits5.rs b/gcc/testsuite/rust/compile/traits5.rs index 8b2fb9b..4e9dcc1 100644 --- a/gcc/testsuite/rust/compile/traits5.rs +++ b/gcc/testsuite/rust/compile/traits5.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { const A: i32; diff --git a/gcc/testsuite/rust/compile/traits6.rs b/gcc/testsuite/rust/compile/traits6.rs index 3579b5a..d081dd1 100644 --- a/gcc/testsuite/rust/compile/traits6.rs +++ b/gcc/testsuite/rust/compile/traits6.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { fn default() -> i32; } diff --git a/gcc/testsuite/rust/compile/traits7.rs b/gcc/testsuite/rust/compile/traits7.rs index 825553c..68f3f38 100644 --- a/gcc/testsuite/rust/compile/traits7.rs +++ b/gcc/testsuite/rust/compile/traits7.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait Foo { fn default() -> i32; } diff --git a/gcc/testsuite/rust/compile/traits8.rs b/gcc/testsuite/rust/compile/traits8.rs index b22590a..ccba9fa 100644 --- a/gcc/testsuite/rust/compile/traits8.rs +++ b/gcc/testsuite/rust/compile/traits8.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + trait A { fn get(self) -> f64; } diff --git a/gcc/testsuite/rust/compile/traits9.rs b/gcc/testsuite/rust/compile/traits9.rs index e1aef53..bb3034d 100644 --- a/gcc/testsuite/rust/compile/traits9.rs +++ b/gcc/testsuite/rust/compile/traits9.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo(i32); trait Bar { fn baz(&self); diff --git a/gcc/testsuite/rust/compile/type-bindings1.rs b/gcc/testsuite/rust/compile/type-bindings1.rs index dc0e274..358035b 100644 --- a/gcc/testsuite/rust/compile/type-bindings1.rs +++ b/gcc/testsuite/rust/compile/type-bindings1.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<A, B>(A, B); fn main() { diff --git a/gcc/testsuite/rust/compile/unconstrained_type_param.rs b/gcc/testsuite/rust/compile/unconstrained_type_param.rs index a510332..1cef0b9 100644 --- a/gcc/testsuite/rust/compile/unconstrained_type_param.rs +++ b/gcc/testsuite/rust/compile/unconstrained_type_param.rs @@ -1,3 +1,6 @@ +#[lang = "sized"] +pub trait Sized {} + struct Foo<T>(T, bool); impl<X, Y> Foo<X> { diff --git a/gcc/testsuite/rust/compile/unsafe10.rs b/gcc/testsuite/rust/compile/unsafe10.rs index 927e697..5861c15 100644 --- a/gcc/testsuite/rust/compile/unsafe10.rs +++ b/gcc/testsuite/rust/compile/unsafe10.rs @@ -1,5 +1,8 @@ #![feature(intrinsics)] +#[lang = "sized"] +pub trait Sized {} + extern "rust-intrinsic" { pub fn rotate_left<T>(l: T, r: T) -> T; } |