@@ -1137,12 +1137,9 @@ impl<'a> MethodDef<'a> {
1137
1137
/// for each of the self-args, carried in precomputed variables.
1138
1138
1139
1139
/// ```{.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);
1146
1143
///
1147
1144
/// if __self0_vi == __self1_vi && __self0_vi == __self2_vi && ... {
1148
1145
/// match (...) {
@@ -1325,7 +1322,7 @@ impl<'a> MethodDef<'a> {
1325
1322
// Since we know that all the arguments will match if we reach
1326
1323
// the match expression we add the unreachable intrinsics as the
1327
1324
// 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) )
1329
1326
}
1330
1327
_ => None ,
1331
1328
} ;
@@ -1356,12 +1353,9 @@ impl<'a> MethodDef<'a> {
1356
1353
// with three Self args, builds three statements:
1357
1354
//
1358
1355
// ```
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);
1365
1359
// ```
1366
1360
let mut index_let_stmts: Vec < ast:: Stmt > = Vec :: with_capacity ( vi_idents. len ( ) + 1 ) ;
1367
1361
@@ -1474,7 +1468,7 @@ impl<'a> MethodDef<'a> {
1474
1468
// derive Debug on such a type could here generate code
1475
1469
// that needs the feature gate enabled.)
1476
1470
1477
- deriving:: call_intrinsic ( cx, sp, sym :: unreachable , vec ! [ ] )
1471
+ deriving:: call_unreachable ( cx, sp)
1478
1472
} else {
1479
1473
// Final wrinkle: the self_args are expressions that deref
1480
1474
// down to desired places, but we cannot actually deref
0 commit comments