@@ -1137,12 +1137,9 @@ impl<'a> MethodDef<'a> {
11371137 /// for each of the self-args, carried in precomputed variables.
11381138
11391139 /// ```{.text}
1140- /// let __self0_vi = unsafe {
1141- /// std::intrinsics::discriminant_value(&self) };
1142- /// let __self1_vi = unsafe {
1143- /// std::intrinsics::discriminant_value(&arg1) };
1144- /// let __self2_vi = unsafe {
1145- /// std::intrinsics::discriminant_value(&arg2) };
1140+ /// let __self0_vi = std::intrinsics::discriminant_value(&self);
1141+ /// let __self1_vi = std::intrinsics::discriminant_value(&arg1);
1142+ /// let __self2_vi = std::intrinsics::discriminant_value(&arg2);
11461143 ///
11471144 /// if __self0_vi == __self1_vi && __self0_vi == __self2_vi && ... {
11481145 /// match (...) {
@@ -1325,7 +1322,7 @@ impl<'a> MethodDef<'a> {
13251322 // Since we know that all the arguments will match if we reach
13261323 // the match expression we add the unreachable intrinsics as the
13271324 // result of the catch all which should help llvm in optimizing it
1328- Some ( deriving:: call_intrinsic ( cx, sp, sym :: unreachable , vec ! [ ] ) )
1325+ Some ( deriving:: call_unreachable ( cx, sp) )
13291326 }
13301327 _ => None ,
13311328 } ;
@@ -1356,12 +1353,9 @@ impl<'a> MethodDef<'a> {
13561353 // with three Self args, builds three statements:
13571354 //
13581355 // ```
1359- // let __self0_vi = unsafe {
1360- // std::intrinsics::discriminant_value(&self) };
1361- // let __self1_vi = unsafe {
1362- // std::intrinsics::discriminant_value(&arg1) };
1363- // let __self2_vi = unsafe {
1364- // std::intrinsics::discriminant_value(&arg2) };
1356+ // let __self0_vi = std::intrinsics::discriminant_value(&self);
1357+ // let __self1_vi = std::intrinsics::discriminant_value(&arg1);
1358+ // let __self2_vi = std::intrinsics::discriminant_value(&arg2);
13651359 // ```
13661360 let mut index_let_stmts: Vec < ast:: Stmt > = Vec :: with_capacity ( vi_idents. len ( ) + 1 ) ;
13671361
@@ -1474,7 +1468,7 @@ impl<'a> MethodDef<'a> {
14741468 // derive Debug on such a type could here generate code
14751469 // that needs the feature gate enabled.)
14761470
1477- deriving:: call_intrinsic ( cx, sp, sym :: unreachable , vec ! [ ] )
1471+ deriving:: call_unreachable ( cx, sp)
14781472 } else {
14791473 // Final wrinkle: the self_args are expressions that deref
14801474 // down to desired places, but we cannot actually deref
0 commit comments