Skip to content

Commit ca10919

Browse files
committed
Fixes in various places
1 parent 3a7fd6c commit ca10919

File tree

7 files changed

+8
-4
lines changed

7 files changed

+8
-4
lines changed

compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs

+1
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ pub enum E2<X> {
578578
V4,
579579
}
580580

581+
#[allow(unreachable_patterns)]
581582
fn check_niche_behavior() {
582583
if let E1::V2 { .. } = (E1::V1 { f: true }) {
583584
intrinsics::abort();

compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs

+1
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ pub enum E2<X> {
432432
V4,
433433
}
434434

435+
#[allow(unreachable_patterns)]
435436
fn check_niche_behavior () {
436437
if let E1::V2 { .. } = (E1::V1 { f: true }) {
437438
intrinsics::abort();

src/tools/clippy/tests/ui/single_match_else.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ fn main() {
9090

9191
// lint here
9292
use std::convert::Infallible;
93-
if let Ok(a) = Result::<i32, Infallible>::Ok(1) { println!("${:?}", a) } else {
93+
if let Ok(a) = Result::<i32, &Infallible>::Ok(1) { println!("${:?}", a) } else {
9494
println!("else block");
9595
return;
9696
}

src/tools/clippy/tests/ui/single_match_else.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn main() {
9999

100100
// lint here
101101
use std::convert::Infallible;
102-
match Result::<i32, Infallible>::Ok(1) {
102+
match Result::<i32, &Infallible>::Ok(1) {
103103
Ok(a) => println!("${:?}", a),
104104
Err(_) => {
105105
println!("else block");

src/tools/clippy/tests/ui/single_match_else.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ LL + }
6464
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
6565
--> tests/ui/single_match_else.rs:102:5
6666
|
67-
LL | / match Result::<i32, Infallible>::Ok(1) {
67+
LL | / match Result::<i32, &Infallible>::Ok(1) {
6868
LL | | Ok(a) => println!("${:?}", a),
6969
LL | | Err(_) => {
7070
LL | | println!("else block");
@@ -75,7 +75,7 @@ LL | | }
7575
|
7676
help: try
7777
|
78-
LL ~ if let Ok(a) = Result::<i32, Infallible>::Ok(1) { println!("${:?}", a) } else {
78+
LL ~ if let Ok(a) = Result::<i32, &Infallible>::Ok(1) { println!("${:?}", a) } else {
7979
LL + println!("else block");
8080
LL + return;
8181
LL + }

src/tools/miri/src/eval.rs

+1
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ pub fn eval_entry<'tcx>(
441441
let res = match res {
442442
Err(res) => res,
443443
// `Ok` can never happen
444+
#[cfg(bootstrap)]
444445
Ok(never) => match never {},
445446
};
446447

src/tools/miri/tests/pass/enums.rs

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ fn discriminant_overflow() {
4343
}
4444
}
4545

46+
#[allow(unreachable_patterns)]
4647
fn more_discriminant_overflow() {
4748
pub enum Infallible {}
4849

0 commit comments

Comments
 (0)