diff options
Diffstat (limited to 'tests/ui/issues')
79 files changed, 0 insertions, 1361 deletions
diff --git a/tests/ui/issues/auxiliary/issue-7899.rs b/tests/ui/issues/auxiliary/issue-7899.rs deleted file mode 100644 index 3af6e871661..00000000000 --- a/tests/ui/issues/auxiliary/issue-7899.rs +++ /dev/null @@ -1 +0,0 @@ -pub struct V2<T>(pub T, pub T); diff --git a/tests/ui/issues/auxiliary/issue-8044.rs b/tests/ui/issues/auxiliary/issue-8044.rs deleted file mode 100644 index 2ec25f51cde..00000000000 --- a/tests/ui/issues/auxiliary/issue-8044.rs +++ /dev/null @@ -1,15 +0,0 @@ -pub struct BTree<V> { - pub node: TreeItem<V>, -} - -pub enum TreeItem<V> { - TreeLeaf { value: V }, -} - -pub fn leaf<V>(value: V) -> TreeItem<V> { - TreeItem::TreeLeaf { value: value } -} - -fn main() { - BTree::<isize> { node: leaf(1) }; -} diff --git a/tests/ui/issues/auxiliary/issue-8259.rs b/tests/ui/issues/auxiliary/issue-8259.rs deleted file mode 100644 index 891aee099dc..00000000000 --- a/tests/ui/issues/auxiliary/issue-8259.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub enum Foo<'a> { - A, - B(&'a str), -} diff --git a/tests/ui/issues/auxiliary/issue-8401.rs b/tests/ui/issues/auxiliary/issue-8401.rs deleted file mode 100644 index 7d0eb5cd876..00000000000 --- a/tests/ui/issues/auxiliary/issue-8401.rs +++ /dev/null @@ -1,16 +0,0 @@ -// for this issue, this code must be built in a library - -use std::mem; - -trait A { - fn dummy(&self) { } -} -struct B; -impl A for B {} - -fn bar<T>(_: &mut dyn A, _: &T) {} - -fn foo<T>(t: &T) { - let mut b = B; - bar(&mut b as &mut dyn A, t) -} diff --git a/tests/ui/issues/auxiliary/issue-9123.rs b/tests/ui/issues/auxiliary/issue-9123.rs deleted file mode 100644 index 60af53359e8..00000000000 --- a/tests/ui/issues/auxiliary/issue-9123.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![crate_type = "lib"] - -pub trait X { - fn x() { - fn f() { } - f(); - } - fn dummy(&self) { } -} diff --git a/tests/ui/issues/issue-75283.rs b/tests/ui/issues/issue-75283.rs deleted file mode 100644 index d556132e47f..00000000000 --- a/tests/ui/issues/issue-75283.rs +++ /dev/null @@ -1,6 +0,0 @@ -extern "C" { - fn lol() { //~ ERROR incorrect function inside `extern` block - println!(""); - } -} -fn main() {} diff --git a/tests/ui/issues/issue-75283.stderr b/tests/ui/issues/issue-75283.stderr deleted file mode 100644 index 240d9716a55..00000000000 --- a/tests/ui/issues/issue-75283.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: incorrect function inside `extern` block - --> $DIR/issue-75283.rs:2:8 - | -LL | extern "C" { - | ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body -LL | fn lol() { - | ________^^^___- - | | | - | | cannot have a body -LL | | println!(""); -LL | | } - | |_____- help: remove the invalid body: `;` - | - = help: you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block - = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html - -error: aborting due to 1 previous error - diff --git a/tests/ui/issues/issue-7563.rs b/tests/ui/issues/issue-7563.rs deleted file mode 100644 index 9ee8857b999..00000000000 --- a/tests/ui/issues/issue-7563.rs +++ /dev/null @@ -1,28 +0,0 @@ -//@ run-pass -#![allow(dead_code)] -trait IDummy { - fn do_nothing(&self); -} - -#[derive(Debug)] -struct A { a: isize } -#[derive(Debug)] -struct B<'a> { b: isize, pa: &'a A } - - impl IDummy for A { - fn do_nothing(&self) { - println!("A::do_nothing() is called"); - } - } - -impl<'a> B<'a> { - fn get_pa(&self) -> &'a dyn IDummy { self.pa as &'a dyn IDummy } -} - -pub fn main() { - let sa = A { a: 100 }; - let sb = B { b: 200, pa: &sa }; - - println!("sa is {:?}", sa); - println!("sb is {:?}", sb); -} diff --git a/tests/ui/issues/issue-7575.rs b/tests/ui/issues/issue-7575.rs deleted file mode 100644 index 8b1fdf6c851..00000000000 --- a/tests/ui/issues/issue-7575.rs +++ /dev/null @@ -1,17 +0,0 @@ -//@ run-pass - -trait Foo { //~ WARN trait `Foo` is never used - fn new() -> bool { false } - fn dummy(&self) { } -} - -trait Bar { - fn new(&self) -> bool { true } -} - -impl Bar for isize {} -impl Foo for isize {} - -fn main() { - assert!(1.new()); -} diff --git a/tests/ui/issues/issue-7575.stderr b/tests/ui/issues/issue-7575.stderr deleted file mode 100644 index 2f987d19c80..00000000000 --- a/tests/ui/issues/issue-7575.stderr +++ /dev/null @@ -1,10 +0,0 @@ -warning: trait `Foo` is never used - --> $DIR/issue-7575.rs:3:7 - | -LL | trait Foo { - | ^^^ - | - = note: `#[warn(dead_code)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/issues/issue-76042.rs b/tests/ui/issues/issue-76042.rs deleted file mode 100644 index 279e860459d..00000000000 --- a/tests/ui/issues/issue-76042.rs +++ /dev/null @@ -1,16 +0,0 @@ -//@ run-pass -//@ compile-flags: -Coverflow-checks=off -Ccodegen-units=1 -Copt-level=0 - -fn foo(a: i128, b: i128, s: u32) -> (i128, i128) { - if s == 128 { - (0, 0) - } else { - (b >> s, a >> s) - } -} -fn main() { - let r = foo(0, 8, 1); - if r.0 != 4 { - panic!(); - } -} diff --git a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.fixed b/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.fixed deleted file mode 100644 index 6fde4e390fa..00000000000 --- a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.fixed +++ /dev/null @@ -1,18 +0,0 @@ -//@ run-rustfix -#![allow(dead_code, unused_variables)] - -pub mod foo { - #[derive(Default)] - pub struct Foo { invisible: bool, } - - #[derive(Default)] - pub struct Bar { pub visible: bool, invisible: bool, } -} - -fn main() { - let foo::Foo { .. } = foo::Foo::default(); - //~^ ERROR pattern requires `..` due to inaccessible fields - - let foo::Bar { visible, .. } = foo::Bar::default(); - //~^ ERROR pattern requires `..` due to inaccessible fields -} diff --git a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.rs b/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.rs deleted file mode 100644 index 30a8535faf5..00000000000 --- a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.rs +++ /dev/null @@ -1,18 +0,0 @@ -//@ run-rustfix -#![allow(dead_code, unused_variables)] - -pub mod foo { - #[derive(Default)] - pub struct Foo { invisible: bool, } - - #[derive(Default)] - pub struct Bar { pub visible: bool, invisible: bool, } -} - -fn main() { - let foo::Foo {} = foo::Foo::default(); - //~^ ERROR pattern requires `..` due to inaccessible fields - - let foo::Bar { visible } = foo::Bar::default(); - //~^ ERROR pattern requires `..` due to inaccessible fields -} diff --git a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.stderr b/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.stderr deleted file mode 100644 index f54990d5d86..00000000000 --- a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077-1.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error: pattern requires `..` due to inaccessible fields - --> $DIR/issue-76077-1.rs:13:9 - | -LL | let foo::Foo {} = foo::Foo::default(); - | ^^^^^^^^^^^ - | -help: ignore the inaccessible and unused fields - | -LL | let foo::Foo { .. } = foo::Foo::default(); - | ++ - -error: pattern requires `..` due to inaccessible fields - --> $DIR/issue-76077-1.rs:16:9 - | -LL | let foo::Bar { visible } = foo::Bar::default(); - | ^^^^^^^^^^^^^^^^^^^^ - | -help: ignore the inaccessible and unused fields - | -LL | let foo::Bar { visible, .. } = foo::Bar::default(); - | ++++ - -error: aborting due to 2 previous errors - diff --git a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077.rs b/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077.rs deleted file mode 100644 index 2d29093b01b..00000000000 --- a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub mod foo { - pub struct Foo { - you_cant_use_this_field: bool, - } -} - -fn main() { - foo::Foo {}; - //~^ ERROR cannot construct `Foo` with struct literal syntax due to private fields -} diff --git a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077.stderr b/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077.stderr deleted file mode 100644 index 3fef5ffce30..00000000000 --- a/tests/ui/issues/issue-76077-inaccesible-private-fields/issue-76077.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: cannot construct `Foo` with struct literal syntax due to private fields - --> $DIR/issue-76077.rs:8:5 - | -LL | foo::Foo {}; - | ^^^^^^^^ - | - = note: private field `you_cant_use_this_field` that was not provided - -error: aborting due to 1 previous error - diff --git a/tests/ui/issues/issue-76191.rs b/tests/ui/issues/issue-76191.rs deleted file mode 100644 index d2de44380c3..00000000000 --- a/tests/ui/issues/issue-76191.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Regression test for diagnostic issue #76191 -#![allow(non_snake_case)] - -use std::ops::RangeInclusive; - -const RANGE: RangeInclusive<i32> = 0..=255; - -const RANGE2: RangeInclusive<i32> = panic!(); -//~^ ERROR evaluation panicked: explicit panic - -fn main() { - let n: i32 = 1; - match n { - RANGE => {} - //~^ ERROR mismatched types - RANGE2 => {} - //~^ ERROR mismatched types - _ => {} - } -} diff --git a/tests/ui/issues/issue-76191.stderr b/tests/ui/issues/issue-76191.stderr deleted file mode 100644 index d8b54be88f4..00000000000 --- a/tests/ui/issues/issue-76191.stderr +++ /dev/null @@ -1,51 +0,0 @@ -error[E0080]: evaluation panicked: explicit panic - --> $DIR/issue-76191.rs:8:37 - | -LL | const RANGE2: RangeInclusive<i32> = panic!(); - | ^^^^^^^^ evaluation of `RANGE2` failed here - -error[E0308]: mismatched types - --> $DIR/issue-76191.rs:14:9 - | -LL | const RANGE: RangeInclusive<i32> = 0..=255; - | -------------------------------- constant defined here -... -LL | match n { - | - this expression has type `i32` -LL | RANGE => {} - | ^^^^^ - | | - | expected `i32`, found `RangeInclusive<i32>` - | `RANGE` is interpreted as a constant, not a new binding - | - = note: expected type `i32` - found struct `std::ops::RangeInclusive<i32>` -help: you may want to move the range into the match block - | -LL - RANGE => {} -LL + 0..=255 => {} - | - -error[E0308]: mismatched types - --> $DIR/issue-76191.rs:16:9 - | -LL | const RANGE2: RangeInclusive<i32> = panic!(); - | --------------------------------- constant defined here -... -LL | match n { - | - this expression has type `i32` -... -LL | RANGE2 => {} - | ^^^^^^ - | | - | expected `i32`, found `RangeInclusive<i32>` - | `RANGE2` is interpreted as a constant, not a new binding - | - = note: expected type `i32` - found struct `std::ops::RangeInclusive<i32>` - = note: constants only support matching by type, if you meant to match against a range of values, consider using a range pattern like `min ..= max` in the match block - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0080, E0308. -For more information about an error, try `rustc --explain E0080`. diff --git a/tests/ui/issues/issue-7660.rs b/tests/ui/issues/issue-7660.rs deleted file mode 100644 index 104cdad8f7b..00000000000 --- a/tests/ui/issues/issue-7660.rs +++ /dev/null @@ -1,17 +0,0 @@ -//@ run-pass -#![allow(unused_variables)] -// Regression test for issue 7660 -// rvalue lifetime too short when equivalent `match` works - - -use std::collections::HashMap; - -struct A(isize, isize); - -pub fn main() { - let mut m: HashMap<isize, A> = HashMap::new(); - m.insert(1, A(0, 0)); - - let A(ref _a, ref _b) = m[&1]; - let (a, b) = match m[&1] { A(ref _a, ref _b) => (_a, _b) }; -} diff --git a/tests/ui/issues/issue-7663.rs b/tests/ui/issues/issue-7663.rs deleted file mode 100644 index d2b2c727cab..00000000000 --- a/tests/ui/issues/issue-7663.rs +++ /dev/null @@ -1,32 +0,0 @@ -//@ run-pass - -#![allow(unused_imports, dead_code)] - -mod test1 { - - mod foo { pub fn p() -> isize { 1 } } - mod bar { pub fn p() -> isize { 2 } } - - pub mod baz { - use crate::test1::bar::p; - - pub fn my_main() { assert_eq!(p(), 2); } - } -} - -mod test2 { - - mod foo { pub fn p() -> isize { 1 } } - mod bar { pub fn p() -> isize { 2 } } - - pub mod baz { - use crate::test2::bar::p; - - pub fn my_main() { assert_eq!(p(), 2); } - } -} - -fn main() { - test1::baz::my_main(); - test2::baz::my_main(); -} diff --git a/tests/ui/issues/issue-7673-cast-generically-implemented-trait.rs b/tests/ui/issues/issue-7673-cast-generically-implemented-trait.rs deleted file mode 100644 index edba3284e31..00000000000 --- a/tests/ui/issues/issue-7673-cast-generically-implemented-trait.rs +++ /dev/null @@ -1,19 +0,0 @@ -//@ check-pass -#![allow(dead_code)] - -/* - -#7673 Polymorphically creating traits barely works - -*/ - -pub fn main() {} - -trait A { - fn dummy(&self) { } -} - -impl<T: 'static> A for T {} - -fn owned2<T: 'static>(a: Box<T>) { a as Box<dyn A>; } -fn owned3<T: 'static>(a: Box<T>) { Box::new(a) as Box<dyn A>; } diff --git a/tests/ui/issues/issue-77218/issue-77218-2.fixed b/tests/ui/issues/issue-77218/issue-77218-2.fixed deleted file mode 100644 index 98d79b5da65..00000000000 --- a/tests/ui/issues/issue-77218/issue-77218-2.fixed +++ /dev/null @@ -1,6 +0,0 @@ -//@ run-rustfix -fn main() { - let value = [7u8]; - while let Some(0) = value.get(0) { //~ ERROR invalid left-hand side of assignment - } -} diff --git a/tests/ui/issues/issue-77218/issue-77218-2.rs b/tests/ui/issues/issue-77218/issue-77218-2.rs deleted file mode 100644 index 3be38f8f721..00000000000 --- a/tests/ui/issues/issue-77218/issue-77218-2.rs +++ /dev/null @@ -1,6 +0,0 @@ -//@ run-rustfix -fn main() { - let value = [7u8]; - while Some(0) = value.get(0) { //~ ERROR invalid left-hand side of assignment - } -} diff --git a/tests/ui/issues/issue-77218/issue-77218-2.stderr b/tests/ui/issues/issue-77218/issue-77218-2.stderr deleted file mode 100644 index dfed0b6e67e..00000000000 --- a/tests/ui/issues/issue-77218/issue-77218-2.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0070]: invalid left-hand side of assignment - --> $DIR/issue-77218-2.rs:4:19 - | -LL | while Some(0) = value.get(0) { - | - ^ - | | - | cannot assign to this expression - | -help: you might have meant to use pattern destructuring - | -LL | while let Some(0) = value.get(0) { - | +++ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0070`. diff --git a/tests/ui/issues/issue-77218/issue-77218.fixed b/tests/ui/issues/issue-77218/issue-77218.fixed deleted file mode 100644 index 6ce9dd1c2c5..00000000000 --- a/tests/ui/issues/issue-77218/issue-77218.fixed +++ /dev/null @@ -1,5 +0,0 @@ -//@ run-rustfix -fn main() { - let value = [7u8]; - while let Some(0) = value.get(0) {} //~ ERROR invalid left-hand side of assignment -} diff --git a/tests/ui/issues/issue-77218/issue-77218.rs b/tests/ui/issues/issue-77218/issue-77218.rs deleted file mode 100644 index 14edc065d0e..00000000000 --- a/tests/ui/issues/issue-77218/issue-77218.rs +++ /dev/null @@ -1,5 +0,0 @@ -//@ run-rustfix -fn main() { - let value = [7u8]; - while Some(0) = value.get(0) {} //~ ERROR invalid left-hand side of assignment -} diff --git a/tests/ui/issues/issue-77218/issue-77218.stderr b/tests/ui/issues/issue-77218/issue-77218.stderr deleted file mode 100644 index e98e69314d9..00000000000 --- a/tests/ui/issues/issue-77218/issue-77218.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0070]: invalid left-hand side of assignment - --> $DIR/issue-77218.rs:4:19 - | -LL | while Some(0) = value.get(0) {} - | - ^ - | | - | cannot assign to this expression - | -help: you might have meant to use pattern destructuring - | -LL | while let Some(0) = value.get(0) {} - | +++ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0070`. diff --git a/tests/ui/issues/issue-7784.rs b/tests/ui/issues/issue-7784.rs deleted file mode 100644 index 90b88ae5727..00000000000 --- a/tests/ui/issues/issue-7784.rs +++ /dev/null @@ -1,30 +0,0 @@ -//@ run-pass - -use std::ops::Add; - -fn foo<T: Add<Output=T> + Clone>([x, y, z]: [T; 3]) -> (T, T, T) { - (x.clone(), x.clone() + y.clone(), x + y + z) -} -fn bar(a: &'static str, b: &'static str) -> [&'static str; 4] { - [a, b, b, a] -} - -fn main() { - assert_eq!(foo([1, 2, 3]), (1, 3, 6)); - - let [a, b, c, d] = bar("foo", "bar"); - assert_eq!(a, "foo"); - assert_eq!(b, "bar"); - assert_eq!(c, "bar"); - assert_eq!(d, "foo"); - - let [a, _, _, d] = bar("baz", "foo"); - assert_eq!(a, "baz"); - assert_eq!(d, "baz"); - - let out = bar("baz", "foo"); - let [a, xs @ .., d] = out; - assert_eq!(a, "baz"); - assert_eq!(xs, ["foo", "foo"]); - assert_eq!(d, "baz"); -} diff --git a/tests/ui/issues/issue-78192.rs b/tests/ui/issues/issue-78192.rs deleted file mode 100644 index bec2a82910c..00000000000 --- a/tests/ui/issues/issue-78192.rs +++ /dev/null @@ -1,17 +0,0 @@ -//@ run-pass - -#![allow(unused_assignments)] - -fn main() { - let a = 1u32; - let b = 2u32; - - let mut c: *const u32 = &a; - let d: &u32 = &b; - - let x = unsafe { &*c }; - c = d; - let z = *x; - - assert_eq!(1, z); -} diff --git a/tests/ui/issues/issue-78622.rs b/tests/ui/issues/issue-78622.rs deleted file mode 100644 index c00fd266063..00000000000 --- a/tests/ui/issues/issue-78622.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![crate_type = "lib"] - -struct S; -fn f() { - S::A::<f> {} - //~^ ERROR ambiguous associated type -} diff --git a/tests/ui/issues/issue-78622.stderr b/tests/ui/issues/issue-78622.stderr deleted file mode 100644 index 432913a0fc9..00000000000 --- a/tests/ui/issues/issue-78622.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0223]: ambiguous associated type - --> $DIR/issue-78622.rs:5:5 - | -LL | S::A::<f> {} - | ^^^^ - | -help: if there were a trait named `Example` with associated type `A` implemented for `S`, you could use the fully-qualified path - | -LL - S::A::<f> {} -LL + <S as Example>::A::<f> {} - | - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0223`. diff --git a/tests/ui/issues/issue-7867.rs b/tests/ui/issues/issue-7867.rs deleted file mode 100644 index 87e7c831e68..00000000000 --- a/tests/ui/issues/issue-7867.rs +++ /dev/null @@ -1,16 +0,0 @@ -//@ dont-require-annotations: NOTE - -enum A { B, C } - -mod foo { pub fn bar() {} } - -fn main() { - match (true, false) { - A::B => (), - //~^ ERROR mismatched types - //~| NOTE expected `(bool, bool)`, found `A` - //~| NOTE expected tuple `(bool, bool)` - //~| NOTE found enum `A` - _ => () - } -} diff --git a/tests/ui/issues/issue-7867.stderr b/tests/ui/issues/issue-7867.stderr deleted file mode 100644 index fcb69d775fa..00000000000 --- a/tests/ui/issues/issue-7867.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-7867.rs:9:9 - | -LL | enum A { B, C } - | - unit variant defined here -... -LL | match (true, false) { - | ------------- this expression has type `(bool, bool)` -LL | A::B => (), - | ^^^^ expected `(bool, bool)`, found `A` - | - = note: expected tuple `(bool, bool)` - found enum `A` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/issues/issue-78957.rs b/tests/ui/issues/issue-78957.rs deleted file mode 100644 index 2ff92612e18..00000000000 --- a/tests/ui/issues/issue-78957.rs +++ /dev/null @@ -1,29 +0,0 @@ -#![deny(unused_attributes)] - -use std::marker::PhantomData; - -pub struct Foo<#[inline] const N: usize>; -//~^ ERROR attribute cannot be used on -pub struct Bar<#[cold] const N: usize>; -//~^ ERROR attribute cannot be used on -//~| WARN previously accepted -pub struct Baz<#[repr(C)] const N: usize>; -//~^ ERROR attribute should be applied to a struct, enum, or union -// -pub struct Foo2<#[inline] 'a>(PhantomData<&'a ()>); -//~^ ERROR attribute cannot be used on -pub struct Bar2<#[cold] 'a>(PhantomData<&'a ()>); -//~^ ERROR attribute cannot be used on -//~| WARN previously accepted -pub struct Baz2<#[repr(C)] 'a>(PhantomData<&'a ()>); -//~^ ERROR attribute should be applied to a struct, enum, or union -// -pub struct Foo3<#[inline] T>(PhantomData<T>); -//~^ ERROR attribute cannot be used on -pub struct Bar3<#[cold] T>(PhantomData<T>); -//~^ ERROR attribute cannot be used on -//~| WARN previously accepted -pub struct Baz3<#[repr(C)] T>(PhantomData<T>); -//~^ ERROR attribute should be applied to a struct, enum, or union - -fn main() {} diff --git a/tests/ui/issues/issue-78957.stderr b/tests/ui/issues/issue-78957.stderr deleted file mode 100644 index d271b1840fb..00000000000 --- a/tests/ui/issues/issue-78957.stderr +++ /dev/null @@ -1,77 +0,0 @@ -error: `#[inline]` attribute cannot be used on function params - --> $DIR/issue-78957.rs:5:16 - | -LL | pub struct Foo<#[inline] const N: usize>; - | ^^^^^^^^^ - | - = help: `#[inline]` can only be applied to functions - -error: `#[inline]` attribute cannot be used on function params - --> $DIR/issue-78957.rs:13:17 - | -LL | pub struct Foo2<#[inline] 'a>(PhantomData<&'a ()>); - | ^^^^^^^^^ - | - = help: `#[inline]` can only be applied to functions - -error: `#[inline]` attribute cannot be used on function params - --> $DIR/issue-78957.rs:21:17 - | -LL | pub struct Foo3<#[inline] T>(PhantomData<T>); - | ^^^^^^^^^ - | - = help: `#[inline]` can only be applied to functions - -error[E0517]: attribute should be applied to a struct, enum, or union - --> $DIR/issue-78957.rs:10:23 - | -LL | pub struct Baz<#[repr(C)] const N: usize>; - | ^ -------------- not a struct, enum, or union - -error[E0517]: attribute should be applied to a struct, enum, or union - --> $DIR/issue-78957.rs:18:24 - | -LL | pub struct Baz2<#[repr(C)] 'a>(PhantomData<&'a ()>); - | ^ -- not a struct, enum, or union - -error[E0517]: attribute should be applied to a struct, enum, or union - --> $DIR/issue-78957.rs:26:24 - | -LL | pub struct Baz3<#[repr(C)] T>(PhantomData<T>); - | ^ - not a struct, enum, or union - -error: `#[cold]` attribute cannot be used on function params - --> $DIR/issue-78957.rs:7:16 - | -LL | pub struct Bar<#[cold] const N: usize>; - | ^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = help: `#[cold]` can only be applied to functions -note: the lint level is defined here - --> $DIR/issue-78957.rs:1:9 - | -LL | #![deny(unused_attributes)] - | ^^^^^^^^^^^^^^^^^ - -error: `#[cold]` attribute cannot be used on function params - --> $DIR/issue-78957.rs:15:17 - | -LL | pub struct Bar2<#[cold] 'a>(PhantomData<&'a ()>); - | ^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = help: `#[cold]` can only be applied to functions - -error: `#[cold]` attribute cannot be used on function params - --> $DIR/issue-78957.rs:23:17 - | -LL | pub struct Bar3<#[cold] T>(PhantomData<T>); - | ^^^^^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = help: `#[cold]` can only be applied to functions - -error: aborting due to 9 previous errors - -For more information about this error, try `rustc --explain E0517`. diff --git a/tests/ui/issues/issue-7899.rs b/tests/ui/issues/issue-7899.rs deleted file mode 100644 index 4b69f3e3d89..00000000000 --- a/tests/ui/issues/issue-7899.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ run-pass -#![allow(unused_variables)] -//@ aux-build:issue-7899.rs - - -extern crate issue_7899 as testcrate; - -fn main() { - let f = testcrate::V2(1.0f32, 2.0f32); -} diff --git a/tests/ui/issues/issue-7911.rs b/tests/ui/issues/issue-7911.rs deleted file mode 100644 index 11da4df5285..00000000000 --- a/tests/ui/issues/issue-7911.rs +++ /dev/null @@ -1,37 +0,0 @@ -//@ run-pass -// (Closes #7911) Test that we can use the same self expression -// with different mutability in macro in two methods - -#![allow(unused_variables)] // unused foobar_immut + foobar_mut -trait FooBar { - fn dummy(&self) { } //~ WARN method `dummy` is never used -} -struct Bar(#[allow(dead_code)] i32); -struct Foo { bar: Bar } - -impl FooBar for Bar {} - -trait Test { - fn get_immut(&self) -> &dyn FooBar; - fn get_mut(&mut self) -> &mut dyn FooBar; -} - -macro_rules! generate_test { ($type_:path, $slf:ident, $field:expr) => ( - impl Test for $type_ { - fn get_immut(&$slf) -> &dyn FooBar { - &$field as &dyn FooBar - } - - fn get_mut(&mut $slf) -> &mut dyn FooBar { - &mut $field as &mut dyn FooBar - } - } -)} - -generate_test!(Foo, self, self.bar); - -pub fn main() { - let mut foo: Foo = Foo { bar: Bar(42) }; - { let foobar_immut = foo.get_immut(); } - { let foobar_mut = foo.get_mut(); } -} diff --git a/tests/ui/issues/issue-7911.stderr b/tests/ui/issues/issue-7911.stderr deleted file mode 100644 index ead7ee191ac..00000000000 --- a/tests/ui/issues/issue-7911.stderr +++ /dev/null @@ -1,12 +0,0 @@ -warning: method `dummy` is never used - --> $DIR/issue-7911.rs:7:8 - | -LL | trait FooBar { - | ------ method in this trait -LL | fn dummy(&self) { } - | ^^^^^ - | - = note: `#[warn(dead_code)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/issues/issue-7970a.rs b/tests/ui/issues/issue-7970a.rs deleted file mode 100644 index dae906410ed..00000000000 --- a/tests/ui/issues/issue-7970a.rs +++ /dev/null @@ -1,8 +0,0 @@ -macro_rules! one_arg_macro { - ($fmt:expr) => (print!(concat!($fmt, "\n"))); -} - -fn main() { - one_arg_macro!(); - //~^ ERROR unexpected end of macro invocation -} diff --git a/tests/ui/issues/issue-7970a.stderr b/tests/ui/issues/issue-7970a.stderr deleted file mode 100644 index 1e6bb92ea57..00000000000 --- a/tests/ui/issues/issue-7970a.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error: unexpected end of macro invocation - --> $DIR/issue-7970a.rs:6:5 - | -LL | macro_rules! one_arg_macro { - | -------------------------- when calling this macro -... -LL | one_arg_macro!(); - | ^^^^^^^^^^^^^^^^ missing tokens in macro arguments - | -note: while trying to match meta-variable `$fmt:expr` - --> $DIR/issue-7970a.rs:2:6 - | -LL | ($fmt:expr) => (print!(concat!($fmt, "\n"))); - | ^^^^^^^^^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/issues/issue-8044.rs b/tests/ui/issues/issue-8044.rs deleted file mode 100644 index 3c10bbca634..00000000000 --- a/tests/ui/issues/issue-8044.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ run-pass -//@ aux-build:issue-8044.rs - - -extern crate issue_8044 as minimal; -use minimal::{BTree, leaf}; - -pub fn main() { - BTree::<isize> { node: leaf(1) }; -} diff --git a/tests/ui/issues/issue-80607.rs b/tests/ui/issues/issue-80607.rs deleted file mode 100644 index 63f4df359b8..00000000000 --- a/tests/ui/issues/issue-80607.rs +++ /dev/null @@ -1,10 +0,0 @@ -// This tests makes sure the diagnostics print the offending enum variant, not just the type. -pub enum Enum { - V1(i32), -} - -pub fn foo(x: i32) -> Enum { - Enum::V1 { x } //~ ERROR `Enum::V1` has no field named `x` -} - -fn main() {} diff --git a/tests/ui/issues/issue-80607.stderr b/tests/ui/issues/issue-80607.stderr deleted file mode 100644 index 8f9f494c8b7..00000000000 --- a/tests/ui/issues/issue-80607.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0559]: variant `Enum::V1` has no field named `x` - --> $DIR/issue-80607.rs:7:16 - | -LL | V1(i32), - | -- `Enum::V1` defined here -... -LL | Enum::V1 { x } - | ^ field does not exist - | -help: `Enum::V1` is a tuple variant, use the appropriate syntax - | -LL - Enum::V1 { x } -LL + Enum::V1(/* i32 */) - | - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0559`. diff --git a/tests/ui/issues/issue-81584.fixed b/tests/ui/issues/issue-81584.fixed deleted file mode 100644 index c3d33a1b4f8..00000000000 --- a/tests/ui/issues/issue-81584.fixed +++ /dev/null @@ -1,8 +0,0 @@ -//@ run-rustfix -fn main() { - let _ = vec![vec![0, 1], vec![2]] - .into_iter() - .map(|y| y.iter().map(|x| x + 1).collect::<Vec<_>>()) - //~^ ERROR cannot return value referencing function parameter `y` - .collect::<Vec<_>>(); -} diff --git a/tests/ui/issues/issue-81584.rs b/tests/ui/issues/issue-81584.rs deleted file mode 100644 index 27db73aaa2c..00000000000 --- a/tests/ui/issues/issue-81584.rs +++ /dev/null @@ -1,8 +0,0 @@ -//@ run-rustfix -fn main() { - let _ = vec![vec![0, 1], vec![2]] - .into_iter() - .map(|y| y.iter().map(|x| x + 1)) - //~^ ERROR cannot return value referencing function parameter `y` - .collect::<Vec<_>>(); -} diff --git a/tests/ui/issues/issue-81584.stderr b/tests/ui/issues/issue-81584.stderr deleted file mode 100644 index eb97916ad75..00000000000 --- a/tests/ui/issues/issue-81584.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0515]: cannot return value referencing function parameter `y` - --> $DIR/issue-81584.rs:5:22 - | -LL | .map(|y| y.iter().map(|x| x + 1)) - | -^^^^^^^^^^^^^^^^^^^^^^ - | | - | returns a value referencing data owned by the current function - | `y` is borrowed here - | - = help: use `.collect()` to allocate the iterator - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0515`. diff --git a/tests/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs b/tests/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs deleted file mode 100644 index 6a03404cdca..00000000000 --- a/tests/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs +++ /dev/null @@ -1,18 +0,0 @@ -//@ check-pass -#![allow(dead_code)] - -/* - -#8171 Self is not recognised as implementing kinds in default method implementations - -*/ - -fn require_send<T: Send>(_: T){} - -trait TragicallySelfIsNotSend: Send + Sized { - fn x(self) { - require_send(self); - } -} - -pub fn main(){} diff --git a/tests/ui/issues/issue-81918.rs b/tests/ui/issues/issue-81918.rs deleted file mode 100644 index ee9721c2493..00000000000 --- a/tests/ui/issues/issue-81918.rs +++ /dev/null @@ -1,11 +0,0 @@ -//@ check-pass -//@ dont-check-compiler-stdout -//@ compile-flags: -Z unpretty=mir-cfg - -// This checks that unpretty=mir-cfg does not panic. See #81918. - -const TAG: &'static str = "ABCD"; - -fn main() { - if TAG == "" {} -} diff --git a/tests/ui/issues/issue-8248.rs b/tests/ui/issues/issue-8248.rs deleted file mode 100644 index 95f626658cc..00000000000 --- a/tests/ui/issues/issue-8248.rs +++ /dev/null @@ -1,14 +0,0 @@ -//@ run-pass - -trait A { - fn dummy(&self) { } //~ WARN method `dummy` is never used -} -struct B; -impl A for B {} - -fn foo(_: &mut dyn A) {} - -pub fn main() { - let mut b = B; - foo(&mut b as &mut dyn A); -} diff --git a/tests/ui/issues/issue-8248.stderr b/tests/ui/issues/issue-8248.stderr deleted file mode 100644 index 8570bfaefad..00000000000 --- a/tests/ui/issues/issue-8248.stderr +++ /dev/null @@ -1,12 +0,0 @@ -warning: method `dummy` is never used - --> $DIR/issue-8248.rs:4:8 - | -LL | trait A { - | - method in this trait -LL | fn dummy(&self) { } - | ^^^^^ - | - = note: `#[warn(dead_code)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/issues/issue-8249.rs b/tests/ui/issues/issue-8249.rs deleted file mode 100644 index 2364fc14d31..00000000000 --- a/tests/ui/issues/issue-8249.rs +++ /dev/null @@ -1,19 +0,0 @@ -//@ run-pass -#![allow(dead_code)] - -trait A { - fn dummy(&self) { } -} -struct B; -impl A for B {} - -struct C<'a> { - foo: &'a mut (dyn A+'a), -} - -fn foo(a: &mut dyn A) { - C{ foo: a }; -} - -pub fn main() { -} diff --git a/tests/ui/issues/issue-8259.rs b/tests/ui/issues/issue-8259.rs deleted file mode 100644 index e843f7f9c50..00000000000 --- a/tests/ui/issues/issue-8259.rs +++ /dev/null @@ -1,11 +0,0 @@ -//@ run-pass -#![allow(dead_code)] -#![allow(non_upper_case_globals)] - -//@ aux-build:issue-8259.rs - - -extern crate issue_8259 as other; -static a: other::Foo<'static> = other::Foo::A; - -pub fn main() {} diff --git a/tests/ui/issues/issue-83048.rs b/tests/ui/issues/issue-83048.rs deleted file mode 100644 index 6c941133a15..00000000000 --- a/tests/ui/issues/issue-83048.rs +++ /dev/null @@ -1,5 +0,0 @@ -//@ compile-flags: -Z unpretty=thir-tree - -pub fn main() { - break; //~ ERROR: `break` outside of a loop or labeled block [E0268] -} diff --git a/tests/ui/issues/issue-83048.stderr b/tests/ui/issues/issue-83048.stderr deleted file mode 100644 index 672bf69a732..00000000000 --- a/tests/ui/issues/issue-83048.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0268]: `break` outside of a loop or labeled block - --> $DIR/issue-83048.rs:4:5 - | -LL | break; - | ^^^^^ cannot `break` outside of a loop or labeled block - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0268`. diff --git a/tests/ui/issues/issue-8391.rs b/tests/ui/issues/issue-8391.rs deleted file mode 100644 index 20698eed18b..00000000000 --- a/tests/ui/issues/issue-8391.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ run-pass - -fn main() { - let x = match Some(1) { - ref _y @ Some(_) => 1, - None => 2, - }; - assert_eq!(x, 1); -} diff --git a/tests/ui/issues/issue-8398.rs b/tests/ui/issues/issue-8398.rs deleted file mode 100644 index 7d100b855fd..00000000000 --- a/tests/ui/issues/issue-8398.rs +++ /dev/null @@ -1,12 +0,0 @@ -//@ check-pass -#![allow(dead_code)] - -pub trait Writer { - fn write(&mut self, b: &[u8]) -> Result<(), ()>; -} - -fn foo(a: &mut dyn Writer) { - a.write(&[]).unwrap(); -} - -pub fn main(){} diff --git a/tests/ui/issues/issue-8401.rs b/tests/ui/issues/issue-8401.rs deleted file mode 100644 index 1df63516fb0..00000000000 --- a/tests/ui/issues/issue-8401.rs +++ /dev/null @@ -1,7 +0,0 @@ -//@ run-pass -//@ aux-build:issue-8401.rs - - -extern crate issue_8401; - -pub fn main() {} diff --git a/tests/ui/issues/issue-8498.rs b/tests/ui/issues/issue-8498.rs deleted file mode 100644 index 92904e2198f..00000000000 --- a/tests/ui/issues/issue-8498.rs +++ /dev/null @@ -1,27 +0,0 @@ -//@ run-pass - -pub fn main() { - match &[(Box::new(5),Box::new(7))] { - ps => { - let (ref y, _) = ps[0]; - assert_eq!(**y, 5); - } - } - - match Some(&[(Box::new(5),)]) { - Some(ps) => { - let (ref y,) = ps[0]; - assert_eq!(**y, 5); - } - None => () - } - - match Some(&[(Box::new(5),Box::new(7))]) { - Some(ps) => { - let (ref y, ref z) = ps[0]; - assert_eq!(**y, 5); - assert_eq!(**z, 7); - } - None => () - } -} diff --git a/tests/ui/issues/issue-8506.rs b/tests/ui/issues/issue-8506.rs deleted file mode 100644 index 30a789a3e27..00000000000 --- a/tests/ui/issues/issue-8506.rs +++ /dev/null @@ -1,13 +0,0 @@ -//@ run-pass -#![allow(non_upper_case_globals)] - -#![allow(dead_code)] - -enum Either { - One, - Other(String,String) -} - -static one : Either = Either::One; - -pub fn main () { } diff --git a/tests/ui/issues/issue-8521.rs b/tests/ui/issues/issue-8521.rs deleted file mode 100644 index 78ce85787d5..00000000000 --- a/tests/ui/issues/issue-8521.rs +++ /dev/null @@ -1,25 +0,0 @@ -//@ check-pass -trait Foo1 {} - -trait A {} - -macro_rules! foo1(($t:path) => { - impl<T: $t> Foo1 for T {} -}); - -foo1!(A); - -trait Foo2 {} - -trait B<T> {} - -#[allow(unused)] -struct C {} - -macro_rules! foo2(($t:path) => { - impl<T: $t> Foo2 for T {} -}); - -foo2!(B<C>); - -fn main() {} diff --git a/tests/ui/issues/issue-85461.rs b/tests/ui/issues/issue-85461.rs deleted file mode 100644 index 72538081ccb..00000000000 --- a/tests/ui/issues/issue-85461.rs +++ /dev/null @@ -1,28 +0,0 @@ -//@ compile-flags: -Cinstrument-coverage -Ccodegen-units=4 --crate-type dylib -Copt-level=0 -//@ build-pass -//@ needs-profiler-runtime -//@ needs-dynamic-linking - -// Regression test for #85461 where MSVC sometimes fails to link instrument-coverage binaries -// with dead code and #[inline(always)]. - -#![allow(dead_code)] - -mod foo { - #[inline(always)] - pub fn called() { } - - fn uncalled() { } -} - -pub mod bar { - pub fn call_me() { - super::foo::called(); - } -} - -pub mod baz { - pub fn call_me() { - super::foo::called(); - } -} diff --git a/tests/ui/issues/issue-8578.rs b/tests/ui/issues/issue-8578.rs deleted file mode 100644 index 9baa2f70a02..00000000000 --- a/tests/ui/issues/issue-8578.rs +++ /dev/null @@ -1,19 +0,0 @@ -//@ check-pass -#![allow(dead_code)] -#![allow(non_camel_case_types)] -#![allow(non_upper_case_globals)] - -pub struct UninterpretedOption_NamePart { - name_part: Option<String>, -} - -impl<'a> UninterpretedOption_NamePart { - pub fn default_instance() -> &'static UninterpretedOption_NamePart { - static instance: UninterpretedOption_NamePart = UninterpretedOption_NamePart { - name_part: None, - }; - &instance - } -} - -pub fn main() {} diff --git a/tests/ui/issues/issue-86756.rs b/tests/ui/issues/issue-86756.rs deleted file mode 100644 index 55a6c144839..00000000000 --- a/tests/ui/issues/issue-86756.rs +++ /dev/null @@ -1,13 +0,0 @@ -//@ edition: 2015 -trait Foo<T, T = T> {} -//~^ ERROR the name `T` is already used for a generic parameter in this item's generic parameters - -fn eq<A, B>() { - eq::<dyn, Foo> - //~^ ERROR cannot find type `dyn` in this scope - //~| ERROR missing generics for trait `Foo` - //~| WARN trait objects without an explicit `dyn` are deprecated - //~| WARN this is accepted in the current edition -} - -fn main() {} diff --git a/tests/ui/issues/issue-86756.stderr b/tests/ui/issues/issue-86756.stderr deleted file mode 100644 index b650b32c2a3..00000000000 --- a/tests/ui/issues/issue-86756.stderr +++ /dev/null @@ -1,48 +0,0 @@ -error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters - --> $DIR/issue-86756.rs:2:14 - | -LL | trait Foo<T, T = T> {} - | - ^ already used - | | - | first use of `T` - -error[E0412]: cannot find type `dyn` in this scope - --> $DIR/issue-86756.rs:6:10 - | -LL | eq::<dyn, Foo> - | ^^^ not found in this scope - -warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/issue-86756.rs:6:15 - | -LL | eq::<dyn, Foo> - | ^^^ - | - = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2021/warnings-promoted-to-error.html> - = note: `#[warn(bare_trait_objects)]` on by default -help: if this is a dyn-compatible trait, use `dyn` - | -LL | eq::<dyn, dyn Foo> - | +++ - -error[E0107]: missing generics for trait `Foo` - --> $DIR/issue-86756.rs:6:15 - | -LL | eq::<dyn, Foo> - | ^^^ expected at least 1 generic argument - | -note: trait defined here, with at least 1 generic parameter: `T` - --> $DIR/issue-86756.rs:2:7 - | -LL | trait Foo<T, T = T> {} - | ^^^ - -help: add missing generic argument - | -LL | eq::<dyn, Foo<T>> - | +++ - -error: aborting due to 3 previous errors; 1 warning emitted - -Some errors have detailed explanations: E0107, E0403, E0412. -For more information about an error, try `rustc --explain E0107`. diff --git a/tests/ui/issues/issue-87199.rs b/tests/ui/issues/issue-87199.rs deleted file mode 100644 index dd9dfc74ca3..00000000000 --- a/tests/ui/issues/issue-87199.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Regression test for issue #87199, where attempting to relax a bound -// other than the only supported `?Sized` would still cause the compiler -// to assume that the `Sized` bound was relaxed. - -//@ check-fail - -// Check that these function definitions only emit warnings, not errors -fn arg<T: ?Send>(_: T) {} -//~^ ERROR: bound modifier `?` can only be applied to `Sized` -fn ref_arg<T: ?Send>(_: &T) {} -//~^ ERROR: bound modifier `?` can only be applied to `Sized` -fn ret() -> impl Iterator<Item = ()> + ?Send { std::iter::empty() } -//~^ ERROR: bound modifier `?` can only be applied to `Sized` -//~| ERROR: bound modifier `?` can only be applied to `Sized` - -// Check that there's no `?Sized` relaxation! -fn main() { - ref_arg::<i32>(&5); - ref_arg::<[i32]>(&[5]); - //~^ ERROR the size for values of type `[i32]` cannot be known -} diff --git a/tests/ui/issues/issue-87199.stderr b/tests/ui/issues/issue-87199.stderr deleted file mode 100644 index 8a930a3d704..00000000000 --- a/tests/ui/issues/issue-87199.stderr +++ /dev/null @@ -1,46 +0,0 @@ -error: bound modifier `?` can only be applied to `Sized` - --> $DIR/issue-87199.rs:8:11 - | -LL | fn arg<T: ?Send>(_: T) {} - | ^^^^^ - -error: bound modifier `?` can only be applied to `Sized` - --> $DIR/issue-87199.rs:10:15 - | -LL | fn ref_arg<T: ?Send>(_: &T) {} - | ^^^^^ - -error: bound modifier `?` can only be applied to `Sized` - --> $DIR/issue-87199.rs:12:40 - | -LL | fn ret() -> impl Iterator<Item = ()> + ?Send { std::iter::empty() } - | ^^^^^ - -error: bound modifier `?` can only be applied to `Sized` - --> $DIR/issue-87199.rs:12:40 - | -LL | fn ret() -> impl Iterator<Item = ()> + ?Send { std::iter::empty() } - | ^^^^^ - | - = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` - -error[E0277]: the size for values of type `[i32]` cannot be known at compilation time - --> $DIR/issue-87199.rs:19:15 - | -LL | ref_arg::<[i32]>(&[5]); - | ^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `[i32]` -note: required by an implicit `Sized` bound in `ref_arg` - --> $DIR/issue-87199.rs:10:12 - | -LL | fn ref_arg<T: ?Send>(_: &T) {} - | ^ required by the implicit `Sized` requirement on this type parameter in `ref_arg` -help: consider relaxing the implicit `Sized` restriction - | -LL | fn ref_arg<T: ?Send + ?Sized>(_: &T) {} - | ++++++++ - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/issues/issue-8727.rs b/tests/ui/issues/issue-8727.rs deleted file mode 100644 index c1b60e8e085..00000000000 --- a/tests/ui/issues/issue-8727.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Verify the compiler fails with an error on infinite function -// recursions. - -//@ build-fail -//@ compile-flags: --diagnostic-width=100 -Zwrite-long-types-to-disk=yes - -fn generic<T>() { //~ WARN function cannot return without recursing - generic::<Option<T>>(); -} -//~^^ ERROR reached the recursion limit while instantiating `generic::<Option< - - -fn main () { - // Use generic<T> at least once to trigger instantiation. - generic::<i32>(); -} diff --git a/tests/ui/issues/issue-8727.stderr b/tests/ui/issues/issue-8727.stderr deleted file mode 100644 index 9fb09a7d4f4..00000000000 --- a/tests/ui/issues/issue-8727.stderr +++ /dev/null @@ -1,27 +0,0 @@ -warning: function cannot return without recursing - --> $DIR/issue-8727.rs:7:1 - | -LL | fn generic<T>() { - | ^^^^^^^^^^^^^^^ cannot return without recursing -LL | generic::<Option<T>>(); - | ---------------------- recursive call site - | - = help: a `loop` may express intention better if this is on purpose - = note: `#[warn(unconditional_recursion)]` on by default - -error: reached the recursion limit while instantiating `generic::<Option<Option<Option<Option<...>>>>>` - --> $DIR/issue-8727.rs:8:5 - | -LL | generic::<Option<T>>(); - | ^^^^^^^^^^^^^^^^^^^^^^ - | -note: `generic` defined here - --> $DIR/issue-8727.rs:7:1 - | -LL | fn generic<T>() { - | ^^^^^^^^^^^^^^^ - = note: the full name for the type has been written to '$TEST_BUILD_DIR/issue-8727.long-type-$LONG_TYPE_HASH.txt' - = note: consider using `--verbose` to print the full type name to the console - -error: aborting due to 1 previous error; 1 warning emitted - diff --git a/tests/ui/issues/issue-87490.rs b/tests/ui/issues/issue-87490.rs deleted file mode 100644 index 998f61a6bd3..00000000000 --- a/tests/ui/issues/issue-87490.rs +++ /dev/null @@ -1,10 +0,0 @@ -fn main() {} -trait StreamOnce { - type Position; -} -impl StreamOnce for &str { - type Position = usize; -} -fn follow(_: &str) -> <&str as StreamOnce>::Position { - String::new //~ ERROR mismatched types -} diff --git a/tests/ui/issues/issue-87490.stderr b/tests/ui/issues/issue-87490.stderr deleted file mode 100644 index 5a4ec55833b..00000000000 --- a/tests/ui/issues/issue-87490.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-87490.rs:9:5 - | -LL | fn follow(_: &str) -> <&str as StreamOnce>::Position { - | ------------------------------ expected `usize` because of return type -LL | String::new - | ^^^^^^^^^^^ expected `usize`, found fn item - | - = note: expected type `usize` - found fn item `fn() -> String {String::new}` - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/issues/issue-8761.rs b/tests/ui/issues/issue-8761.rs deleted file mode 100644 index 5883bb96695..00000000000 --- a/tests/ui/issues/issue-8761.rs +++ /dev/null @@ -1,10 +0,0 @@ -enum Foo { - A = 1i64, - //~^ ERROR mismatched types - //~| NOTE expected `isize`, found `i64` - B = 2u8 - //~^ ERROR mismatched types - //~| NOTE expected `isize`, found `u8` -} - -fn main() {} diff --git a/tests/ui/issues/issue-8761.stderr b/tests/ui/issues/issue-8761.stderr deleted file mode 100644 index 4a9db568913..00000000000 --- a/tests/ui/issues/issue-8761.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-8761.rs:2:9 - | -LL | A = 1i64, - | ^^^^ expected `isize`, found `i64` - | -help: change the type of the numeric literal from `i64` to `isize` - | -LL - A = 1i64, -LL + A = 1isize, - | - -error[E0308]: mismatched types - --> $DIR/issue-8761.rs:5:9 - | -LL | B = 2u8 - | ^^^ expected `isize`, found `u8` - | -help: change the type of the numeric literal from `u8` to `isize` - | -LL - B = 2u8 -LL + B = 2isize - | - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/issues/issue-8767.rs b/tests/ui/issues/issue-8767.rs deleted file mode 100644 index 972101a0bc3..00000000000 --- a/tests/ui/issues/issue-8767.rs +++ /dev/null @@ -1,5 +0,0 @@ -impl B { //~ ERROR cannot find type `B` in this scope -} - -fn main() { -} diff --git a/tests/ui/issues/issue-8767.stderr b/tests/ui/issues/issue-8767.stderr deleted file mode 100644 index 66141628e28..00000000000 --- a/tests/ui/issues/issue-8767.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0412]: cannot find type `B` in this scope - --> $DIR/issue-8767.rs:1:6 - | -LL | impl B { - | ^ not found in this scope - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0412`. diff --git a/tests/ui/issues/issue-87707.rs b/tests/ui/issues/issue-87707.rs deleted file mode 100644 index a0da8a740ac..00000000000 --- a/tests/ui/issues/issue-87707.rs +++ /dev/null @@ -1,17 +0,0 @@ -// test for #87707 -//@ edition:2018 -//@ run-fail -//@ exec-env:RUST_BACKTRACE=0 -//@ check-run-results -//@ needs-unwind uses catch_unwind - -use std::sync::Once; -use std::panic; - -fn main() { - let o = Once::new(); - let _ = panic::catch_unwind(|| { - o.call_once(|| panic!("Here Once instance is poisoned.")); - }); - o.call_once(|| {}); -} diff --git a/tests/ui/issues/issue-87707.run.stderr b/tests/ui/issues/issue-87707.run.stderr deleted file mode 100644 index 8485c0578b8..00000000000 --- a/tests/ui/issues/issue-87707.run.stderr +++ /dev/null @@ -1,7 +0,0 @@ - -thread 'main' ($TID) panicked at $DIR/issue-87707.rs:14:24: -Here Once instance is poisoned. -note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace - -thread 'main' ($TID) panicked at $DIR/issue-87707.rs:16:7: -Once instance has previously been poisoned diff --git a/tests/ui/issues/issue-8783.rs b/tests/ui/issues/issue-8783.rs deleted file mode 100644 index d0ff79f8ac8..00000000000 --- a/tests/ui/issues/issue-8783.rs +++ /dev/null @@ -1,21 +0,0 @@ -//@ run-pass -#![allow(unused_variables)] - -struct X { pub x: usize } -impl Default for X { - fn default() -> X { - X { x: 42 } - } -} - -struct Y<T> { pub y: T } -impl<T: Default> Default for Y<T> { - fn default() -> Y<T> { - Y { y: Default::default() } - } -} - -fn main() { - let X { x: _ } = Default::default(); - let Y { y: X { x } } = Default::default(); -} diff --git a/tests/ui/issues/issue-8860.rs b/tests/ui/issues/issue-8860.rs deleted file mode 100644 index 3af61576fe1..00000000000 --- a/tests/ui/issues/issue-8860.rs +++ /dev/null @@ -1,51 +0,0 @@ -//@ run-pass -// FIXME(static_mut_refs): this could use an atomic -#![allow(static_mut_refs)] -#![allow(dead_code)] - -static mut DROP: isize = 0; -static mut DROP_S: isize = 0; -static mut DROP_T: isize = 0; - -struct S; -impl Drop for S { - fn drop(&mut self) { - unsafe { - DROP_S += 1; - DROP += 1; - } - } -} -fn f(ref _s: S) {} - -struct T { i: isize } -impl Drop for T { - fn drop(&mut self) { - unsafe { - DROP_T += 1; - DROP += 1; - } - } -} -fn g(ref _t: T) {} - -fn do_test() { - let s = S; - f(s); - unsafe { - assert_eq!(1, DROP); - assert_eq!(1, DROP_S); - } - let t = T { i: 1 }; - g(t); - unsafe { assert_eq!(1, DROP_T); } -} - -fn main() { - do_test(); - unsafe { - assert_eq!(2, DROP); - assert_eq!(1, DROP_S); - assert_eq!(1, DROP_T); - } -} diff --git a/tests/ui/issues/issue-9123.rs b/tests/ui/issues/issue-9123.rs deleted file mode 100644 index bbf6c13341c..00000000000 --- a/tests/ui/issues/issue-9123.rs +++ /dev/null @@ -1,7 +0,0 @@ -//@ run-pass -//@ aux-build:issue-9123.rs - - -extern crate issue_9123; - -pub fn main() {} |
