diff options
| author | Caio <c410.f3r@gmail.com> | 2021-03-20 11:41:24 -0300 |
|---|---|---|
| committer | Caio <c410.f3r@gmail.com> | 2021-03-20 11:41:24 -0300 |
| commit | 34901708930ddd01a93c5dbd35f0102a6d054e7f (patch) | |
| tree | 9172f89f85b3d695f0e858764bbcee6cc64016b2 /src/test/ui/issues | |
| parent | 1705a7d64b833d1c4b69958b0627bd054e6d764b (diff) | |
Move some tests to more reasonable directories - 5
Diffstat (limited to 'src/test/ui/issues')
| -rw-r--r-- | src/test/ui/issues/issue-10392.rs | 30 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-1701.rs | 26 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-23208.rs | 26 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-31597.rs | 29 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-45729-unsafe-in-generator.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-45729-unsafe-in-generator.stderr | 11 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-48508-aux.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-48508.rs | 21 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-52060.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-52060.stderr | 11 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-65611.rs | 63 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-65611.stderr | 21 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-68000-unicode-ident-after-missing-comma.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-68000-unicode-ident-after-missing-comma.stderr | 17 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-78372.rs | 14 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-78372.stderr | 62 |
16 files changed, 0 insertions, 360 deletions
diff --git a/src/test/ui/issues/issue-10392.rs b/src/test/ui/issues/issue-10392.rs deleted file mode 100644 index 926fa94800e..00000000000 --- a/src/test/ui/issues/issue-10392.rs +++ /dev/null @@ -1,30 +0,0 @@ -// run-pass -#![allow(unused_variables)] - -struct A { foo: isize } -struct B { a: isize, b: isize, c: isize } - -fn mka() -> A { panic!() } -fn mkb() -> B { panic!() } - -fn test() { - let A { foo, } = mka(); - let A { - foo, - } = mka(); - - let B { a, b, c, } = mkb(); - - match mka() { - A { foo: _foo, } => {} - } - - match Some(mka()) { - Some(A { foo: _foo, }) => {} - None => {} - } -} - -pub fn main() { - if false { test() } -} diff --git a/src/test/ui/issues/issue-1701.rs b/src/test/ui/issues/issue-1701.rs deleted file mode 100644 index bae32a77765..00000000000 --- a/src/test/ui/issues/issue-1701.rs +++ /dev/null @@ -1,26 +0,0 @@ -// run-pass -#![allow(dead_code)] -#![allow(non_camel_case_types)] - - -enum pattern { tabby, tortoiseshell, calico } -enum breed { beagle, rottweiler, pug } -type name = String; -enum ear_kind { lop, upright } -enum animal { cat(pattern), dog(breed), rabbit(name, ear_kind), tiger } - -fn noise(a: animal) -> Option<String> { - match a { - animal::cat(..) => { Some("meow".to_string()) } - animal::dog(..) => { Some("woof".to_string()) } - animal::rabbit(..) => { None } - animal::tiger => { Some("roar".to_string()) } - } -} - -pub fn main() { - assert_eq!(noise(animal::cat(pattern::tabby)), Some("meow".to_string())); - assert_eq!(noise(animal::dog(breed::pug)), Some("woof".to_string())); - assert_eq!(noise(animal::rabbit("Hilbert".to_string(), ear_kind::upright)), None); - assert_eq!(noise(animal::tiger), Some("roar".to_string())); -} diff --git a/src/test/ui/issues/issue-23208.rs b/src/test/ui/issues/issue-23208.rs deleted file mode 100644 index fd4ffe5d6e1..00000000000 --- a/src/test/ui/issues/issue-23208.rs +++ /dev/null @@ -1,26 +0,0 @@ -// run-pass -trait TheTrait : TheSuperTrait<<Self as TheTrait>::Item> { - type Item; -} - -trait TheSuperTrait<T> { - fn get(&self) -> T; -} - -impl TheTrait for i32 { - type Item = u32; -} - -impl TheSuperTrait<u32> for i32 { - fn get(&self) -> u32 { - *self as u32 - } -} - -fn foo<T:TheTrait<Item=u32>>(t: &T) -> u32 { - t.get() -} - -fn main() { - foo::<i32>(&22); -} diff --git a/src/test/ui/issues/issue-31597.rs b/src/test/ui/issues/issue-31597.rs deleted file mode 100644 index 2872be6d6c8..00000000000 --- a/src/test/ui/issues/issue-31597.rs +++ /dev/null @@ -1,29 +0,0 @@ -// check-pass -#![allow(dead_code)] -trait Make { - type Out; - - fn make() -> Self::Out; -} - -impl Make for () { - type Out = (); - - fn make() -> Self::Out {} -} - -// Also make sure we don't hit an ICE when the projection can't be known -fn f<T: Make>() -> <T as Make>::Out { loop {} } - -// ...and that it works with a blanket impl -trait Tr { - type Assoc; -} - -impl<T: Make> Tr for T { - type Assoc = (); -} - -fn g<T: Make>() -> <T as Tr>::Assoc { } - -fn main() {} diff --git a/src/test/ui/issues/issue-45729-unsafe-in-generator.rs b/src/test/ui/issues/issue-45729-unsafe-in-generator.rs deleted file mode 100644 index 638a1994bb5..00000000000 --- a/src/test/ui/issues/issue-45729-unsafe-in-generator.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![feature(generators)] - -fn main() { - let _ = || { - *(1 as *mut u32) = 42; - //~^ ERROR dereference of raw pointer is unsafe - yield; - }; -} diff --git a/src/test/ui/issues/issue-45729-unsafe-in-generator.stderr b/src/test/ui/issues/issue-45729-unsafe-in-generator.stderr deleted file mode 100644 index 2aab6807aaa..00000000000 --- a/src/test/ui/issues/issue-45729-unsafe-in-generator.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/issue-45729-unsafe-in-generator.rs:5:9 - | -LL | *(1 as *mut u32) = 42; - | ^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer - | - = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/ui/issues/issue-48508-aux.rs b/src/test/ui/issues/issue-48508-aux.rs deleted file mode 100644 index ebdc70a04df..00000000000 --- a/src/test/ui/issues/issue-48508-aux.rs +++ /dev/null @@ -1,7 +0,0 @@ -// run-pass -// ignore-test Not a test. Used by issue-48508.rs - -pub fn other() -> f64 { - let µ = 1.0; - µ -} diff --git a/src/test/ui/issues/issue-48508.rs b/src/test/ui/issues/issue-48508.rs deleted file mode 100644 index 8dc9351260e..00000000000 --- a/src/test/ui/issues/issue-48508.rs +++ /dev/null @@ -1,21 +0,0 @@ -// run-pass -// Regression test for issue #48508: -// -// Confusion between global and local file offsets caused incorrect handling of multibyte character -// spans when compiling multiple files. One visible effect was an ICE generating debug information -// when a multibyte character is at the end of a scope. The problematic code is actually in -// issue-48508-aux.rs - -// compile-flags:-g -// ignore-pretty issue #37195 -// ignore-asmjs wasm2js does not support source maps yet - -#![feature(non_ascii_idents)] -#![allow(uncommon_codepoints)] - -#[path = "issue-48508-aux.rs"] -mod other_file; - -fn main() { - other_file::other(); -} diff --git a/src/test/ui/issues/issue-52060.rs b/src/test/ui/issues/issue-52060.rs deleted file mode 100644 index 13b914c0331..00000000000 --- a/src/test/ui/issues/issue-52060.rs +++ /dev/null @@ -1,7 +0,0 @@ -// Regression test for https://github.com/rust-lang/rust/issues/52060 -// The compiler shouldn't ICE in this case -static A: &'static [u32] = &[1]; -static B: [u32; 1] = [0; A.len()]; -//~^ ERROR [E0013] - -fn main() {} diff --git a/src/test/ui/issues/issue-52060.stderr b/src/test/ui/issues/issue-52060.stderr deleted file mode 100644 index 95e5f2a8282..00000000000 --- a/src/test/ui/issues/issue-52060.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0013]: constants cannot refer to statics - --> $DIR/issue-52060.rs:4:26 - | -LL | static B: [u32; 1] = [0; A.len()]; - | ^ - | - = help: consider extracting the value of the `static` to a `const`, and referring to that - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0013`. diff --git a/src/test/ui/issues/issue-65611.rs b/src/test/ui/issues/issue-65611.rs deleted file mode 100644 index b74ee1b0c6e..00000000000 --- a/src/test/ui/issues/issue-65611.rs +++ /dev/null @@ -1,63 +0,0 @@ -use std::mem::MaybeUninit; -use std::ops::Deref; - -pub unsafe trait Array { - /// The array’s element type - type Item; - #[doc(hidden)] - /// The smallest index type that indexes the array. - type Index: Index; - #[doc(hidden)] - fn as_ptr(&self) -> *const Self::Item; - #[doc(hidden)] - fn as_mut_ptr(&mut self) -> *mut Self::Item; - #[doc(hidden)] - fn capacity() -> usize; -} - -pub trait Index : PartialEq + Copy { - fn to_usize(self) -> usize; - fn from(usize) -> Self; -} - -impl Index for usize { - fn to_usize(self) -> usize { self } - fn from(val: usize) -> Self { - val - } -} - -unsafe impl<T> Array for [T; 1] { - type Item = T; - type Index = usize; - fn as_ptr(&self) -> *const T { self as *const _ as *const _ } - fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut _} - fn capacity() -> usize { 1 } -} - -impl<A: Array> Deref for ArrayVec<A> { - type Target = [A::Item]; - #[inline] - fn deref(&self) -> &[A::Item] { - panic!() - } -} - -pub struct ArrayVec<A: Array> { - xs: MaybeUninit<A>, - len: usize, -} - -impl<A: Array> ArrayVec<A> { - pub fn new() -> ArrayVec<A> { - panic!() - } -} - -fn main() { - let mut buffer = ArrayVec::new(); - let x = buffer.last().unwrap().0.clone(); - //~^ ERROR type annotations needed - //~| ERROR no field `0` on type `&_` - buffer.reverse(); -} diff --git a/src/test/ui/issues/issue-65611.stderr b/src/test/ui/issues/issue-65611.stderr deleted file mode 100644 index e3c005a0593..00000000000 --- a/src/test/ui/issues/issue-65611.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/issue-65611.rs:59:20 - | -LL | let x = buffer.last().unwrap().0.clone(); - | -------^^^^-- - | | | - | | cannot infer type for type parameter `T` - | this method call resolves to `Option<&T>` - | - = note: type must be known at this point - -error[E0609]: no field `0` on type `&_` - --> $DIR/issue-65611.rs:59:36 - | -LL | let x = buffer.last().unwrap().0.clone(); - | ^ - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0282, E0609. -For more information about an error, try `rustc --explain E0282`. diff --git a/src/test/ui/issues/issue-68000-unicode-ident-after-missing-comma.rs b/src/test/ui/issues/issue-68000-unicode-ident-after-missing-comma.rs deleted file mode 100644 index 3c49a5a9752..00000000000 --- a/src/test/ui/issues/issue-68000-unicode-ident-after-missing-comma.rs +++ /dev/null @@ -1,6 +0,0 @@ -pub struct Foo { - pub bar: Vec<i32>ö - //~^ ERROR expected `,`, or `}`, found `ö` -} //~ ERROR expected `:`, found `}` - -fn main() {} diff --git a/src/test/ui/issues/issue-68000-unicode-ident-after-missing-comma.stderr b/src/test/ui/issues/issue-68000-unicode-ident-after-missing-comma.stderr deleted file mode 100644 index ef365a61643..00000000000 --- a/src/test/ui/issues/issue-68000-unicode-ident-after-missing-comma.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error: expected `,`, or `}`, found `ö` - --> $DIR/issue-68000-unicode-ident-after-missing-comma.rs:2:22 - | -LL | pub bar: Vec<i32>ö - | ^ help: try adding a comma: `,` - -error: expected `:`, found `}` - --> $DIR/issue-68000-unicode-ident-after-missing-comma.rs:4:1 - | -LL | pub bar: Vec<i32>ö - | - expected `:` -LL | -LL | } - | ^ unexpected token - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/issues/issue-78372.rs b/src/test/ui/issues/issue-78372.rs deleted file mode 100644 index 77a8c92c81c..00000000000 --- a/src/test/ui/issues/issue-78372.rs +++ /dev/null @@ -1,14 +0,0 @@ -use std::ops::DispatchFromDyn; //~ ERROR use of unstable library feature 'dispatch_from_dyn' -struct Smaht<T, MISC>(PhantomData); //~ ERROR cannot find type `PhantomData` in this scope -impl<T> DispatchFromDyn<Smaht<U, MISC>> for T {} //~ ERROR cannot find type `U` in this scope -//~^ ERROR cannot find type `MISC` in this scope -//~| ERROR use of unstable library feature 'dispatch_from_dyn' -//~| ERROR the trait `DispatchFromDyn` may only be implemented for a coercion between structures -//~| ERROR type parameter `T` must be covered by another type when it appears before the first -trait Foo: X<u32> {} -trait X<T> { - fn foo(self: Smaht<Self, T>); -} -trait Marker {} -impl Marker for dyn Foo {} -fn main() {} diff --git a/src/test/ui/issues/issue-78372.stderr b/src/test/ui/issues/issue-78372.stderr deleted file mode 100644 index 9267e838cea..00000000000 --- a/src/test/ui/issues/issue-78372.stderr +++ /dev/null @@ -1,62 +0,0 @@ -error[E0412]: cannot find type `PhantomData` in this scope - --> $DIR/issue-78372.rs:2:23 - | -LL | struct Smaht<T, MISC>(PhantomData); - | ^^^^^^^^^^^ not found in this scope - | -help: consider importing this struct - | -LL | use std::marker::PhantomData; - | - -error[E0412]: cannot find type `U` in this scope - --> $DIR/issue-78372.rs:3:31 - | -LL | impl<T> DispatchFromDyn<Smaht<U, MISC>> for T {} - | - ^ help: a type parameter with a similar name exists: `T` - | | - | similarly named type parameter `T` defined here - -error[E0412]: cannot find type `MISC` in this scope - --> $DIR/issue-78372.rs:3:34 - | -LL | impl<T> DispatchFromDyn<Smaht<U, MISC>> for T {} - | - ^^^^ not found in this scope - | | - | help: you might be missing a type parameter: `, MISC` - -error[E0658]: use of unstable library feature 'dispatch_from_dyn' - --> $DIR/issue-78372.rs:1:5 - | -LL | use std::ops::DispatchFromDyn; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: add `#![feature(dispatch_from_dyn)]` to the crate attributes to enable - -error[E0658]: use of unstable library feature 'dispatch_from_dyn' - --> $DIR/issue-78372.rs:3:9 - | -LL | impl<T> DispatchFromDyn<Smaht<U, MISC>> for T {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: add `#![feature(dispatch_from_dyn)]` to the crate attributes to enable - -error[E0378]: the trait `DispatchFromDyn` may only be implemented for a coercion between structures - --> $DIR/issue-78372.rs:3:1 - | -LL | impl<T> DispatchFromDyn<Smaht<U, MISC>> for T {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Smaht<[type error], [type error]>`) - --> $DIR/issue-78372.rs:3:6 - | -LL | impl<T> DispatchFromDyn<Smaht<U, MISC>> for T {} - | ^ type parameter `T` must be covered by another type when it appears before the first local type (`Smaht<[type error], [type error]>`) - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type - = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last - -error: aborting due to 7 previous errors - -Some errors have detailed explanations: E0210, E0378, E0412, E0658. -For more information about an error, try `rustc --explain E0210`. |
