Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure is not an option #62113

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ build/
# Output for all compiletest-based test suites
test/
run-pass/
compile-fail/
debuginfo/
...

Expand Down
1 change: 0 additions & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ impl<'a> Builder<'a> {
test::Tidy,
test::Ui,
test::RunPass,
test::CompileFail,
test::RunFail,
test::RunPassValgrind,
test::MirOpt,
Expand Down
6 changes: 0 additions & 6 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,12 +828,6 @@ default_test_with_compare_mode!(RunPass {
compare_mode: "nll"
});

default_test!(CompileFail {
path: "src/test/compile-fail",
mode: "compile-fail",
suite: "compile-fail"
});

default_test!(RunFail {
path: "src/test/run-fail",
mode: "run-fail",
Expand Down
15 changes: 0 additions & 15 deletions src/test/compile-fail/auxiliary/panic-runtime-lang-items.rs

This file was deleted.

17 changes: 0 additions & 17 deletions src/test/compile-fail/auxiliary/panic-runtime-unwind.rs

This file was deleted.

17 changes: 0 additions & 17 deletions src/test/compile-fail/auxiliary/panic-runtime-unwind2.rs

This file was deleted.

11 changes: 0 additions & 11 deletions src/test/compile-fail/auxiliary/some-panic-impl.rs

This file was deleted.

6 changes: 0 additions & 6 deletions src/test/compile-fail/auxiliary/wants-panic-runtime-unwind.rs

This file was deleted.

File renamed without changes.
11 changes: 11 additions & 0 deletions src/test/ui/asm/asm-src-loc.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error: <inline asm>:1:2: error: invalid instruction mnemonic 'nowayisthisavalidinstruction'
nowayisthisavalidinstruction
^~~~~~~~~~~~~~~~~~~~~~~~~~~~

--> $DIR/asm-src-loc.rs:7:9
|
LL | asm!("nowayisthisavalidinstruction");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

18 changes: 18 additions & 0 deletions src/test/ui/associated-types/issue-23595-1.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
error[E0191]: the value of the associated types `Value` (from the trait `Hierarchy`), `ChildKey` (from the trait `Hierarchy`), `Children` (from the trait `Hierarchy`) must be specified
--> $DIR/issue-23595-1.rs:8:54
|
LL | type Value;
| ----------- `Value` defined here
LL | type ChildKey;
| -------------- `ChildKey` defined here
LL | type Children = dyn Index<Self::ChildKey, Output=dyn Hierarchy>;
| -------------------------------------------------^^^^^^^^^^^^^--
| | |
| | associated type `Value` must be specified
| | associated type `ChildKey` must be specified
| | associated type `Children` must be specified
| `Children` defined here

error: aborting due to previous error

For more information about this error, try `rustc --explain E0191`.
15 changes: 15 additions & 0 deletions src/test/ui/chalkify/chalk_initial_program.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error[E0277]: the trait bound `f32: Foo` is not satisfied
--> $DIR/chalk_initial_program.rs:15:5
|
LL | gimme::<f32>();
| ^^^^^^^^^^^^ the trait `Foo` is not implemented for `f32`
|
note: required by `gimme`
--> $DIR/chalk_initial_program.rs:9:1
|
LL | fn gimme<F: Foo>() { }
| ^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
31 changes: 31 additions & 0 deletions src/test/ui/chalkify/generic_impls.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
error[E0277]: the trait bound `(std::option::Option<T>, f32): Foo` is not satisfied
--> $DIR/generic_impls.rs:12:5
|
LL | gimme::<(Option<T>, f32)>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `(std::option::Option<T>, f32)`
|
= help: the following implementations were found:
<(T, u32) as Foo>
note: required by `gimme`
--> $DIR/generic_impls.rs:7:1
|
LL | fn gimme<F: Foo>() { }
| ^^^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `(i32, f32): Foo` is not satisfied
--> $DIR/generic_impls.rs:17:5
|
LL | gimme::<(i32, f32)>();
| ^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `(i32, f32)`
|
= help: the following implementations were found:
<(T, u32) as Foo>
note: required by `gimme`
--> $DIR/generic_impls.rs:7:1
|
LL | fn gimme<F: Foo>() { }
| ^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0277`.
35 changes: 35 additions & 0 deletions src/test/ui/chalkify/impl_wf.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/impl_wf.rs:11:6
|
LL | impl Foo for str { }
| ^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
note: required by `Foo`
--> $DIR/impl_wf.rs:3:1
|
LL | trait Foo: Sized { }
| ^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `f32: Foo` is not satisfied
--> $DIR/impl_wf.rs:25:6
|
LL | impl Bar for f32 {
| ^^^ the trait `Foo` is not implemented for `f32`

error[E0277]: the trait bound `f32: Foo` is not satisfied
--> $DIR/impl_wf.rs:34:6
|
LL | impl Baz<f32> for f32 { }
| ^^^^^^^^ the trait `Foo` is not implemented for `f32`
|
note: required by `Baz`
--> $DIR/impl_wf.rs:30:1
|
LL | trait Baz<U: ?Sized> where U: Foo { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0277`.
14 changes: 14 additions & 0 deletions src/test/ui/chalkify/recursive_where_clause_on_type.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error: the type `S` is not well-formed (chalk)
--> $DIR/recursive_where_clause_on_type.rs:26:5
|
LL | foo::<S>()
| ^^^^^^^^

error: the type `S` is not well-formed (chalk)
--> $DIR/recursive_where_clause_on_type.rs:26:11
|
LL | foo::<S>()
| ^

error: aborting due to 2 previous errors

18 changes: 18 additions & 0 deletions src/test/ui/chalkify/type_wf.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
error[E0277]: the trait bound `{float}: Foo` is not satisfied
--> $DIR/type_wf.rs:17:13
|
LL | let s = S {
| ^ the trait `Foo` is not implemented for `{float}`
|
= help: the following implementations were found:
<i32 as Foo>
<std::option::Option<T> as Foo>
note: required by `S`
--> $DIR/type_wf.rs:5:1
|
LL | struct S<T: Foo> {
| ^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
11 changes: 11 additions & 0 deletions src/test/ui/coercion/coerce-unsafe-closure-to-unsafe-fn-ptr.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
--> $DIR/coerce-unsafe-closure-to-unsafe-fn-ptr.rs:2:31
|
LL | let _: unsafe fn() = || { ::std::pin::Pin::new_unchecked(&0_u8); };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
= note: consult the function's documentation for information on how to avoid undefined behavior

error: aborting due to previous error

For more information about this error, try `rustc --explain E0133`.
11 changes: 11 additions & 0 deletions src/test/ui/coercion/coerce-unsafe-to-closure.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0277]: expected a `std::ops::FnOnce<(&str,)>` closure, found `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}`
--> $DIR/coerce-unsafe-to-closure.rs:2:40
|
LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute);
| ^^^ expected an `FnOnce<(&str,)>` closure, found `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}`
|
= help: the trait `std::ops::FnOnce<(&str,)>` is not implemented for `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
File renamed without changes.
32 changes: 32 additions & 0 deletions src/test/ui/consts/const-err3.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
error: this expression will panic at runtime
--> $DIR/const-err3.rs:9:13
|
LL | let b = 200u8 + 200u8 + 200u8;
| ^^^^^^^^^^^^^ attempt to add with overflow
|
note: lint level defined here
--> $DIR/const-err3.rs:2:9
|
LL | #![deny(const_err)]
| ^^^^^^^^^

error: this expression will panic at runtime
--> $DIR/const-err3.rs:11:13
|
LL | let c = 200u8 * 4;
| ^^^^^^^^^ attempt to multiply with overflow

error: this expression will panic at runtime
--> $DIR/const-err3.rs:13:13
|
LL | let d = 42u8 - (42u8 + 1);
| ^^^^^^^^^^^^^^^^^ attempt to subtract with overflow

error: index out of bounds: the len is 1 but the index is 1
--> $DIR/const-err3.rs:15:14
|
LL | let _e = [5u8][1];
| ^^^^^^^^

error: aborting due to 4 previous errors

34 changes: 34 additions & 0 deletions src/test/ui/consts/const-fn-error.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
--> $DIR/const-fn-error.rs:7:14
|
LL | for i in 0..x {
| ^^^^

error[E0019]: constant function contains unimplemented expression type
--> $DIR/const-fn-error.rs:7:14
|
LL | for i in 0..x {
| ^^^^

error[E0019]: constant function contains unimplemented expression type
--> $DIR/const-fn-error.rs:7:5
|
LL | / for i in 0..x {
LL | |
LL | |
LL | |
LL | |
LL | | sum += i;
LL | | }
| |_____^

error[E0080]: evaluation of constant value failed
--> $DIR/const-fn-error.rs:7:14
|
LL | for i in 0..x {
| ^^^^ calling non-const function `<std::ops::Range<usize> as std::iter::IntoIterator>::into_iter`

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0015, E0019, E0080.
For more information about an error, try `rustc --explain E0015`.
File renamed without changes.
55 changes: 55 additions & 0 deletions src/test/ui/consts/issue-52443.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
error[E0308]: mismatched types
--> $DIR/issue-52443.rs:2:10
|
LL | [(); & { loop { continue } } ];
| ^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected usize, found reference
| help: consider removing the borrow: `{ loop { continue } }`
|
= note: expected type `usize`
found type `&_`

error[E0308]: mismatched types
--> $DIR/issue-52443.rs:3:17
|
LL | [(); loop { break }];
| ^^^^^ expected (), found usize
|
= note: expected type `()`
found type `usize`

error[E0019]: constant contains unimplemented expression type
--> $DIR/issue-52443.rs:4:11
|
LL | [(); {while true {break}; 0}];
| ^^^^^^^^^^^^^^^^^^

error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
--> $DIR/issue-52443.rs:5:21
|
LL | [(); { for _ in 0usize.. {}; 0}];
| ^^^^^^^^

error[E0019]: constant contains unimplemented expression type
--> $DIR/issue-52443.rs:5:21
|
LL | [(); { for _ in 0usize.. {}; 0}];
| ^^^^^^^^

error[E0019]: constant contains unimplemented expression type
--> $DIR/issue-52443.rs:5:12
|
LL | [(); { for _ in 0usize.. {}; 0}];
| ^^^^^^^^^^^^^^^^^^^^

error[E0080]: evaluation of constant value failed
--> $DIR/issue-52443.rs:5:21
|
LL | [(); { for _ in 0usize.. {}; 0}];
| ^^^^^^^^ calling non-const function `<std::ops::RangeFrom<usize> as std::iter::IntoIterator>::into_iter`

error: aborting due to 7 previous errors

Some errors have detailed explanations: E0015, E0019, E0080, E0308.
For more information about an error, try `rustc --explain E0015`.
Loading