Skip to content
Permalink
Browse files

Revert "Remove `#![feature(never_type)]` from tests."

This reverts commit 8f6197f.
  • Loading branch information
nikomatsakis committed Dec 11, 2019
1 parent ca81548 commit 1719337d02b0830234e3a1a86aae8f05af888cbe
Showing with 268 additions and 98 deletions.
  1. +2 −0 src/test/codegen/enum-debug-niche-2.rs
  2. +2 −0 src/test/mir-opt/uninhabited-enum.rs
  3. +1 −1 src/test/ui/binding/empty-types-in-patterns.rs
  4. +2 −0 src/test/ui/borrowck/assign-never-type.rs
  5. +2 −0 src/test/ui/break-while-condition.rs
  6. +3 −3 src/test/ui/break-while-condition.stderr
  7. +1 −1 src/test/ui/coercion/coerce-issue-49593-box-never.rs
  8. +2 −0 src/test/ui/coercion/coerce-to-bang-cast.rs
  9. +2 −2 src/test/ui/coercion/coerce-to-bang-cast.stderr
  10. +2 −0 src/test/ui/coercion/coerce-to-bang.rs
  11. +10 −10 src/test/ui/coercion/coerce-to-bang.stderr
  12. +1 −1 src/test/ui/consts/validate_never_arrays.rs
  13. +2 −0 src/test/ui/empty/empty-never-array.rs
  14. +2 −2 src/test/ui/empty/empty-never-array.stderr
  15. +2 −0 src/test/ui/feature-gates/feature-gate-exhaustive-patterns.rs
  16. +1 −1 src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr
  17. +17 −0 src/test/ui/feature-gates/feature-gate-never_type.rs
  18. +48 −0 src/test/ui/feature-gates/feature-gate-never_type.stderr
  19. +1 −0 src/test/ui/for-loop-while/loop-break-value.rs
  20. +1 −0 src/test/ui/lint/must_use-unit.rs
  21. +3 −3 src/test/ui/lint/must_use-unit.stderr
  22. +1 −1 src/test/ui/lint/uninitialized-zeroed.rs
  23. +2 −0 src/test/ui/loops/loop-break-value.rs
  24. +14 −14 src/test/ui/loops/loop-break-value.stderr
  25. +1 −0 src/test/ui/mir/mir_calls_to_shims.rs
  26. +2 −0 src/test/ui/never_type/adjust_never.rs
  27. +2 −0 src/test/ui/never_type/call-fn-never-arg-wrong-type.rs
  28. +1 −1 src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr
  29. +1 −0 src/test/ui/never_type/call-fn-never-arg.rs
  30. +2 −0 src/test/ui/never_type/cast-never.rs
  31. +1 −1 src/test/ui/never_type/defaulted-never-note.rs
  32. +1 −1 src/test/ui/never_type/dispatch_from_dyn_zst.rs
  33. +1 −1 src/test/ui/never_type/diverging-fallback-control-flow.rs
  34. +2 −0 src/test/ui/never_type/impl-for-never.rs
  35. +1 −0 src/test/ui/never_type/issue-44402.rs
  36. +1 −0 src/test/ui/never_type/never-assign-dead-code.rs
  37. +5 −5 src/test/ui/never_type/never-assign-dead-code.stderr
  38. +1 −0 src/test/ui/never_type/never-assign-wrong-type.rs
  39. +1 −1 src/test/ui/never_type/never-assign-wrong-type.stderr
  40. +2 −0 src/test/ui/never_type/never-associated-type.rs
  41. +2 −0 src/test/ui/never_type/never-from-impl-is-reserved.rs
  42. +1 −1 src/test/ui/never_type/never-from-impl-is-reserved.stderr
  43. +2 −0 src/test/ui/never_type/never-result.rs
  44. +2 −0 src/test/ui/never_type/never-type-arg.rs
  45. +1 −0 src/test/ui/never_type/never-type-rvalues.rs
  46. +1 −0 src/test/ui/never_type/never_transmute_never.rs
  47. +1 −0 src/test/ui/never_type/panic-uninitialized-zeroed.rs
  48. +2 −0 src/test/ui/never_type/try_from.rs
  49. +1 −0 src/test/ui/pattern/usefulness/match-privately-empty.rs
  50. +1 −1 src/test/ui/pattern/usefulness/match-privately-empty.stderr
  51. +1 −0 src/test/ui/print_type_sizes/uninhabited.rs
  52. +1 −0 src/test/ui/reachable/expr_add.rs
  53. +2 −2 src/test/ui/reachable/expr_add.stderr
  54. +1 −0 src/test/ui/reachable/expr_assign.rs
  55. +4 −4 src/test/ui/reachable/expr_assign.stderr
  56. +1 −0 src/test/ui/reachable/expr_call.rs
  57. +3 −3 src/test/ui/reachable/expr_call.stderr
  58. +1 −1 src/test/ui/reachable/expr_cast.rs
  59. +1 −0 src/test/ui/reachable/expr_method.rs
  60. +3 −3 src/test/ui/reachable/expr_method.stderr
  61. +1 −1 src/test/ui/reachable/expr_type.rs
  62. +1 −0 src/test/ui/reachable/expr_unary.rs
  63. +3 −3 src/test/ui/reachable/expr_unary.stderr
  64. +1 −1 src/test/ui/reachable/unreachable-loop-patterns.rs
  65. +1 −1 src/test/ui/reachable/unreachable-try-pattern.rs
  66. +2 −0 src/test/ui/reachable/unwarned-match-on-never.rs
  67. +3 −3 src/test/ui/reachable/unwarned-match-on-never.stderr
  68. +1 −0 src/test/ui/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs
  69. +1 −0 src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.rs
  70. +4 −4 src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr
  71. +2 −0 src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs
  72. +4 −4 src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr
  73. +1 −0 src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs
  74. +32 −0 src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr
  75. +2 −0 src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs
  76. +1 −0 src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs
  77. +4 −4 src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr
  78. +1 −0 ...test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs
  79. +1 −0 src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.rs
  80. +2 −0 src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs
  81. +1 −0 src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs
  82. +1 −0 src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs
  83. +1 −0 src/test/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs
  84. +5 −5 src/test/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr
  85. +1 −1 src/test/ui/traits/reservation-impls/reservation-impl-non-lattice-ok.rs
  86. +1 −0 src/test/ui/type-sizes.rs
  87. +1 −0 src/test/ui/uninhabited/uninhabited-irrefutable.rs
  88. +1 −1 src/test/ui/uninhabited/uninhabited-irrefutable.stderr
  89. +1 −0 src/test/ui/uninhabited/uninhabited-patterns.rs
  90. +6 −6 src/test/ui/uninhabited/uninhabited-patterns.stderr
@@ -12,6 +12,8 @@
// CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Placeholder",{{.*}}extraData: i64 4294967295{{[,)].*}}
// CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i64 0{{[,)].*}}

#![feature(never_type)]

#[derive(Copy, Clone)]
pub struct Entity {
private: std::num::NonZeroU32,
@@ -1,3 +1,5 @@
#![feature(never_type)]

pub enum Void {}

#[no_mangle]
@@ -1,5 +1,5 @@
// run-pass
#![feature(never_type_fallback)]
#![feature(never_type, never_type_fallback)]
#![feature(exhaustive_patterns)]
#![feature(slice_patterns)]
#![allow(unreachable_patterns)]
@@ -2,6 +2,8 @@

// check-pass

#![feature(never_type)]

pub fn main() {
loop {
match None {
@@ -1,3 +1,5 @@
#![feature(never_type)]

fn main() {
// The `if false` expressions are simply to
// make sure we don't avoid checking everything
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/break-while-condition.rs:7:20
--> $DIR/break-while-condition.rs:9:20
|
LL | let _: ! = {
| ____________________^
@@ -11,7 +11,7 @@ LL | | };
found unit type `()`

error[E0308]: mismatched types
--> $DIR/break-while-condition.rs:14:13
--> $DIR/break-while-condition.rs:16:13
|
LL | / while false {
LL | | break
@@ -22,7 +22,7 @@ LL | | }
found unit type `()`

error[E0308]: mismatched types
--> $DIR/break-while-condition.rs:22:13
--> $DIR/break-while-condition.rs:24:13
|
LL | / while false {
LL | | return
@@ -1,5 +1,5 @@
// check-pass
#![feature(never_type_fallback)]
#![feature(never_type, never_type_fallback)]
#![allow(unreachable_code)]

use std::error::Error;
@@ -1,3 +1,5 @@
#![feature(never_type)]

fn foo(x: usize, y: !, z: usize) { }

fn cast_a() {
@@ -1,13 +1,13 @@
error[E0605]: non-primitive cast: `i32` as `!`
--> $DIR/coerce-to-bang-cast.rs:4:13
--> $DIR/coerce-to-bang-cast.rs:6:13
|
LL | let y = {return; 22} as !;
| ^^^^^^^^^^^^^^^^^
|
= note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait

error[E0605]: non-primitive cast: `i32` as `!`
--> $DIR/coerce-to-bang-cast.rs:9:13
--> $DIR/coerce-to-bang-cast.rs:11:13
|
LL | let y = 22 as !;
| ^^^^^^^
@@ -1,3 +1,5 @@
#![feature(never_type)]

fn foo(x: usize, y: !, z: usize) { }

fn call_foo_a() {
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:4:17
--> $DIR/coerce-to-bang.rs:6:17
|
LL | foo(return, 22, 44);
| ^^ expected `!`, found integer
@@ -8,7 +8,7 @@ LL | foo(return, 22, 44);
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:16:13
--> $DIR/coerce-to-bang.rs:18:13
|
LL | foo(22, 44, return);
| ^^ expected `!`, found integer
@@ -17,7 +17,7 @@ LL | foo(22, 44, return);
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:24:12
--> $DIR/coerce-to-bang.rs:26:12
|
LL | foo(a, b, c); // ... and hence a reference to `a` is expected to diverge.
| ^ expected `!`, found integer
@@ -26,7 +26,7 @@ LL | foo(a, b, c); // ... and hence a reference to `a` is expected to diverg
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:34:12
--> $DIR/coerce-to-bang.rs:36:12
|
LL | foo(a, b, c);
| ^ expected `!`, found integer
@@ -35,7 +35,7 @@ LL | foo(a, b, c);
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:43:12
--> $DIR/coerce-to-bang.rs:45:12
|
LL | foo(a, b, c);
| ^ expected `!`, found integer
@@ -44,7 +44,7 @@ LL | foo(a, b, c);
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:48:21
--> $DIR/coerce-to-bang.rs:50:21
|
LL | let x: [!; 2] = [return, 22];
| ------ ^^^^^^^^^^^^ expected `!`, found integer
@@ -55,7 +55,7 @@ LL | let x: [!; 2] = [return, 22];
found array `[{integer}; 2]`

error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:53:22
--> $DIR/coerce-to-bang.rs:55:22
|
LL | let x: [!; 2] = [22, return];
| ^^ expected `!`, found integer
@@ -64,7 +64,7 @@ LL | let x: [!; 2] = [22, return];
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:58:37
--> $DIR/coerce-to-bang.rs:60:37
|
LL | let x: (usize, !, usize) = (22, 44, 66);
| ^^ expected `!`, found integer
@@ -73,7 +73,7 @@ LL | let x: (usize, !, usize) = (22, 44, 66);
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:63:41
--> $DIR/coerce-to-bang.rs:65:41
|
LL | let x: (usize, !, usize) = (return, 44, 66);
| ^^ expected `!`, found integer
@@ -82,7 +82,7 @@ LL | let x: (usize, !, usize) = (return, 44, 66);
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:74:37
--> $DIR/coerce-to-bang.rs:76:37
|
LL | let x: (usize, !, usize) = (22, 44, return);
| ^^ expected `!`, found integer
@@ -1,4 +1,4 @@
#![feature(const_raw_ptr_deref)]
#![feature(const_raw_ptr_deref, never_type)]

const FOO: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) }; //~ ERROR undefined behavior

@@ -1,3 +1,5 @@
#![feature(never_type)]

enum Helper<T, U> {
T(T, [!; 0]),
#[allow(dead_code)]
@@ -1,5 +1,5 @@
error[E0005]: refutable pattern in local binding: `T(_, _)` not covered
--> $DIR/empty-never-array.rs:8:9
--> $DIR/empty-never-array.rs:10:9
|
LL | / enum Helper<T, U> {
LL | | T(T, [!; 0]),
@@ -20,7 +20,7 @@ LL | if let Helper::U(u) = Helper::T(t, []) { /* */ }
|

error[E0381]: use of possibly-uninitialized variable: `u`
--> $DIR/empty-never-array.rs:10:5
--> $DIR/empty-never-array.rs:12:5
|
LL | u
| ^ use of possibly-uninitialized `u`
@@ -1,3 +1,5 @@
#![feature(never_type)]

fn foo() -> Result<u32, !> {
Ok(123)
}
@@ -1,5 +1,5 @@
error[E0005]: refutable pattern in local binding: `Err(_)` not covered
--> $DIR/feature-gate-exhaustive-patterns.rs:6:9
--> $DIR/feature-gate-exhaustive-patterns.rs:8:9
|
LL | let Ok(_x) = foo();
| ^^^^^^ pattern `Err(_)` not covered
@@ -0,0 +1,17 @@
// Test that ! errors when used in illegal positions with feature(never_type) disabled

trait Foo {
type Wub;
}

type Ma = (u32, !, i32); //~ ERROR type is experimental
type Meeshka = Vec<!>; //~ ERROR type is experimental
type Mow = &'static fn(!) -> !; //~ ERROR type is experimental
type Skwoz = &'static mut !; //~ ERROR type is experimental

impl Foo for Meeshka {
type Wub = !; //~ ERROR type is experimental
}

fn main() {
}
@@ -0,0 +1,48 @@
error[E0658]: The `!` type is experimental
--> $DIR/feature-gate-never_type.rs:7:17
|
LL | type Ma = (u32, !, i32);
| ^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/35121
= help: add `#![feature(never_type)]` to the crate attributes to enable

error[E0658]: The `!` type is experimental
--> $DIR/feature-gate-never_type.rs:8:20
|
LL | type Meeshka = Vec<!>;
| ^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/35121
= help: add `#![feature(never_type)]` to the crate attributes to enable

error[E0658]: The `!` type is experimental
--> $DIR/feature-gate-never_type.rs:9:24
|
LL | type Mow = &'static fn(!) -> !;
| ^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/35121
= help: add `#![feature(never_type)]` to the crate attributes to enable

error[E0658]: The `!` type is experimental
--> $DIR/feature-gate-never_type.rs:10:27
|
LL | type Skwoz = &'static mut !;
| ^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/35121
= help: add `#![feature(never_type)]` to the crate attributes to enable

error[E0658]: The `!` type is experimental
--> $DIR/feature-gate-never_type.rs:13:16
|
LL | type Wub = !;
| ^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/35121
= help: add `#![feature(never_type)]` to the crate attributes to enable

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0658`.
@@ -1,6 +1,7 @@
// run-pass

#![allow(unreachable_code)]
#![feature(never_type)]

#[allow(unused)]
fn never_returns() {
@@ -1,3 +1,4 @@
#![feature(never_type)]
#![deny(unused_must_use)]

#[must_use]
@@ -1,17 +1,17 @@
error: unused return value of `foo` that must be used
--> $DIR/must_use-unit.rs:12:5
--> $DIR/must_use-unit.rs:13:5
|
LL | foo();
| ^^^^^^
|
note: lint level defined here
--> $DIR/must_use-unit.rs:1:9
--> $DIR/must_use-unit.rs:2:9
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^

error: unused return value of `bar` that must be used
--> $DIR/must_use-unit.rs:14:5
--> $DIR/must_use-unit.rs:15:5
|
LL | bar();
| ^^^^^^
@@ -2,7 +2,7 @@
// This test checks that calling `mem::{uninitialized,zeroed}` with certain types results
// in a lint.

#![feature(rustc_attrs)]
#![feature(never_type, rustc_attrs)]
#![allow(deprecated)]
#![deny(invalid_value)]

@@ -1,3 +1,5 @@
#![feature(never_type)]

fn main() {
let val: ! = loop { break break; };
//~^ ERROR mismatched types

0 comments on commit 1719337

Please sign in to comment.
You can’t perform that action at this time.