diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
commit | a4b7ed7a42c716ab9f05e351f003d589124fd55d (patch) | |
tree | b620cd3f223850b28716e474e80c58059dca5dd4 /src/test/ui/missing | |
parent | Adding upstream version 1.67.1+dfsg1. (diff) | |
download | rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip |
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/missing')
29 files changed, 0 insertions, 461 deletions
diff --git a/src/test/ui/missing/auxiliary/two_macros.rs b/src/test/ui/missing/auxiliary/two_macros.rs deleted file mode 100644 index 2330c75c8..000000000 --- a/src/test/ui/missing/auxiliary/two_macros.rs +++ /dev/null @@ -1,5 +0,0 @@ -#[macro_export] -macro_rules! macro_one { () => ("one") } - -#[macro_export] -macro_rules! macro_two { () => ("two") } diff --git a/src/test/ui/missing/missing-alloc_error_handler.rs b/src/test/ui/missing/missing-alloc_error_handler.rs deleted file mode 100644 index 4d378f010..000000000 --- a/src/test/ui/missing/missing-alloc_error_handler.rs +++ /dev/null @@ -1,23 +0,0 @@ -// compile-flags: -C panic=abort -// no-prefer-dynamic - -#![no_std] -#![crate_type = "staticlib"] -#![feature(alloc_error_handler)] - -#[panic_handler] -fn panic(_: &core::panic::PanicInfo) -> ! { - loop {} -} - -extern crate alloc; - -#[global_allocator] -static A: MyAlloc = MyAlloc; - -struct MyAlloc; - -unsafe impl core::alloc::GlobalAlloc for MyAlloc { - unsafe fn alloc(&self, _: core::alloc::Layout) -> *mut u8 { 0 as _ } - unsafe fn dealloc(&self, _: *mut u8, _: core::alloc::Layout) {} -} diff --git a/src/test/ui/missing/missing-alloc_error_handler.stderr b/src/test/ui/missing/missing-alloc_error_handler.stderr deleted file mode 100644 index 995fa7cf8..000000000 --- a/src/test/ui/missing/missing-alloc_error_handler.stderr +++ /dev/null @@ -1,6 +0,0 @@ -error: `#[alloc_error_handler]` function required, but not found - -note: use `#![feature(default_alloc_error_handler)]` for a default error handler - -error: aborting due to previous error - diff --git a/src/test/ui/missing/missing-allocator.rs b/src/test/ui/missing/missing-allocator.rs deleted file mode 100644 index 2dc509f2c..000000000 --- a/src/test/ui/missing/missing-allocator.rs +++ /dev/null @@ -1,18 +0,0 @@ -// compile-flags: -C panic=abort -// no-prefer-dynamic - -#![no_std] -#![crate_type = "staticlib"] -#![feature(alloc_error_handler)] - -#[panic_handler] -fn panic(_: &core::panic::PanicInfo) -> ! { - loop {} -} - -#[alloc_error_handler] -fn oom(_: core::alloc::Layout) -> ! { - loop {} -} - -extern crate alloc; diff --git a/src/test/ui/missing/missing-allocator.stderr b/src/test/ui/missing/missing-allocator.stderr deleted file mode 100644 index 0da5651c1..000000000 --- a/src/test/ui/missing/missing-allocator.stderr +++ /dev/null @@ -1,4 +0,0 @@ -error: no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait - -error: aborting due to previous error - diff --git a/src/test/ui/missing/missing-block-hint.rs b/src/test/ui/missing/missing-block-hint.rs deleted file mode 100644 index 89db02a9c..000000000 --- a/src/test/ui/missing/missing-block-hint.rs +++ /dev/null @@ -1,9 +0,0 @@ -fn main() { - { - if (foo) => {} //~ ERROR expected `{`, found `=>` - } - { - if (foo) - bar; //~ ERROR expected `{`, found `bar` - } -} diff --git a/src/test/ui/missing/missing-block-hint.stderr b/src/test/ui/missing/missing-block-hint.stderr deleted file mode 100644 index 16954223a..000000000 --- a/src/test/ui/missing/missing-block-hint.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error: expected `{`, found `=>` - --> $DIR/missing-block-hint.rs:3:18 - | -LL | if (foo) => {} - | ^^ expected `{` - | -note: the `if` expression is missing a block after this condition - --> $DIR/missing-block-hint.rs:3:12 - | -LL | if (foo) => {} - | ^^^^^ - -error: expected `{`, found `bar` - --> $DIR/missing-block-hint.rs:7:13 - | -LL | bar; - | ^^^ expected `{` - | -note: the `if` expression is missing a block after this condition - --> $DIR/missing-block-hint.rs:6:12 - | -LL | if (foo) - | ^^^^^ -help: try placing this code inside a block - | -LL | { bar; } - | + + - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/missing/missing-comma-in-match.fixed b/src/test/ui/missing/missing-comma-in-match.fixed deleted file mode 100644 index f091082f3..000000000 --- a/src/test/ui/missing/missing-comma-in-match.fixed +++ /dev/null @@ -1,11 +0,0 @@ -// run-rustfix - -fn main() { - match &Some(3) { - &None => 1, - &Some(2) => { 3 } - //~^ ERROR expected one of `,`, `.`, `?`, `}`, or an operator, found `=>` - //~| NOTE expected one of `,`, `.`, `?`, `}`, or an operator - _ => 2 - }; -} diff --git a/src/test/ui/missing/missing-comma-in-match.rs b/src/test/ui/missing/missing-comma-in-match.rs deleted file mode 100644 index 54dab4e97..000000000 --- a/src/test/ui/missing/missing-comma-in-match.rs +++ /dev/null @@ -1,11 +0,0 @@ -// run-rustfix - -fn main() { - match &Some(3) { - &None => 1 - &Some(2) => { 3 } - //~^ ERROR expected one of `,`, `.`, `?`, `}`, or an operator, found `=>` - //~| NOTE expected one of `,`, `.`, `?`, `}`, or an operator - _ => 2 - }; -} diff --git a/src/test/ui/missing/missing-comma-in-match.stderr b/src/test/ui/missing/missing-comma-in-match.stderr deleted file mode 100644 index fe210f697..000000000 --- a/src/test/ui/missing/missing-comma-in-match.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: expected one of `,`, `.`, `?`, `}`, or an operator, found `=>` - --> $DIR/missing-comma-in-match.rs:6:18 - | -LL | &None => 1 - | - help: missing a comma here to end this `match` arm -LL | &Some(2) => { 3 } - | ^^ expected one of `,`, `.`, `?`, `}`, or an operator - -error: aborting due to previous error - diff --git a/src/test/ui/missing/missing-derivable-attr.rs b/src/test/ui/missing/missing-derivable-attr.rs deleted file mode 100644 index 58c94de50..000000000 --- a/src/test/ui/missing/missing-derivable-attr.rs +++ /dev/null @@ -1,16 +0,0 @@ -trait MyEq { - fn eq(&self, other: &Self) -> bool; -} - -struct A { - x: isize -} - -impl MyEq for isize { - fn eq(&self, other: &isize) -> bool { *self == *other } -} - -impl MyEq for A {} //~ ERROR not all trait items implemented, missing: `eq` - -fn main() { -} diff --git a/src/test/ui/missing/missing-derivable-attr.stderr b/src/test/ui/missing/missing-derivable-attr.stderr deleted file mode 100644 index 9b8c0c583..000000000 --- a/src/test/ui/missing/missing-derivable-attr.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0046]: not all trait items implemented, missing: `eq` - --> $DIR/missing-derivable-attr.rs:13:1 - | -LL | fn eq(&self, other: &Self) -> bool; - | ----------------------------------- `eq` from trait -... -LL | impl MyEq for A {} - | ^^^^^^^^^^^^^^^ missing `eq` in implementation - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0046`. diff --git a/src/test/ui/missing/missing-fields-in-struct-pattern.rs b/src/test/ui/missing/missing-fields-in-struct-pattern.rs deleted file mode 100644 index 40304a674..000000000 --- a/src/test/ui/missing/missing-fields-in-struct-pattern.rs +++ /dev/null @@ -1,8 +0,0 @@ -struct S(usize, usize, usize, usize); - -fn main() { - if let S { a, b, c, d } = S(1, 2, 3, 4) { - //~^ ERROR tuple variant `S` written as struct variant - println!("hi"); - } -} diff --git a/src/test/ui/missing/missing-fields-in-struct-pattern.stderr b/src/test/ui/missing/missing-fields-in-struct-pattern.stderr deleted file mode 100644 index 1fe9f5299..000000000 --- a/src/test/ui/missing/missing-fields-in-struct-pattern.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0769]: tuple variant `S` written as struct variant - --> $DIR/missing-fields-in-struct-pattern.rs:4:12 - | -LL | if let S { a, b, c, d } = S(1, 2, 3, 4) { - | ^^^^^^^^^^^^^^^^ - | -help: use the tuple variant pattern syntax instead - | -LL | if let S(a, b, c, d) = S(1, 2, 3, 4) { - | ~~~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0769`. diff --git a/src/test/ui/missing/missing-items/auxiliary/m1.rs b/src/test/ui/missing/missing-items/auxiliary/m1.rs deleted file mode 100644 index fcf52c9e8..000000000 --- a/src/test/ui/missing/missing-items/auxiliary/m1.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub trait X { - const CONSTANT: u32; - type Type; - fn method(&self, s: String) -> Self::Type; - fn method2(self: Box<Self>, s: String) -> Self::Type; - fn method3(other: &Self, s: String) -> Self::Type; - fn method4(&self, other: &Self) -> Self::Type; - fn method5(self: &Box<Self>) -> Self::Type; -} diff --git a/src/test/ui/missing/missing-items/m2.rs b/src/test/ui/missing/missing-items/m2.rs deleted file mode 100644 index c2a6914ab..000000000 --- a/src/test/ui/missing/missing-items/m2.rs +++ /dev/null @@ -1,12 +0,0 @@ -// aux-build:m1.rs - - -extern crate m1; - -struct X { -} - -impl m1::X for X { //~ ERROR not all trait items implemented -} - -fn main() {} diff --git a/src/test/ui/missing/missing-items/m2.stderr b/src/test/ui/missing/missing-items/m2.stderr deleted file mode 100644 index d18fb443a..000000000 --- a/src/test/ui/missing/missing-items/m2.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0046]: not all trait items implemented, missing: `CONSTANT`, `Type`, `method`, `method2`, `method3`, `method4`, `method5` - --> $DIR/m2.rs:9:1 - | -LL | impl m1::X for X { - | ^^^^^^^^^^^^^^^^ missing `CONSTANT`, `Type`, `method`, `method2`, `method3`, `method4`, `method5` in implementation - | - = help: implement the missing item: `const CONSTANT: u32 = 42;` - = help: implement the missing item: `type Type = Type;` - = help: implement the missing item: `fn method(&self, _: String) -> <Self as m1::X>::Type { todo!() }` - = help: implement the missing item: `fn method2(self: Box<Self>, _: String) -> <Self as m1::X>::Type { todo!() }` - = help: implement the missing item: `fn method3(_: &Self, _: String) -> <Self as m1::X>::Type { todo!() }` - = help: implement the missing item: `fn method4(&self, _: &Self) -> <Self as m1::X>::Type { todo!() }` - = help: implement the missing item: `fn method5(self: &Box<Self>) -> <Self as m1::X>::Type { todo!() }` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0046`. diff --git a/src/test/ui/missing/missing-items/missing-type-parameter.rs b/src/test/ui/missing/missing-items/missing-type-parameter.rs deleted file mode 100644 index 8a64053a4..000000000 --- a/src/test/ui/missing/missing-items/missing-type-parameter.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn foo<X>() { } - -fn main() { - foo(); //~ ERROR type annotations needed -} diff --git a/src/test/ui/missing/missing-items/missing-type-parameter.stderr b/src/test/ui/missing/missing-items/missing-type-parameter.stderr deleted file mode 100644 index 722539fca..000000000 --- a/src/test/ui/missing/missing-items/missing-type-parameter.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/missing-type-parameter.rs:4:5 - | -LL | foo(); - | ^^^ cannot infer type of the type parameter `X` declared on the function `foo` - | -help: consider specifying the generic argument - | -LL | foo::<X>(); - | +++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/ui/missing/missing-items/missing-type-parameter2.rs b/src/test/ui/missing/missing-items/missing-type-parameter2.rs deleted file mode 100644 index e9b32fb71..000000000 --- a/src/test/ui/missing/missing-items/missing-type-parameter2.rs +++ /dev/null @@ -1,19 +0,0 @@ -struct X<const N: u8>(); - -impl X<N> {} -//~^ ERROR cannot find type `N` in this scope -//~| ERROR unresolved item provided when a constant was expected -impl<T, const A: u8 = 2> X<N> {} -//~^ ERROR cannot find type `N` in this scope -//~| ERROR defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions -//~| ERROR unresolved item provided when a constant was expected - -fn foo(_: T) where T: Send {} -//~^ ERROR cannot find type `T` in this scope -//~| ERROR cannot find type `T` in this scope - -fn bar<const N: u8>(_: A) {} -//~^ ERROR cannot find type `A` in this scope - -fn main() { -} diff --git a/src/test/ui/missing/missing-items/missing-type-parameter2.stderr b/src/test/ui/missing/missing-items/missing-type-parameter2.stderr deleted file mode 100644 index f33951c98..000000000 --- a/src/test/ui/missing/missing-items/missing-type-parameter2.stderr +++ /dev/null @@ -1,121 +0,0 @@ -error[E0412]: cannot find type `N` in this scope - --> $DIR/missing-type-parameter2.rs:3:8 - | -LL | struct X<const N: u8>(); - | ------------------------ similarly named struct `X` defined here -LL | -LL | impl X<N> {} - | ^ - | -help: a struct with a similar name exists - | -LL | impl X<X> {} - | ~ -help: you might be missing a type parameter - | -LL | impl<N> X<N> {} - | +++ - -error[E0412]: cannot find type `N` in this scope - --> $DIR/missing-type-parameter2.rs:6:28 - | -LL | impl<T, const A: u8 = 2> X<N> {} - | - ^ - | | - | similarly named type parameter `T` defined here - | -help: a type parameter with a similar name exists - | -LL | impl<T, const A: u8 = 2> X<T> {} - | ~ -help: you might be missing a type parameter - | -LL | impl<T, const A: u8 = 2, N> X<N> {} - | +++ - -error[E0412]: cannot find type `T` in this scope - --> $DIR/missing-type-parameter2.rs:11:20 - | -LL | struct X<const N: u8>(); - | ------------------------ similarly named struct `X` defined here -... -LL | fn foo(_: T) where T: Send {} - | ^ - | -help: a struct with a similar name exists - | -LL | fn foo(_: T) where X: Send {} - | ~ -help: you might be missing a type parameter - | -LL | fn foo<T>(_: T) where T: Send {} - | +++ - -error[E0412]: cannot find type `T` in this scope - --> $DIR/missing-type-parameter2.rs:11:11 - | -LL | struct X<const N: u8>(); - | ------------------------ similarly named struct `X` defined here -... -LL | fn foo(_: T) where T: Send {} - | ^ - | -help: a struct with a similar name exists - | -LL | fn foo(_: X) where T: Send {} - | ~ -help: you might be missing a type parameter - | -LL | fn foo<T>(_: T) where T: Send {} - | +++ - -error[E0412]: cannot find type `A` in this scope - --> $DIR/missing-type-parameter2.rs:15:24 - | -LL | struct X<const N: u8>(); - | ------------------------ similarly named struct `X` defined here -... -LL | fn bar<const N: u8>(_: A) {} - | ^ - | -help: a struct with a similar name exists - | -LL | fn bar<const N: u8>(_: X) {} - | ~ -help: you might be missing a type parameter - | -LL | fn bar<const N: u8, A>(_: A) {} - | +++ - -error[E0747]: unresolved item provided when a constant was expected - --> $DIR/missing-type-parameter2.rs:3:8 - | -LL | impl X<N> {} - | ^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | impl X<{ N }> {} - | + + - -error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions - --> $DIR/missing-type-parameter2.rs:6:9 - | -LL | impl<T, const A: u8 = 2> X<N> {} - | ^^^^^^^^^^^^^^^ - -error[E0747]: unresolved item provided when a constant was expected - --> $DIR/missing-type-parameter2.rs:6:28 - | -LL | impl<T, const A: u8 = 2> X<N> {} - | ^ - | -help: if this generic argument was intended as a const parameter, surround it with braces - | -LL | impl<T, const A: u8 = 2> X<{ N }> {} - | + + - -error: aborting due to 8 previous errors - -Some errors have detailed explanations: E0412, E0747. -For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/ui/missing/missing-macro-use.rs b/src/test/ui/missing/missing-macro-use.rs deleted file mode 100644 index d494c4471..000000000 --- a/src/test/ui/missing/missing-macro-use.rs +++ /dev/null @@ -1,8 +0,0 @@ -// aux-build:two_macros.rs - -extern crate two_macros; - -pub fn main() { - macro_two!(); - //~^ ERROR cannot find macro `macro_two` in this scope -} diff --git a/src/test/ui/missing/missing-macro-use.stderr b/src/test/ui/missing/missing-macro-use.stderr deleted file mode 100644 index ced062269..000000000 --- a/src/test/ui/missing/missing-macro-use.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: cannot find macro `macro_two` in this scope - --> $DIR/missing-macro-use.rs:6:5 - | -LL | macro_two!(); - | ^^^^^^^^^ - | - = note: consider importing this macro: - two_macros::macro_two - -error: aborting due to previous error - diff --git a/src/test/ui/missing/missing-main.rs b/src/test/ui/missing/missing-main.rs deleted file mode 100644 index 6ad544533..000000000 --- a/src/test/ui/missing/missing-main.rs +++ /dev/null @@ -1,2 +0,0 @@ -// error-pattern: `main` function not found -fn mian() { } diff --git a/src/test/ui/missing/missing-main.stderr b/src/test/ui/missing/missing-main.stderr deleted file mode 100644 index 5113dc6ec..000000000 --- a/src/test/ui/missing/missing-main.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0601]: `main` function not found in crate `missing_main` - --> $DIR/missing-main.rs:2:14 - | -LL | fn mian() { } - | ^ consider adding a `main` function to `$DIR/missing-main.rs` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/ui/missing/missing-return.rs b/src/test/ui/missing/missing-return.rs deleted file mode 100644 index 6a171753d..000000000 --- a/src/test/ui/missing/missing-return.rs +++ /dev/null @@ -1,5 +0,0 @@ -// error-pattern: return - -fn f() -> isize { } - -fn main() { f(); } diff --git a/src/test/ui/missing/missing-return.stderr b/src/test/ui/missing/missing-return.stderr deleted file mode 100644 index ff7f261e0..000000000 --- a/src/test/ui/missing/missing-return.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/missing-return.rs:3:11 - | -LL | fn f() -> isize { } - | - ^^^^^ expected `isize`, found `()` - | | - | implicitly returns `()` as its body has no tail or `return` expression - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/missing/missing-stability.rs b/src/test/ui/missing/missing-stability.rs deleted file mode 100644 index 0da5808b4..000000000 --- a/src/test/ui/missing/missing-stability.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Checks that exported items without stability attributes cause an error - -#![crate_type="lib"] -#![feature(staged_api)] - -#![stable(feature = "stable_test_feature", since = "1.0.0")] - -pub fn unmarked() { - //~^ ERROR function has missing stability attribute - () -} - -#[unstable(feature = "unstable_test_feature", issue = "none")] -pub mod foo { - // #[unstable] is inherited - pub fn unmarked() {} -} - -#[stable(feature = "stable_test_feature", since="1.0.0")] -pub mod bar { - // #[stable] is not inherited - pub fn unmarked() {} - //~^ ERROR function has missing stability attribute -} diff --git a/src/test/ui/missing/missing-stability.stderr b/src/test/ui/missing/missing-stability.stderr deleted file mode 100644 index 659f8c78c..000000000 --- a/src/test/ui/missing/missing-stability.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error: function has missing stability attribute - --> $DIR/missing-stability.rs:8:1 - | -LL | / pub fn unmarked() { -LL | | -LL | | () -LL | | } - | |_^ - -error: function has missing stability attribute - --> $DIR/missing-stability.rs:22:5 - | -LL | pub fn unmarked() {} - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - |