File tree 2 files changed +4
-5
lines changed
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
language : rust
2
2
rust :
3
- - 1.20 .0
3
+ - 1.36 .0
4
4
- nightly
5
5
- beta
6
6
- stable
Original file line number Diff line number Diff line change @@ -132,10 +132,9 @@ macro_rules! smallvec {
132
132
///
133
133
/// Equivalent to `std::hint::unreachable_unchecked` but works in older versions of Rust.
134
134
#[ inline]
135
+ #[ deprecated( note = "Use std::hint::unreachable_unchecked instead" ) ]
135
136
pub unsafe fn unreachable ( ) -> ! {
136
- enum Void { }
137
- let x: & Void = mem:: transmute ( 1usize ) ;
138
- match * x { }
137
+ std:: hint:: unreachable_unchecked ( )
139
138
}
140
139
141
140
/// `panic!()` in debug builds, optimization hint in release.
@@ -144,7 +143,7 @@ macro_rules! debug_unreachable {
144
143
( ) => { debug_unreachable!( "entered unreachable code" ) } ;
145
144
( $e: expr) => {
146
145
if cfg!( not( debug_assertions) ) {
147
- unreachable ( ) ;
146
+ std :: hint :: unreachable_unchecked ( ) ;
148
147
} else {
149
148
panic!( $e) ;
150
149
}
You can’t perform that action at this time.
0 commit comments