From 6947a772dd80161a5b1fd3be9c5aeee37f26a83e Mon Sep 17 00:00:00 2001 From: Caio Date: Mon, 28 Mar 2022 10:16:32 -0300 Subject: Remove duplicated and unused test files --- src/test/ui/auxiliary/empty-struct.rs | 9 ----- src/test/ui/auxiliary/stability-cfg2.rs | 5 --- src/test/ui/auxiliary/weak-lang-items.rs | 22 ------------ .../auxiliary/anon_trait_static_method_lib.rs | 9 ----- .../ui/cross-crate/auxiliary/newtype_struct_xc.rs | 3 -- .../ui/cross-crate/auxiliary/xcrate_unit_struct.rs | 28 ---------------- .../cross-crate/cross-crate-newtype-struct-pat.rs | 12 ------- src/test/ui/cross-crate/xcrate-unit-struct.rs | 30 ----------------- src/test/ui/empty/issue-37026.rs | 8 +++++ src/test/ui/empty/issue-37026.stderr | 19 +++++++++++ src/test/ui/empty/no-link.rs | 9 +++++ src/test/ui/issues/auxiliary/empty-struct.rs | 9 ----- src/test/ui/issues/issue-37026.rs | 8 ----- src/test/ui/issues/issue-37026.stderr | 19 ----------- src/test/ui/issues/issue-51244.rs | 4 --- src/test/ui/issues/issue-51244.stderr | 11 ------ src/test/ui/no-link.rs | 9 ----- src/test/ui/panic-handler/weak-lang-item-2.rs | 15 +++++++++ src/test/ui/regions/regions-enum-not-wf.rs | 39 ---------------------- src/test/ui/regions/regions-enum-not-wf.stderr | 28 ---------------- src/test/ui/span/E0057.rs | 6 ---- src/test/ui/span/E0057.stderr | 19 ----------- .../cross-crate-newtype-struct-pat.rs | 12 +++++++ src/test/ui/structs/suggest-private-fields.rs | 27 +++++++++++++++ src/test/ui/structs/suggest-private-fields.stderr | 29 ++++++++++++++++ .../suggestions/auxiliary/struct_field_privacy.rs | 9 ----- src/test/ui/suggestions/suggest-private-fields.rs | 27 --------------- .../ui/suggestions/suggest-private-fields.stderr | 29 ---------------- src/test/ui/weak-lang-item.rs | 15 --------- src/test/ui/xcrate/xcrate-unit-struct-2.rs | 30 +++++++++++++++++ 30 files changed, 149 insertions(+), 350 deletions(-) delete mode 100644 src/test/ui/auxiliary/empty-struct.rs delete mode 100644 src/test/ui/auxiliary/stability-cfg2.rs delete mode 100644 src/test/ui/auxiliary/weak-lang-items.rs delete mode 100644 src/test/ui/cross-crate/auxiliary/anon_trait_static_method_lib.rs delete mode 100644 src/test/ui/cross-crate/auxiliary/newtype_struct_xc.rs delete mode 100644 src/test/ui/cross-crate/auxiliary/xcrate_unit_struct.rs delete mode 100644 src/test/ui/cross-crate/cross-crate-newtype-struct-pat.rs delete mode 100644 src/test/ui/cross-crate/xcrate-unit-struct.rs create mode 100644 src/test/ui/empty/issue-37026.rs create mode 100644 src/test/ui/empty/issue-37026.stderr create mode 100644 src/test/ui/empty/no-link.rs delete mode 100644 src/test/ui/issues/auxiliary/empty-struct.rs delete mode 100644 src/test/ui/issues/issue-37026.rs delete mode 100644 src/test/ui/issues/issue-37026.stderr delete mode 100644 src/test/ui/issues/issue-51244.rs delete mode 100644 src/test/ui/issues/issue-51244.stderr delete mode 100644 src/test/ui/no-link.rs create mode 100644 src/test/ui/panic-handler/weak-lang-item-2.rs delete mode 100644 src/test/ui/regions/regions-enum-not-wf.rs delete mode 100644 src/test/ui/regions/regions-enum-not-wf.stderr delete mode 100644 src/test/ui/span/E0057.rs delete mode 100644 src/test/ui/span/E0057.stderr create mode 100644 src/test/ui/structs-enums/cross-crate-newtype-struct-pat.rs create mode 100644 src/test/ui/structs/suggest-private-fields.rs create mode 100644 src/test/ui/structs/suggest-private-fields.stderr delete mode 100644 src/test/ui/suggestions/auxiliary/struct_field_privacy.rs delete mode 100644 src/test/ui/suggestions/suggest-private-fields.rs delete mode 100644 src/test/ui/suggestions/suggest-private-fields.stderr delete mode 100644 src/test/ui/weak-lang-item.rs create mode 100644 src/test/ui/xcrate/xcrate-unit-struct-2.rs diff --git a/src/test/ui/auxiliary/empty-struct.rs b/src/test/ui/auxiliary/empty-struct.rs deleted file mode 100644 index 3fb40f6bfa9..00000000000 --- a/src/test/ui/auxiliary/empty-struct.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub struct XEmpty1 {} -pub struct XEmpty2; -pub struct XEmpty6(); - -pub enum XE { - XEmpty3 {}, - XEmpty4, - XEmpty5(), -} diff --git a/src/test/ui/auxiliary/stability-cfg2.rs b/src/test/ui/auxiliary/stability-cfg2.rs deleted file mode 100644 index c995038e5a8..00000000000 --- a/src/test/ui/auxiliary/stability-cfg2.rs +++ /dev/null @@ -1,5 +0,0 @@ -// compile-flags:--cfg foo - -#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "none"))] -#![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))] -#![feature(staged_api)] diff --git a/src/test/ui/auxiliary/weak-lang-items.rs b/src/test/ui/auxiliary/weak-lang-items.rs deleted file mode 100644 index 7a698cf76ae..00000000000 --- a/src/test/ui/auxiliary/weak-lang-items.rs +++ /dev/null @@ -1,22 +0,0 @@ -// no-prefer-dynamic - -// This aux-file will require the eh_personality function to be codegen'd, but -// it hasn't been defined just yet. Make sure we don't explode. - -#![no_std] -#![crate_type = "rlib"] - -struct A; - -impl core::ops::Drop for A { - fn drop(&mut self) {} -} - -pub fn foo() { - let _a = A; - panic!("wut"); -} - -mod std { - pub use core::{option, fmt}; -} diff --git a/src/test/ui/cross-crate/auxiliary/anon_trait_static_method_lib.rs b/src/test/ui/cross-crate/auxiliary/anon_trait_static_method_lib.rs deleted file mode 100644 index dceec7e3ec1..00000000000 --- a/src/test/ui/cross-crate/auxiliary/anon_trait_static_method_lib.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub struct Foo { - pub x: isize -} - -impl Foo { - pub fn new() -> Foo { - Foo { x: 3 } - } -} diff --git a/src/test/ui/cross-crate/auxiliary/newtype_struct_xc.rs b/src/test/ui/cross-crate/auxiliary/newtype_struct_xc.rs deleted file mode 100644 index 9d1e0742e3c..00000000000 --- a/src/test/ui/cross-crate/auxiliary/newtype_struct_xc.rs +++ /dev/null @@ -1,3 +0,0 @@ -#![crate_type="lib"] - -pub struct Au(pub isize); diff --git a/src/test/ui/cross-crate/auxiliary/xcrate_unit_struct.rs b/src/test/ui/cross-crate/auxiliary/xcrate_unit_struct.rs deleted file mode 100644 index 69ed498e7e1..00000000000 --- a/src/test/ui/cross-crate/auxiliary/xcrate_unit_struct.rs +++ /dev/null @@ -1,28 +0,0 @@ -#![crate_type = "lib"] - -// used by the rpass test - -#[derive(Copy, Clone)] -pub struct Struct; - -#[derive(Copy, Clone)] -pub enum Unit { - UnitVariant, - Argument(Struct) -} - -#[derive(Copy, Clone)] -pub struct TupleStruct(pub usize, pub &'static str); - -// used by the cfail test - -#[derive(Copy, Clone)] -pub struct StructWithFields { - foo: isize, -} - -#[derive(Copy, Clone)] -pub enum EnumWithVariants { - EnumVariant, - EnumVariantArg(isize) -} diff --git a/src/test/ui/cross-crate/cross-crate-newtype-struct-pat.rs b/src/test/ui/cross-crate/cross-crate-newtype-struct-pat.rs deleted file mode 100644 index eabffc16170..00000000000 --- a/src/test/ui/cross-crate/cross-crate-newtype-struct-pat.rs +++ /dev/null @@ -1,12 +0,0 @@ -// run-pass -// aux-build:newtype_struct_xc.rs - - -extern crate newtype_struct_xc; - -pub fn main() { - let x = newtype_struct_xc::Au(21); - match x { - newtype_struct_xc::Au(n) => assert_eq!(n, 21) - } -} diff --git a/src/test/ui/cross-crate/xcrate-unit-struct.rs b/src/test/ui/cross-crate/xcrate-unit-struct.rs deleted file mode 100644 index 7aa3eb0d6c4..00000000000 --- a/src/test/ui/cross-crate/xcrate-unit-struct.rs +++ /dev/null @@ -1,30 +0,0 @@ -// run-pass -// aux-build:xcrate_unit_struct.rs -// pretty-expanded FIXME #23616 -#![allow(non_upper_case_globals)] - -extern crate xcrate_unit_struct; - -const s1: xcrate_unit_struct::Struct = xcrate_unit_struct::Struct; -static s2: xcrate_unit_struct::Unit = xcrate_unit_struct::Unit::UnitVariant; -static s3: xcrate_unit_struct::Unit = - xcrate_unit_struct::Unit::Argument(xcrate_unit_struct::Struct); -static s4: xcrate_unit_struct::Unit = xcrate_unit_struct::Unit::Argument(s1); -static s5: xcrate_unit_struct::TupleStruct = xcrate_unit_struct::TupleStruct(20, "foo"); - -fn f1(_: xcrate_unit_struct::Struct) {} -fn f2(_: xcrate_unit_struct::Unit) {} -fn f3(_: xcrate_unit_struct::TupleStruct) {} - -pub fn main() { - f1(xcrate_unit_struct::Struct); - f2(xcrate_unit_struct::Unit::UnitVariant); - f2(xcrate_unit_struct::Unit::Argument(xcrate_unit_struct::Struct)); - f3(xcrate_unit_struct::TupleStruct(10, "bar")); - - f1(s1); - f2(s2); - f2(s3); - f2(s4); - f3(s5); -} diff --git a/src/test/ui/empty/issue-37026.rs b/src/test/ui/empty/issue-37026.rs new file mode 100644 index 00000000000..fd678a717d0 --- /dev/null +++ b/src/test/ui/empty/issue-37026.rs @@ -0,0 +1,8 @@ +// aux-build:empty-struct.rs + +extern crate empty_struct; + +fn main() { + let empty_struct::XEmpty2 = (); //~ ERROR mismatched types + let empty_struct::XEmpty6(..) = (); //~ ERROR mismatched types +} diff --git a/src/test/ui/empty/issue-37026.stderr b/src/test/ui/empty/issue-37026.stderr new file mode 100644 index 00000000000..48a4a5bcad2 --- /dev/null +++ b/src/test/ui/empty/issue-37026.stderr @@ -0,0 +1,19 @@ +error[E0308]: mismatched types + --> $DIR/issue-37026.rs:6:9 + | +LL | let empty_struct::XEmpty2 = (); + | ^^^^^^^^^^^^^^^^^^^^^ -- this expression has type `()` + | | + | expected `()`, found struct `XEmpty2` + +error[E0308]: mismatched types + --> $DIR/issue-37026.rs:7:9 + | +LL | let empty_struct::XEmpty6(..) = (); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ -- this expression has type `()` + | | + | expected `()`, found struct `XEmpty6` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/empty/no-link.rs b/src/test/ui/empty/no-link.rs new file mode 100644 index 00000000000..c80e61b4511 --- /dev/null +++ b/src/test/ui/empty/no-link.rs @@ -0,0 +1,9 @@ +// check-pass +// aux-build:empty-struct.rs + +#[no_link] +extern crate empty_struct; + +fn main() { + empty_struct::XEmpty1 {}; +} diff --git a/src/test/ui/issues/auxiliary/empty-struct.rs b/src/test/ui/issues/auxiliary/empty-struct.rs deleted file mode 100644 index 3fb40f6bfa9..00000000000 --- a/src/test/ui/issues/auxiliary/empty-struct.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub struct XEmpty1 {} -pub struct XEmpty2; -pub struct XEmpty6(); - -pub enum XE { - XEmpty3 {}, - XEmpty4, - XEmpty5(), -} diff --git a/src/test/ui/issues/issue-37026.rs b/src/test/ui/issues/issue-37026.rs deleted file mode 100644 index fd678a717d0..00000000000 --- a/src/test/ui/issues/issue-37026.rs +++ /dev/null @@ -1,8 +0,0 @@ -// aux-build:empty-struct.rs - -extern crate empty_struct; - -fn main() { - let empty_struct::XEmpty2 = (); //~ ERROR mismatched types - let empty_struct::XEmpty6(..) = (); //~ ERROR mismatched types -} diff --git a/src/test/ui/issues/issue-37026.stderr b/src/test/ui/issues/issue-37026.stderr deleted file mode 100644 index 48a4a5bcad2..00000000000 --- a/src/test/ui/issues/issue-37026.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-37026.rs:6:9 - | -LL | let empty_struct::XEmpty2 = (); - | ^^^^^^^^^^^^^^^^^^^^^ -- this expression has type `()` - | | - | expected `()`, found struct `XEmpty2` - -error[E0308]: mismatched types - --> $DIR/issue-37026.rs:7:9 - | -LL | let empty_struct::XEmpty6(..) = (); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -- this expression has type `()` - | | - | expected `()`, found struct `XEmpty6` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/issues/issue-51244.rs b/src/test/ui/issues/issue-51244.rs deleted file mode 100644 index d634b8bf800..00000000000 --- a/src/test/ui/issues/issue-51244.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - let ref my_ref @ _ = 0; - *my_ref = 0; //~ ERROR cannot assign to `*my_ref`, which is behind a `&` reference [E0594] -} diff --git a/src/test/ui/issues/issue-51244.stderr b/src/test/ui/issues/issue-51244.stderr deleted file mode 100644 index 19f0223a357..00000000000 --- a/src/test/ui/issues/issue-51244.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0594]: cannot assign to `*my_ref`, which is behind a `&` reference - --> $DIR/issue-51244.rs:3:5 - | -LL | let ref my_ref @ _ = 0; - | -------------- help: consider changing this to be a mutable reference: `ref mut my_ref @ _` -LL | *my_ref = 0; - | ^^^^^^^^^^^ `my_ref` is a `&` reference, so the data it refers to cannot be written - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/no-link.rs b/src/test/ui/no-link.rs deleted file mode 100644 index c80e61b4511..00000000000 --- a/src/test/ui/no-link.rs +++ /dev/null @@ -1,9 +0,0 @@ -// check-pass -// aux-build:empty-struct.rs - -#[no_link] -extern crate empty_struct; - -fn main() { - empty_struct::XEmpty1 {}; -} diff --git a/src/test/ui/panic-handler/weak-lang-item-2.rs b/src/test/ui/panic-handler/weak-lang-item-2.rs new file mode 100644 index 00000000000..a429d8fabc7 --- /dev/null +++ b/src/test/ui/panic-handler/weak-lang-item-2.rs @@ -0,0 +1,15 @@ +// run-pass +// aux-build:weak-lang-items.rs + +// ignore-emscripten no threads support +// pretty-expanded FIXME #23616 + +extern crate weak_lang_items as other; + +use std::thread; + +fn main() { + let _ = thread::spawn(move|| { + other::foo() + }); +} diff --git a/src/test/ui/regions/regions-enum-not-wf.rs b/src/test/ui/regions/regions-enum-not-wf.rs deleted file mode 100644 index 8b491ee4e30..00000000000 --- a/src/test/ui/regions/regions-enum-not-wf.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Various examples of structs whose fields are not well-formed. - -#![allow(dead_code)] - -trait Dummy<'a> { - type Out; -} -impl<'a, T> Dummy<'a> for T -where - T: 'a, -{ - type Out = (); -} -type RequireOutlives<'a, T> = >::Out; - -enum Ref1<'a, T> { - Ref1Variant1(RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough -} - -enum Ref2<'a, T> { - Ref2Variant1, - Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough -} - -enum RefOk<'a, T: 'a> { - RefOkVariant1(&'a T), -} - -// This is now well formed. RFC 2093 -enum RefIndirect<'a, T> { - RefIndirectVariant1(isize, RefOk<'a, T>), -} - -enum RefDouble<'a, 'b, T> { - RefDoubleVariant1(&'a RequireOutlives<'b, T>), - //~^ the parameter type `T` may not live long enough [E0309] -} - -fn main() {} diff --git a/src/test/ui/regions/regions-enum-not-wf.stderr b/src/test/ui/regions/regions-enum-not-wf.stderr deleted file mode 100644 index 553a3e71c16..00000000000 --- a/src/test/ui/regions/regions-enum-not-wf.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-enum-not-wf.rs:17:18 - | -LL | enum Ref1<'a, T> { - | - help: consider adding an explicit lifetime bound...: `T: 'a` -LL | Ref1Variant1(RequireOutlives<'a, T>), - | ^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-enum-not-wf.rs:22:25 - | -LL | enum Ref2<'a, T> { - | - help: consider adding an explicit lifetime bound...: `T: 'a` -LL | Ref2Variant1, -LL | Ref2Variant2(isize, RequireOutlives<'a, T>), - | ^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/regions-enum-not-wf.rs:35:23 - | -LL | enum RefDouble<'a, 'b, T> { - | - help: consider adding an explicit lifetime bound...: `T: 'b` -LL | RefDoubleVariant1(&'a RequireOutlives<'b, T>), - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/span/E0057.rs b/src/test/ui/span/E0057.rs deleted file mode 100644 index 83f941f65b9..00000000000 --- a/src/test/ui/span/E0057.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn main() { - let f = |x| x * 3; - let a = f(); //~ ERROR E0057 - let b = f(4); - let c = f(2, 3); //~ ERROR E0057 -} diff --git a/src/test/ui/span/E0057.stderr b/src/test/ui/span/E0057.stderr deleted file mode 100644 index 31579e28289..00000000000 --- a/src/test/ui/span/E0057.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0057]: this function takes 1 argument but 0 arguments were supplied - --> $DIR/E0057.rs:3:13 - | -LL | let a = f(); - | ^-- supplied 0 arguments - | | - | expected 1 argument - -error[E0057]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/E0057.rs:5:13 - | -LL | let c = f(2, 3); - | ^ - - supplied 2 arguments - | | - | expected 1 argument - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0057`. diff --git a/src/test/ui/structs-enums/cross-crate-newtype-struct-pat.rs b/src/test/ui/structs-enums/cross-crate-newtype-struct-pat.rs new file mode 100644 index 00000000000..eabffc16170 --- /dev/null +++ b/src/test/ui/structs-enums/cross-crate-newtype-struct-pat.rs @@ -0,0 +1,12 @@ +// run-pass +// aux-build:newtype_struct_xc.rs + + +extern crate newtype_struct_xc; + +pub fn main() { + let x = newtype_struct_xc::Au(21); + match x { + newtype_struct_xc::Au(n) => assert_eq!(n, 21) + } +} diff --git a/src/test/ui/structs/suggest-private-fields.rs b/src/test/ui/structs/suggest-private-fields.rs new file mode 100644 index 00000000000..8267a82fe2a --- /dev/null +++ b/src/test/ui/structs/suggest-private-fields.rs @@ -0,0 +1,27 @@ +// aux-build:struct_field_privacy.rs + +extern crate struct_field_privacy as xc; + +use xc::B; + +struct A { + pub a: u32, + b: u32, +} + +fn main () { + // external crate struct + let k = B { + aa: 20, + //~^ ERROR struct `B` has no field named `aa` + bb: 20, + //~^ ERROR struct `B` has no field named `bb` + }; + // local crate struct + let l = A { + aa: 20, + //~^ ERROR struct `A` has no field named `aa` + bb: 20, + //~^ ERROR struct `A` has no field named `bb` + }; +} diff --git a/src/test/ui/structs/suggest-private-fields.stderr b/src/test/ui/structs/suggest-private-fields.stderr new file mode 100644 index 00000000000..d628bd16208 --- /dev/null +++ b/src/test/ui/structs/suggest-private-fields.stderr @@ -0,0 +1,29 @@ +error[E0560]: struct `B` has no field named `aa` + --> $DIR/suggest-private-fields.rs:15:9 + | +LL | aa: 20, + | ^^ help: a field with a similar name exists: `a` + +error[E0560]: struct `B` has no field named `bb` + --> $DIR/suggest-private-fields.rs:17:9 + | +LL | bb: 20, + | ^^ `B` does not have this field + | + = note: available fields are: `a` + +error[E0560]: struct `A` has no field named `aa` + --> $DIR/suggest-private-fields.rs:22:9 + | +LL | aa: 20, + | ^^ help: a field with a similar name exists: `a` + +error[E0560]: struct `A` has no field named `bb` + --> $DIR/suggest-private-fields.rs:24:9 + | +LL | bb: 20, + | ^^ help: a field with a similar name exists: `b` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0560`. diff --git a/src/test/ui/suggestions/auxiliary/struct_field_privacy.rs b/src/test/ui/suggestions/auxiliary/struct_field_privacy.rs deleted file mode 100644 index 9765af1a7f6..00000000000 --- a/src/test/ui/suggestions/auxiliary/struct_field_privacy.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub struct A { - a: isize, - pub b: isize, -} - -pub struct B { - pub a: isize, - b: isize, -} diff --git a/src/test/ui/suggestions/suggest-private-fields.rs b/src/test/ui/suggestions/suggest-private-fields.rs deleted file mode 100644 index 8267a82fe2a..00000000000 --- a/src/test/ui/suggestions/suggest-private-fields.rs +++ /dev/null @@ -1,27 +0,0 @@ -// aux-build:struct_field_privacy.rs - -extern crate struct_field_privacy as xc; - -use xc::B; - -struct A { - pub a: u32, - b: u32, -} - -fn main () { - // external crate struct - let k = B { - aa: 20, - //~^ ERROR struct `B` has no field named `aa` - bb: 20, - //~^ ERROR struct `B` has no field named `bb` - }; - // local crate struct - let l = A { - aa: 20, - //~^ ERROR struct `A` has no field named `aa` - bb: 20, - //~^ ERROR struct `A` has no field named `bb` - }; -} diff --git a/src/test/ui/suggestions/suggest-private-fields.stderr b/src/test/ui/suggestions/suggest-private-fields.stderr deleted file mode 100644 index d628bd16208..00000000000 --- a/src/test/ui/suggestions/suggest-private-fields.stderr +++ /dev/null @@ -1,29 +0,0 @@ -error[E0560]: struct `B` has no field named `aa` - --> $DIR/suggest-private-fields.rs:15:9 - | -LL | aa: 20, - | ^^ help: a field with a similar name exists: `a` - -error[E0560]: struct `B` has no field named `bb` - --> $DIR/suggest-private-fields.rs:17:9 - | -LL | bb: 20, - | ^^ `B` does not have this field - | - = note: available fields are: `a` - -error[E0560]: struct `A` has no field named `aa` - --> $DIR/suggest-private-fields.rs:22:9 - | -LL | aa: 20, - | ^^ help: a field with a similar name exists: `a` - -error[E0560]: struct `A` has no field named `bb` - --> $DIR/suggest-private-fields.rs:24:9 - | -LL | bb: 20, - | ^^ help: a field with a similar name exists: `b` - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0560`. diff --git a/src/test/ui/weak-lang-item.rs b/src/test/ui/weak-lang-item.rs deleted file mode 100644 index a429d8fabc7..00000000000 --- a/src/test/ui/weak-lang-item.rs +++ /dev/null @@ -1,15 +0,0 @@ -// run-pass -// aux-build:weak-lang-items.rs - -// ignore-emscripten no threads support -// pretty-expanded FIXME #23616 - -extern crate weak_lang_items as other; - -use std::thread; - -fn main() { - let _ = thread::spawn(move|| { - other::foo() - }); -} diff --git a/src/test/ui/xcrate/xcrate-unit-struct-2.rs b/src/test/ui/xcrate/xcrate-unit-struct-2.rs new file mode 100644 index 00000000000..7aa3eb0d6c4 --- /dev/null +++ b/src/test/ui/xcrate/xcrate-unit-struct-2.rs @@ -0,0 +1,30 @@ +// run-pass +// aux-build:xcrate_unit_struct.rs +// pretty-expanded FIXME #23616 +#![allow(non_upper_case_globals)] + +extern crate xcrate_unit_struct; + +const s1: xcrate_unit_struct::Struct = xcrate_unit_struct::Struct; +static s2: xcrate_unit_struct::Unit = xcrate_unit_struct::Unit::UnitVariant; +static s3: xcrate_unit_struct::Unit = + xcrate_unit_struct::Unit::Argument(xcrate_unit_struct::Struct); +static s4: xcrate_unit_struct::Unit = xcrate_unit_struct::Unit::Argument(s1); +static s5: xcrate_unit_struct::TupleStruct = xcrate_unit_struct::TupleStruct(20, "foo"); + +fn f1(_: xcrate_unit_struct::Struct) {} +fn f2(_: xcrate_unit_struct::Unit) {} +fn f3(_: xcrate_unit_struct::TupleStruct) {} + +pub fn main() { + f1(xcrate_unit_struct::Struct); + f2(xcrate_unit_struct::Unit::UnitVariant); + f2(xcrate_unit_struct::Unit::Argument(xcrate_unit_struct::Struct)); + f3(xcrate_unit_struct::TupleStruct(10, "bar")); + + f1(s1); + f2(s2); + f2(s3); + f2(s4); + f3(s5); +} -- cgit 1.4.1-3-g733a5