about summary refs log tree commit diff
path: root/src/test/ui/issues
diff options
context:
space:
mode:
authorCaio <c410.f3r@gmail.com>2022-04-26 23:38:04 -0300
committerCaio <c410.f3r@gmail.com>2022-04-26 23:38:04 -0300
commitb72f6e55a163a2446b8ec4203ffd4284514eb17b (patch)
treee0b726d54f88a66977356d87c5598365ab1f1295 /src/test/ui/issues
parenta7197189cd0e3a86d1b661d1dceb8bdff021d0b8 (diff)
downloadrust-b72f6e55a163a2446b8ec4203ffd4284514eb17b.tar.gz
rust-b72f6e55a163a2446b8ec4203ffd4284514eb17b.zip
Move some tests to more reasonable places
Diffstat (limited to 'src/test/ui/issues')
-rw-r--r--src/test/ui/issues/issue-17233.rs17
-rw-r--r--src/test/ui/issues/issue-19244.rs34
-rw-r--r--src/test/ui/issues/issue-19538.rs20
-rw-r--r--src/test/ui/issues/issue-19538.stderr37
-rw-r--r--src/test/ui/issues/issue-25339.rs31
-rw-r--r--src/test/ui/issues/issue-26545.rs12
-rw-r--r--src/test/ui/issues/issue-26545.stderr14
-rw-r--r--src/test/ui/issues/issue-3820.rs15
-rw-r--r--src/test/ui/issues/issue-3820.stderr28
-rw-r--r--src/test/ui/issues/issue-45696-no-variant-box-recur.rs50
-rw-r--r--src/test/ui/issues/issue-55846.rs39
-rw-r--r--src/test/ui/issues/issue-72574-1.rs10
-rw-r--r--src/test/ui/issues/issue-72574-1.stderr34
13 files changed, 0 insertions, 341 deletions
diff --git a/src/test/ui/issues/issue-17233.rs b/src/test/ui/issues/issue-17233.rs
deleted file mode 100644
index 54a12fdf8e8..00000000000
--- a/src/test/ui/issues/issue-17233.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// run-pass
-
-const X1: &'static [u8] = &[b'1'];
-const X2: &'static [u8] = b"1";
-const X3: &'static [u8; 1] = &[b'1'];
-const X4: &'static [u8; 1] = b"1";
-
-static Y1: u8 = X1[0];
-static Y2: u8 = X2[0];
-static Y3: u8 = X3[0];
-static Y4: u8 = X4[0];
-
-fn main() {
-    assert_eq!(Y1, Y2);
-    assert_eq!(Y1, Y3);
-    assert_eq!(Y1, Y4);
-}
diff --git a/src/test/ui/issues/issue-19244.rs b/src/test/ui/issues/issue-19244.rs
deleted file mode 100644
index 44d9748fd2a..00000000000
--- a/src/test/ui/issues/issue-19244.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-// run-pass
-
-struct MyStruct { field: usize }
-struct Nested { nested: MyStruct }
-struct Mix2 { nested: ((usize,),) }
-
-const STRUCT: MyStruct = MyStruct { field: 42 };
-const TUP: (usize,) = (43,);
-const NESTED_S: Nested = Nested { nested: MyStruct { field: 5 } };
-const NESTED_T: ((usize,),) = ((4,),);
-const MIX_1: ((Nested,),) = ((Nested { nested: MyStruct { field: 3 } },),);
-const MIX_2: Mix2 = Mix2 { nested: ((2,),) };
-const INSTANT_1: usize = (MyStruct { field: 1 }).field;
-const INSTANT_2: usize = (0,).0;
-
-fn main() {
-    let a = [0; STRUCT.field];
-    let b = [0; TUP.0];
-    let c = [0; NESTED_S.nested.field];
-    let d = [0; (NESTED_T.0).0];
-    let e = [0; (MIX_1.0).0.nested.field];
-    let f = [0; (MIX_2.nested.0).0];
-    let g = [0; INSTANT_1];
-    let h = [0; INSTANT_2];
-
-    assert_eq!(a.len(), 42);
-    assert_eq!(b.len(), 43);
-    assert_eq!(c.len(), 5);
-    assert_eq!(d.len(), 4);
-    assert_eq!(e.len(), 3);
-    assert_eq!(f.len(), 2);
-    assert_eq!(g.len(), 1);
-    assert_eq!(h.len(), 0);
-}
diff --git a/src/test/ui/issues/issue-19538.rs b/src/test/ui/issues/issue-19538.rs
deleted file mode 100644
index 7054ef41b1c..00000000000
--- a/src/test/ui/issues/issue-19538.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-trait Foo {
-    fn foo<T>(&self, val: T);
-}
-
-trait Bar: Foo { }
-
-pub struct Thing;
-
-impl Foo for Thing {
-    fn foo<T>(&self, val: T) { }
-}
-
-impl Bar for Thing { }
-
-fn main() {
-    let mut thing = Thing;
-    let test: &mut dyn Bar = &mut thing;
-    //~^ ERROR E0038
-    //~| ERROR E0038
-}
diff --git a/src/test/ui/issues/issue-19538.stderr b/src/test/ui/issues/issue-19538.stderr
deleted file mode 100644
index 7b37e1f95dc..00000000000
--- a/src/test/ui/issues/issue-19538.stderr
+++ /dev/null
@@ -1,37 +0,0 @@
-error[E0038]: the trait `Bar` cannot be made into an object
-  --> $DIR/issue-19538.rs:17:15
-   |
-LL |     let test: &mut dyn Bar = &mut thing;
-   |               ^^^^^^^^^^^^ `Bar` cannot be made into an object
-   |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-  --> $DIR/issue-19538.rs:2:8
-   |
-LL |     fn foo<T>(&self, val: T);
-   |        ^^^ ...because method `foo` has generic type parameters
-...
-LL | trait Bar: Foo { }
-   |       --- this trait cannot be made into an object...
-   = help: consider moving `foo` to another trait
-
-error[E0038]: the trait `Bar` cannot be made into an object
-  --> $DIR/issue-19538.rs:17:30
-   |
-LL |     let test: &mut dyn Bar = &mut thing;
-   |                              ^^^^^^^^^^ `Bar` cannot be made into an object
-   |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
-  --> $DIR/issue-19538.rs:2:8
-   |
-LL |     fn foo<T>(&self, val: T);
-   |        ^^^ ...because method `foo` has generic type parameters
-...
-LL | trait Bar: Foo { }
-   |       --- this trait cannot be made into an object...
-   = help: consider moving `foo` to another trait
-   = note: required because of the requirements on the impl of `CoerceUnsized<&mut dyn Bar>` for `&mut Thing`
-   = note: required by cast to type `&mut dyn Bar`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0038`.
diff --git a/src/test/ui/issues/issue-25339.rs b/src/test/ui/issues/issue-25339.rs
deleted file mode 100644
index 6f8ec700951..00000000000
--- a/src/test/ui/issues/issue-25339.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// run-pass
-#![allow(dead_code)]
-#![allow(unused_variables)]
-#![feature(associated_type_defaults)]
-
-use std::marker::PhantomData;
-
-pub trait Routing<I> {
-    type Output;
-    fn resolve(&self, input: I);
-}
-
-pub trait ToRouting {
-    type Input;
-    type Routing : ?Sized = dyn Routing<Self::Input, Output=()>;
-    fn to_routing(self) -> Self::Routing;
-}
-
-pub struct Mount<I, R: Routing<I>> {
-    action: R,
-    _marker: PhantomData<I>
-}
-
-impl<I, R: Routing<I>> Mount<I, R> {
-    pub fn create<T: ToRouting<Routing=R>>(mount: &str, input: T) {
-        input.to_routing();
-    }
-}
-
-fn main() {
-}
diff --git a/src/test/ui/issues/issue-26545.rs b/src/test/ui/issues/issue-26545.rs
deleted file mode 100644
index 5652ee74706..00000000000
--- a/src/test/ui/issues/issue-26545.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-mod foo {
-    pub struct B(pub ());
-}
-
-mod baz {
-    fn foo() {
-        B(());
-        //~^ ERROR cannot find function, tuple struct or tuple variant `B` in this scope [E0425]
-    }
-}
-
-fn main() {}
diff --git a/src/test/ui/issues/issue-26545.stderr b/src/test/ui/issues/issue-26545.stderr
deleted file mode 100644
index d3c86692501..00000000000
--- a/src/test/ui/issues/issue-26545.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0425]: cannot find function, tuple struct or tuple variant `B` in this scope
-  --> $DIR/issue-26545.rs:7:9
-   |
-LL |         B(());
-   |         ^ not found in this scope
-   |
-help: consider importing this tuple struct
-   |
-LL |     use foo::B;
-   |
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/issues/issue-3820.rs b/src/test/ui/issues/issue-3820.rs
deleted file mode 100644
index b987a90b28b..00000000000
--- a/src/test/ui/issues/issue-3820.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-struct Thing {
-    x: isize
-}
-
-impl Thing {
-    fn mul(&self, c: &isize) -> Thing {
-        Thing {x: self.x * *c}
-    }
-}
-
-fn main() {
-    let u = Thing {x: 2};
-    let _v = u.mul(&3); // This is ok
-    let w = u * 3; //~ ERROR cannot multiply `Thing` by `{integer}`
-}
diff --git a/src/test/ui/issues/issue-3820.stderr b/src/test/ui/issues/issue-3820.stderr
deleted file mode 100644
index d5c24e1bb6c..00000000000
--- a/src/test/ui/issues/issue-3820.stderr
+++ /dev/null
@@ -1,28 +0,0 @@
-error[E0369]: cannot multiply `Thing` by `{integer}`
-  --> $DIR/issue-3820.rs:14:15
-   |
-LL |     let w = u * 3;
-   |             - ^ - {integer}
-   |             |
-   |             Thing
-   |
-note: an implementation of `Mul<_>` might be missing for `Thing`
-  --> $DIR/issue-3820.rs:1:1
-   |
-LL | struct Thing {
-   | ^^^^^^^^^^^^ must implement `Mul<_>`
-note: the following trait must be implemented
-  --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
-   |
-LL | / pub trait Mul<Rhs = Self> {
-LL | |     /// The resulting type after applying the `*` operator.
-LL | |     #[stable(feature = "rust1", since = "1.0.0")]
-LL | |     type Output;
-...  |
-LL | |     fn mul(self, rhs: Rhs) -> Self::Output;
-LL | | }
-   | |_^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0369`.
diff --git a/src/test/ui/issues/issue-45696-no-variant-box-recur.rs b/src/test/ui/issues/issue-45696-no-variant-box-recur.rs
deleted file mode 100644
index c688261fa1c..00000000000
--- a/src/test/ui/issues/issue-45696-no-variant-box-recur.rs
+++ /dev/null
@@ -1,50 +0,0 @@
-// rust-lang/rust#45696: This test checks the compiler won't infinite loop when
-// you declare a variable of type `struct A(Box<A>, ...);` (which is impossible
-// to construct but *is* possible to declare; see also issues #4287, #44933,
-// and #52852).
-//
-// We will explicitly test NLL, and migration modes; thus we will also skip the
-// automated compare-mode=nll.
-
-// run-pass
-
-// This test has structs and functions that are by definition unusable
-// all over the place, so just go ahead and allow dead_code
-#![allow(dead_code)]
-
-// direct regular recursion with indirect ownership via box
-struct C { field: Box<C> }
-
-// direct non-regular recursion with indirect ownership via box
-struct D { field: Box<(D, D)> }
-
-// indirect regular recursion with indirect ownership via box.
-struct E { field: F }
-struct F { field: Box<E> }
-
-// indirect non-regular recursion with indirect ownership via box.
-struct G { field: (H, H) }
-struct H { field: Box<G> }
-
-// These enums are cases that are not currently hit by the
-// `visit_terminator_drop` recursion down a type's structural
-// definition.
-//
-// But it seems prudent to include them in this test as variants on
-// the above, in that they are similarly non-constructable data types
-// with destructors that would diverge.
-enum I { One(Box<I>) }
-enum J { One(Box<J>), Two(Box<J>) }
-
-fn impossible_to_call_c(_c: C) { }
-fn impossible_to_call_d(_d: D) { }
-fn impossible_to_call_e(_e: E) { }
-fn impossible_to_call_f(_f: F) { }
-fn impossible_to_call_g(_g: G) { }
-fn impossible_to_call_h(_h: H) { }
-fn impossible_to_call_i(_i: I) { }
-fn impossible_to_call_j(_j: J) { }
-
-fn main() {
-
-}
diff --git a/src/test/ui/issues/issue-55846.rs b/src/test/ui/issues/issue-55846.rs
deleted file mode 100644
index bd766752360..00000000000
--- a/src/test/ui/issues/issue-55846.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-// run-pass
-
-// Regression test for #55846, which once caused an ICE.
-
-use std::marker::PhantomData;
-
-struct Foo;
-
-struct Bar<A> {
-    a: PhantomData<A>,
-}
-
-impl Fooifier for Foo {
-    type Assoc = Foo;
-}
-
-trait Fooifier {
-    type Assoc;
-}
-
-trait Barifier<H> {
-    fn barify();
-}
-
-impl<H> Barifier<H> for Bar<H> {
-    fn barify() {
-        println!("All correct!");
-    }
-}
-
-impl Bar<<Foo as Fooifier>::Assoc> {
-    fn this_shouldnt_crash() {
-        <Self as Barifier<<Foo as Fooifier>::Assoc>>::barify();
-    }
-}
-
-fn main() {
-    Bar::<Foo>::this_shouldnt_crash();
-}
diff --git a/src/test/ui/issues/issue-72574-1.rs b/src/test/ui/issues/issue-72574-1.rs
deleted file mode 100644
index 1b80a21793a..00000000000
--- a/src/test/ui/issues/issue-72574-1.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-fn main() {
-    let x = (1, 2, 3);
-    match x {
-        (_a, _x @ ..) => {}
-        _ => {}
-    }
-}
-//~^^^^ ERROR `_x @` is not allowed in a tuple
-//~| ERROR: `..` patterns are not allowed here
-//~| ERROR: mismatched types
diff --git a/src/test/ui/issues/issue-72574-1.stderr b/src/test/ui/issues/issue-72574-1.stderr
deleted file mode 100644
index 653869a237d..00000000000
--- a/src/test/ui/issues/issue-72574-1.stderr
+++ /dev/null
@@ -1,34 +0,0 @@
-error: `_x @` is not allowed in a tuple
-  --> $DIR/issue-72574-1.rs:4:14
-   |
-LL |         (_a, _x @ ..) => {}
-   |              ^^^^^^^ this is only allowed in slice patterns
-   |
-   = help: remove this and bind each tuple field independently
-help: if you don't need to use the contents of _x, discard the tuple's remaining fields
-   |
-LL |         (_a, ..) => {}
-   |              ~~
-
-error: `..` patterns are not allowed here
-  --> $DIR/issue-72574-1.rs:4:19
-   |
-LL |         (_a, _x @ ..) => {}
-   |                   ^^
-   |
-   = note: only allowed in tuple, tuple struct, and slice patterns
-
-error[E0308]: mismatched types
-  --> $DIR/issue-72574-1.rs:4:9
-   |
-LL |     match x {
-   |           - this expression has type `({integer}, {integer}, {integer})`
-LL |         (_a, _x @ ..) => {}
-   |         ^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 2 elements
-   |
-   = note: expected tuple `({integer}, {integer}, {integer})`
-              found tuple `(_, _)`
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0308`.