-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #7471 - flip1995:ice-7410, r=giraffate
Fix ICE in redundant_pattern_matching Fixes #7410 changelog: Fix ICE in `redundant_pattern_matching` in `no_std` crates.
- Loading branch information
Showing
2 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// compile-flags: -Clink-arg=-nostartfiles | ||
// ignore-macos | ||
// ignore-windows | ||
|
||
#![feature(lang_items, start, libc)] | ||
#![no_std] | ||
#![allow(clippy::redundant_pattern_matching)] | ||
|
||
use core::panic::PanicInfo; | ||
|
||
struct S; | ||
|
||
impl Drop for S { | ||
fn drop(&mut self) {} | ||
} | ||
|
||
#[start] | ||
fn main(argc: isize, argv: *const *const u8) -> isize { | ||
if let Some(_) = Some(S) { | ||
} else { | ||
} | ||
0 | ||
} | ||
|
||
#[panic_handler] | ||
fn panic(_info: &PanicInfo) -> ! { | ||
loop {} | ||
} | ||
|
||
#[lang = "eh_personality"] | ||
extern "C" fn eh_personality() {} |