diff options
| author | Nadrieril <nadrieril+git@gmail.com> | 2020-10-17 19:01:10 +0100 |
|---|---|---|
| committer | Nadrieril <nadrieril+git@gmail.com> | 2020-10-18 14:21:19 +0100 |
| commit | 3b37d941a29d91afbfa06afcb63f702ee7b810d6 (patch) | |
| tree | 7a3318bb69dab0fe683a8f9e8bd6326cb5d8163f /src/test/ui/issues | |
| parent | 4e3eb5249340898e4380ffe37e7ed8c6b2afdbf9 (diff) | |
| download | rust-3b37d941a29d91afbfa06afcb63f702ee7b810d6.tar.gz rust-3b37d941a29d91afbfa06afcb63f702ee7b810d6.zip | |
Add some tests
Diffstat (limited to 'src/test/ui/issues')
| -rw-r--r-- | src/test/ui/issues/issue-44333.rs | 25 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-44333.stderr | 25 |
2 files changed, 0 insertions, 50 deletions
diff --git a/src/test/ui/issues/issue-44333.rs b/src/test/ui/issues/issue-44333.rs deleted file mode 100644 index 96e8795e52d..00000000000 --- a/src/test/ui/issues/issue-44333.rs +++ /dev/null @@ -1,25 +0,0 @@ -// run-pass - -#![warn(pointer_structural_match)] - -type Func = fn(usize, usize) -> usize; - -fn foo(a: usize, b: usize) -> usize { a + b } -fn bar(a: usize, b: usize) -> usize { a * b } -fn test(x: usize) -> Func { - if x % 2 == 0 { foo } - else { bar } -} - -const FOO: Func = foo; -const BAR: Func = bar; - -fn main() { - match test(std::env::consts::ARCH.len()) { - FOO => println!("foo"), //~ WARN pointers in patterns behave unpredictably - //~^ WARN will become a hard error - BAR => println!("bar"), //~ WARN pointers in patterns behave unpredictably - //~^ WARN will become a hard error - _ => unreachable!(), - } -} diff --git a/src/test/ui/issues/issue-44333.stderr b/src/test/ui/issues/issue-44333.stderr deleted file mode 100644 index 8302b09e533..00000000000 --- a/src/test/ui/issues/issue-44333.stderr +++ /dev/null @@ -1,25 +0,0 @@ -warning: function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details. - --> $DIR/issue-44333.rs:19:9 - | -LL | FOO => println!("foo"), - | ^^^ - | -note: the lint level is defined here - --> $DIR/issue-44333.rs:3:9 - | -LL | #![warn(pointer_structural_match)] - | ^^^^^^^^^^^^^^^^^^^^^^^^ - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/70861> - -warning: function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details. - --> $DIR/issue-44333.rs:21:9 - | -LL | BAR => println!("bar"), - | ^^^ - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/70861> - -warning: 2 warnings emitted - |
