File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 11language : rust
22rust :
3- - 1.20 .0
3+ - 1.36 .0
44 - nightly
55 - beta
66 - stable
Original file line number Diff line number Diff line change @@ -132,10 +132,9 @@ macro_rules! smallvec {
132132///
133133/// Equivalent to `std::hint::unreachable_unchecked` but works in older versions of Rust.
134134#[ inline]
135+ #[ deprecated( note = "Use std::hint::unreachable_unchecked instead" ) ]
135136pub unsafe fn unreachable ( ) -> ! {
136- enum Void { }
137- let x: & Void = mem:: transmute ( 1usize ) ;
138- match * x { }
137+ std:: hint:: unreachable_unchecked ( )
139138}
140139
141140/// `panic!()` in debug builds, optimization hint in release.
@@ -144,7 +143,7 @@ macro_rules! debug_unreachable {
144143 ( ) => { debug_unreachable!( "entered unreachable code" ) } ;
145144 ( $e: expr) => {
146145 if cfg!( not( debug_assertions) ) {
147- unreachable ( ) ;
146+ std :: hint :: unreachable_unchecked ( ) ;
148147 } else {
149148 panic!( $e) ;
150149 }
You can’t perform that action at this time.
0 commit comments