Move some tests to more reasonable directories

This commit is contained in:
Caio 2021-02-16 21:22:21 -03:00
parent 097bc6a84f
commit e7e93717ce
55 changed files with 5 additions and 19 deletions

View file

@ -1,13 +0,0 @@
// check-pass
#![allow(dead_code)]
// pretty-expanded FIXME #23616
struct TestStruct {
x: *const [isize; 2]
}
unsafe impl Sync for TestStruct {}
static TEST_VALUE : TestStruct = TestStruct{x: 0x1234 as *const [isize; 2]};
fn main() {}

View file

@ -1,24 +0,0 @@
#![allow(warnings)]
struct Struct { a: usize }
const C: usize = 1;
static S: usize = 1;
const T1: &'static usize = &C;
const T2: &'static usize = &S; //~ ERROR: constants cannot refer to statics
static T3: &'static usize = &C;
static T4: &'static usize = &S;
const T5: usize = C;
const T6: usize = S; //~ ERROR: constants cannot refer to statics
static T7: usize = C;
static T8: usize = S;
const T9: Struct = Struct { a: C };
const T10: Struct = Struct { a: S };
//~^ ERROR: constants cannot refer to statics
static T11: Struct = Struct { a: C };
static T12: Struct = Struct { a: S };
fn main() {}

View file

@ -1,27 +0,0 @@
error[E0013]: constants cannot refer to statics
--> $DIR/issue-17718-references.rs:9:29
|
LL | const T2: &'static usize = &S;
| ^
|
= help: consider extracting the value of the `static` to a `const`, and referring to that
error[E0013]: constants cannot refer to statics
--> $DIR/issue-17718-references.rs:14:19
|
LL | const T6: usize = S;
| ^
|
= help: consider extracting the value of the `static` to a `const`, and referring to that
error[E0013]: constants cannot refer to statics
--> $DIR/issue-17718-references.rs:19:33
|
LL | const T10: Struct = Struct { a: S };
| ^
|
= help: consider extracting the value of the `static` to a `const`, and referring to that
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0013`.

View file

@ -1,35 +0,0 @@
// We need all these 9 issue-20616-N.rs files
// because we can only catch one parsing error at a time
type Type_1_<'a, T> = &'a T;
//type Type_1<'a T> = &'a T; // error: expected `,` or `>` after lifetime name, found `T`
//type Type_2 = Type_1_<'static ()>; // error: expected `,` or `>` after lifetime name, found `(`
type Type_3<T> = Box<T,,>;
//~^ error: expected one of `>`, a const expression, lifetime, or type, found `,`
//type Type_4<T> = Type_1_<'static,, T>; // error: expected type, found `,`
type Type_5_<'a> = Type_1_<'a, ()>;
//type Type_5<'a> = Type_1_<'a, (),,>; // error: expected type, found `,`
//type Type_6 = Type_5_<'a,,>; // error: expected type, found `,`
//type Type_7 = Box<(),,>; // error: expected type, found `,`
//type Type_8<'a,,> = &'a (); // error: expected ident, found `,`
//type Type_9<T,,> = Box<T>; // error: expected ident, found `,`

View file

@ -1,8 +0,0 @@
error: expected one of `>`, a const expression, lifetime, or type, found `,`
--> $DIR/issue-20616-3.rs:13:24
|
LL | type Type_3<T> = Box<T,,>;
| ^ expected one of `>`, a const expression, lifetime, or type
error: aborting due to previous error

View file

@ -1,38 +0,0 @@
// check-pass
#![allow(dead_code)]
// Regression test for #21726: an issue arose around the rules for
// subtyping of projection types that resulted in an unconstrained
// region, yielding region inference failures.
// pretty-expanded FIXME #23616
fn main() { }
fn foo<'a>(s: &'a str) {
let b: B<()> = B::new(s, ());
b.get_short();
}
trait IntoRef<'a> {
type T: Clone;
fn into_ref(self, _: &'a str) -> Self::T;
}
impl<'a> IntoRef<'a> for () {
type T = &'a str;
fn into_ref(self, s: &'a str) -> &'a str {
s
}
}
struct B<'a, P: IntoRef<'a>>(P::T);
impl<'a, P: IntoRef<'a>> B<'a, P> {
fn new(s: &'a str, i: P) -> B<'a, P> {
B(i.into_ref(s))
}
fn get_short(&self) -> P::T {
self.0.clone()
}
}

View file

@ -1,15 +0,0 @@
trait Add<Rhs=Self> {
type Output;
}
trait Sub<Rhs=Self> {
type Output;
}
type Test = dyn Add + Sub;
//~^ ERROR E0393
//~| ERROR E0191
//~| ERROR E0393
//~| ERROR E0225
fn main() { }

View file

@ -1,60 +0,0 @@
error[E0393]: the type parameter `Rhs` must be explicitly specified
--> $DIR/issue-22560.rs:9:23
|
LL | / trait Sub<Rhs=Self> {
LL | | type Output;
LL | | }
| |_- type parameter `Rhs` must be specified for this
LL |
LL | type Test = dyn Add + Sub;
| ^^^ help: set the type parameter to the desired type: `Sub<Rhs>`
|
= note: because of the default `Self` reference, type parameters must be specified on object types
error[E0393]: the type parameter `Rhs` must be explicitly specified
--> $DIR/issue-22560.rs:9:17
|
LL | / trait Add<Rhs=Self> {
LL | | type Output;
LL | | }
| |_- type parameter `Rhs` must be specified for this
...
LL | type Test = dyn Add + Sub;
| ^^^ help: set the type parameter to the desired type: `Add<Rhs>`
|
= note: because of the default `Self` reference, type parameters must be specified on object types
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/issue-22560.rs:9:23
|
LL | type Test = dyn Add + Sub;
| --- ^^^ additional non-auto trait
| |
| first non-auto trait
|
= help: consider creating a new trait with all of these as super-traits and using that trait here instead: `trait NewTrait: Add<[type error]> + Sub<[type error]> {}`
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
error[E0191]: the value of the associated types `Output` (from trait `Add`), `Output` (from trait `Sub`) must be specified
--> $DIR/issue-22560.rs:9:17
|
LL | type Output;
| ------------ `Output` defined here
...
LL | type Output;
| ------------ `Output` defined here
...
LL | type Test = dyn Add + Sub;
| ^^^ ^^^ associated type `Output` must be specified
| |
| associated type `Output` must be specified
|
help: specify the associated types
|
LL | type Test = dyn Add<Output = Type> + Sub<Output = Type>;
| ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0191, E0225, E0393.
For more information about an error, try `rustc --explain E0191`.

View file

@ -1,10 +0,0 @@
#![feature(associated_type_defaults)]
pub struct C<AType: A> {a:AType}
pub trait A {
type B = C<Self::anything_here_kills_it>;
//~^ ERROR: associated type `anything_here_kills_it` not found for `Self`
}
fn main() {}

View file

@ -1,9 +0,0 @@
error[E0220]: associated type `anything_here_kills_it` not found for `Self`
--> $DIR/issue-23595-2.rs:6:22
|
LL | type B = C<Self::anything_here_kills_it>;
| ^^^^^^^^^^^^^^^^^^^^^^ associated type `anything_here_kills_it` not found
error: aborting due to previous error
For more information about this error, try `rustc --explain E0220`.

View file

@ -1,25 +0,0 @@
// check-pass
#![allow(dead_code)]
trait MultiDispatch<T> {
type O;
}
trait Trait: Sized {
type A: MultiDispatch<Self::B, O = Self>;
type B;
fn new<U>(u: U) -> <Self::A as MultiDispatch<U>>::O
where
Self::A: MultiDispatch<U>;
}
fn test<T: Trait<B = i32>>(b: i32) -> T
where
T::A: MultiDispatch<i32>,
{
T::new(b)
}
fn main() {}

View file

@ -1,8 +0,0 @@
// check-pass
#![deny(non_snake_case)]
#[no_mangle]
pub extern "C" fn SparklingGenerationForeignFunctionInterface() {} // OK
fn main() {}

View file

@ -1,6 +0,0 @@
static S : u64 = { { panic!("foo"); 0 } };
//~^ ERROR panicking in statics is unstable
fn main() {
println!("{:?}", S);
}

View file

@ -1,13 +0,0 @@
error[E0658]: panicking in statics is unstable
--> $DIR/issue-32829.rs:1:22
|
LL | static S : u64 = { { panic!("foo"); 0 } };
| ^^^^^^^^^^^^^^
|
= note: see issue #51999 <https://github.com/rust-lang/rust/issues/51999> for more information
= help: add `#![feature(const_panic)]` to the crate attributes to enable
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.

View file

@ -1,14 +0,0 @@
// run-pass
const fn foo() -> *const i8 {
b"foo" as *const _ as *const i8
}
const fn bar() -> i32 {
*&{(1, 2, 3).1}
}
fn main() {
assert_eq!(foo(), b"foo" as *const _ as *const i8);
assert_eq!(bar(), 2);
}

View file

@ -1,17 +0,0 @@
// run-pass
macro_rules! gen {
($name:ident ( $($dol:tt $var:ident)* ) $($body:tt)*) => {
macro_rules! $name {
($($dol $var:ident)*) => {
$($body)*
}
}
}
}
gen!(m($var) $var);
fn main() {
let x = 1;
assert_eq!(m!(x), 1);
}

View file

@ -1,9 +0,0 @@
fn main() {
let a = if true {
0
} else if false {
//~^ ERROR `if` may be missing an `else` clause
//~| expected `()`, found integer
1
};
}

View file

@ -1,18 +0,0 @@
error[E0317]: `if` may be missing an `else` clause
--> $DIR/issue-4201.rs:4:12
|
LL | } else if false {
| ____________^
LL | |
LL | |
LL | | 1
| | - found here
LL | | };
| |_____^ expected `()`, found integer
|
= note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type
error: aborting due to previous error
For more information about this error, try `rustc --explain E0317`.

View file

@ -1,17 +0,0 @@
pub trait Partial<X: ?Sized>: Copy {
}
pub trait Complete {
type Assoc: Partial<Self>;
}
impl<T> Partial<T> for T::Assoc where
T: Complete
{
}
impl<T> Complete for T {
type Assoc = T; //~ ERROR the trait bound `T: Copy` is not satisfied
}
fn main() {}

View file

@ -1,17 +0,0 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/issue-43784-associated-type.rs:14:5
|
LL | type Assoc: Partial<Self>;
| ------------- required by this bound in `Complete::Assoc`
...
LL | type Assoc = T;
| ^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
help: consider restricting type parameter `T`
|
LL | impl<T: Copy> Complete for T {
| ^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.

View file

@ -1,10 +0,0 @@
macro_rules! foo {
($rest: tt) => {
bar(baz: $rest)
}
}
fn main() {
foo!(true); //~ ERROR expected type, found keyword
//~^ ERROR expected identifier, found keyword
}

View file

@ -1,25 +0,0 @@
error: expected identifier, found keyword `true`
--> $DIR/issue-44406.rs:8:10
|
LL | foo!(true);
| ^^^^ expected identifier, found keyword
|
help: you can escape reserved keywords to use them as identifiers
|
LL | foo!(r#true);
| ^^^^^^
error: expected type, found keyword `true`
--> $DIR/issue-44406.rs:8:10
|
LL | bar(baz: $rest)
| - help: try using a semicolon: `;`
...
LL | foo!(true);
| ^^^^ expected type
|
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
= note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
error: aborting due to 2 previous errors

View file

@ -1,23 +0,0 @@
// run-pass
// pretty-expanded FIXME #23616
pub trait OpInt { fn call(&mut self, _: isize, _: isize) -> isize; }
impl<F> OpInt for F where F: FnMut(isize, isize) -> isize {
fn call(&mut self, a:isize, b:isize) -> isize {
(*self)(a, b)
}
}
fn squarei<'a>(x: isize, op: &'a mut dyn OpInt) -> isize { op.call(x, x) }
fn muli(x:isize, y:isize) -> isize { x * y }
pub fn main() {
let mut f = |x, y| muli(x, y);
{
let g = &mut f;
let h = g as &mut dyn OpInt;
squarei(3, h);
}
}

View file

@ -1,9 +0,0 @@
// edition:2018
async fn test() -> Result<(), Box<dyn std::error::Error>> {
macro!();
//~^ ERROR expected identifier, found `!`
Ok(())
}
fn main() {}

View file

@ -1,8 +0,0 @@
error: expected identifier, found `!`
--> $DIR/issue-77993-2.rs:4:10
|
LL | macro!();
| ^ expected identifier
error: aborting due to previous error