about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-06-19 08:34:50 +0000
committerbors <bors@rust-lang.org>2020-06-19 08:34:50 +0000
commit63b441aafbf52d6ba789ecc478455800c1a48df9 (patch)
tree522aba5368c067b64995b45a91f3e4e5587bfe3a /src/test
parenta39c7787ba246353178e099373b9240be0d9e603 (diff)
parent028c908991125742c4acc38b7a3108a1d1133771 (diff)
Auto merge of #73498 - RalfJung:rollup-1mfjcju, r=RalfJung
Rollup of 13 pull requests

Successful merges:

 - #70740 (Enabling static-pie for musl)
 - #72331 (Report error when casting an C-like enum implementing Drop)
 - #72486 (Fix asinh of negative values)
 - #72497 (tag/niche terminology cleanup)
 - #72999 (Create self-contained directory and move there some of external binaries/libs)
 - #73130 (Remove const prop for indirects)
 - #73142 (Ensure std benchmarks get tested.)
 - #73305 (Disallow loading crates with non-ascii identifier name.)
 - #73346 (Add rust specific features to print target features)
 - #73362 (Test that bounds checks are elided when slice len is checked up-front)
 - #73459 (Reduce pointer casts in Box::into_boxed_slice)
 - #73464 (Document format correction)
 - #73479 (Minor tweaks to liballoc)

Failed merges:

r? @ghost
Diffstat (limited to 'src/test')
-rw-r--r--src/test/codegen/issue-69101-bounds-check.rs44
-rw-r--r--src/test/mir-opt/const_prop/discriminant.rs5
-rw-r--r--src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff75
-rw-r--r--src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff75
-rw-r--r--src/test/run-make/static-pie/Makefile15
-rw-r--r--src/test/run-make/static-pie/test-aslr.rs43
-rw-r--r--src/test/ui/cenum_impl_drop_cast.rs18
-rw-r--r--src/test/ui/cenum_impl_drop_cast.stderr16
-rw-r--r--src/test/ui/consts/const-eval/double_check2.stderr2
-rw-r--r--src/test/ui/consts/const-eval/ub-enum.stderr4
-rw-r--r--src/test/ui/layout/debug.stderr12
-rw-r--r--src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs6
-rw-r--r--src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr15
-rw-r--r--src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs9
-rw-r--r--src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr15
15 files changed, 263 insertions, 91 deletions
diff --git a/src/test/codegen/issue-69101-bounds-check.rs b/src/test/codegen/issue-69101-bounds-check.rs
new file mode 100644
index 00000000000..8ade583b571
--- /dev/null
+++ b/src/test/codegen/issue-69101-bounds-check.rs
@@ -0,0 +1,44 @@
+// no-system-llvm
+// compile-flags: -O
+// ignore-debug: the debug assertions get in the way
+#![crate_type = "lib"]
+
+// Make sure no bounds checks are emitted in the loop when upfront slicing
+// ensures that the slices are big enough.
+// In particular, bounds checks were not always optimized out if the upfront
+// check was for a greater len than the loop requires.
+// (i.e. `already_sliced_no_bounds_check` was not always optimized even when
+// `already_sliced_no_bounds_check_exact` was)
+// CHECK-LABEL: @already_sliced_no_bounds_check
+#[no_mangle]
+pub fn already_sliced_no_bounds_check(a: &[u8], b: &[u8], c: &mut [u8]) {
+    // CHECK: slice_index_len_fail
+    // CHECK-NOT: panic_bounds_check
+    let _ = (&a[..2048], &b[..2048], &mut c[..2048]);
+    for i in 0..1024 {
+        c[i] = a[i] ^ b[i];
+    }
+}
+
+// CHECK-LABEL: @already_sliced_no_bounds_check_exact
+#[no_mangle]
+pub fn already_sliced_no_bounds_check_exact(a: &[u8], b: &[u8], c: &mut [u8]) {
+    // CHECK: slice_index_len_fail
+    // CHECK-NOT: panic_bounds_check
+    let _ = (&a[..1024], &b[..1024], &mut c[..1024]);
+    for i in 0..1024 {
+        c[i] = a[i] ^ b[i];
+    }
+}
+
+// Make sure we're checking for the right thing: there can be a panic if the slice is too small.
+// CHECK-LABEL: @already_sliced_bounds_check
+#[no_mangle]
+pub fn already_sliced_bounds_check(a: &[u8], b: &[u8], c: &mut [u8]) {
+    // CHECK: slice_index_len_fail
+    // CHECK: panic_bounds_check
+    let _ = (&a[..1023], &b[..2048], &mut c[..2048]);
+    for i in 0..1024 {
+        c[i] = a[i] ^ b[i];
+    }
+}
diff --git a/src/test/mir-opt/const_prop/discriminant.rs b/src/test/mir-opt/const_prop/discriminant.rs
index 04541b94ad7..13e8eb3e44e 100644
--- a/src/test/mir-opt/const_prop/discriminant.rs
+++ b/src/test/mir-opt/const_prop/discriminant.rs
@@ -1,5 +1,10 @@
 // compile-flags: -O
 
+// FIXME(wesleywiser): Ideally, we could const-prop away all of this and just be left with
+// `let x = 42` but that doesn't work because const-prop doesn't support `Operand::Indirect`
+// and `InterpCx::eval_place()` always forces an allocation which creates the `Indirect`.
+// Fixing either of those will allow us to const-prop this away.
+
 // EMIT_MIR_FOR_EACH_BIT_WIDTH
 // EMIT_MIR rustc.main.ConstProp.diff
 fn main() {
diff --git a/src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff
index 9979ea95498..1c873f53f37 100644
--- a/src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff
@@ -2,100 +2,93 @@
 + // MIR for `main` after ConstProp
   
   fn main() -> () {
-      let mut _0: ();                      // return place in scope 0 at $DIR/discriminant.rs:5:11: 5:11
-      let _1: i32;                         // in scope 0 at $DIR/discriminant.rs:6:9: 6:10
-      let mut _2: i32;                     // in scope 0 at $DIR/discriminant.rs:6:13: 6:64
-      let mut _3: std::option::Option<bool>; // in scope 0 at $DIR/discriminant.rs:6:34: 6:44
-      let mut _4: isize;                   // in scope 0 at $DIR/discriminant.rs:6:21: 6:31
+      let mut _0: ();                      // return place in scope 0 at $DIR/discriminant.rs:10:11: 10:11
+      let _1: i32;                         // in scope 0 at $DIR/discriminant.rs:11:9: 11:10
+      let mut _2: i32;                     // in scope 0 at $DIR/discriminant.rs:11:13: 11:64
+      let mut _3: std::option::Option<bool>; // in scope 0 at $DIR/discriminant.rs:11:34: 11:44
+      let mut _4: isize;                   // in scope 0 at $DIR/discriminant.rs:11:21: 11:31
       scope 1 {
-          debug x => _1;                   // in scope 1 at $DIR/discriminant.rs:6:9: 6:10
+          debug x => _1;                   // in scope 1 at $DIR/discriminant.rs:11:9: 11:10
       }
   
       bb0: {
-          StorageLive(_1);                 // scope 0 at $DIR/discriminant.rs:6:9: 6:10
-          StorageLive(_2);                 // scope 0 at $DIR/discriminant.rs:6:13: 6:64
-          StorageLive(_3);                 // scope 0 at $DIR/discriminant.rs:6:34: 6:44
--         _3 = std::option::Option::<bool>::Some(const true); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
-+         _3 = const std::option::Option::<bool>::Some(true); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
+          StorageLive(_1);                 // scope 0 at $DIR/discriminant.rs:11:9: 11:10
+          StorageLive(_2);                 // scope 0 at $DIR/discriminant.rs:11:13: 11:64
+          StorageLive(_3);                 // scope 0 at $DIR/discriminant.rs:11:34: 11:44
+-         _3 = std::option::Option::<bool>::Some(const true); // scope 0 at $DIR/discriminant.rs:11:34: 11:44
++         _3 = const std::option::Option::<bool>::Some(true); // scope 0 at $DIR/discriminant.rs:11:34: 11:44
                                            // ty::Const
 -                                          // + ty: bool
 +                                          // + ty: std::option::Option<bool>
                                            // + val: Value(Scalar(0x01))
                                            // mir::Constant
--                                          // + span: $DIR/discriminant.rs:6:39: 6:43
+-                                          // + span: $DIR/discriminant.rs:11:39: 11:43
 -                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
--         _4 = discriminant(_3);           // scope 0 at $DIR/discriminant.rs:6:21: 6:31
--         switchInt(move _4) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
-+                                          // + span: $DIR/discriminant.rs:6:34: 6:44
+-         _4 = discriminant(_3);           // scope 0 at $DIR/discriminant.rs:11:21: 11:31
+-         switchInt(move _4) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
++                                          // + span: $DIR/discriminant.rs:11:34: 11:44
 +                                          // + literal: Const { ty: std::option::Option<bool>, val: Value(Scalar(0x01)) }
-+         _4 = const 1isize;               // scope 0 at $DIR/discriminant.rs:6:21: 6:31
++         _4 = const 1isize;               // scope 0 at $DIR/discriminant.rs:11:21: 11:31
 +                                          // ty::Const
 +                                          // + ty: isize
 +                                          // + val: Value(Scalar(0x00000001))
 +                                          // mir::Constant
-+                                          // + span: $DIR/discriminant.rs:6:21: 6:31
++                                          // + span: $DIR/discriminant.rs:11:21: 11:31
 +                                          // + literal: Const { ty: isize, val: Value(Scalar(0x00000001)) }
-+         switchInt(const 1isize) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
++         switchInt(const 1isize) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
 +                                          // ty::Const
 +                                          // + ty: isize
 +                                          // + val: Value(Scalar(0x00000001))
 +                                          // mir::Constant
-+                                          // + span: $DIR/discriminant.rs:6:21: 6:31
++                                          // + span: $DIR/discriminant.rs:11:21: 11:31
 +                                          // + literal: Const { ty: isize, val: Value(Scalar(0x00000001)) }
       }
   
       bb1: {
-          _2 = const 10i32;                // scope 0 at $DIR/discriminant.rs:6:59: 6:61
+          _2 = const 10i32;                // scope 0 at $DIR/discriminant.rs:11:59: 11:61
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x0000000a))
                                            // mir::Constant
-                                           // + span: $DIR/discriminant.rs:6:59: 6:61
+                                           // + span: $DIR/discriminant.rs:11:59: 11:61
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
-          goto -> bb4;                     // scope 0 at $DIR/discriminant.rs:6:13: 6:64
+          goto -> bb4;                     // scope 0 at $DIR/discriminant.rs:11:13: 11:64
       }
   
       bb2: {
--         switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:6:26: 6:30
-+         switchInt(const true) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:6:26: 6:30
-+                                          // ty::Const
-+                                          // + ty: bool
-+                                          // + val: Value(Scalar(0x01))
-+                                          // mir::Constant
-+                                          // + span: $DIR/discriminant.rs:6:26: 6:30
-+                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+          switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:11:26: 11:30
       }
   
       bb3: {
-          _2 = const 42i32;                // scope 0 at $DIR/discriminant.rs:6:47: 6:49
+          _2 = const 42i32;                // scope 0 at $DIR/discriminant.rs:11:47: 11:49
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x0000002a))
                                            // mir::Constant
-                                           // + span: $DIR/discriminant.rs:6:47: 6:49
+                                           // + span: $DIR/discriminant.rs:11:47: 11:49
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
-          goto -> bb4;                     // scope 0 at $DIR/discriminant.rs:6:13: 6:64
+          goto -> bb4;                     // scope 0 at $DIR/discriminant.rs:11:13: 11:64
       }
   
       bb4: {
-          _1 = Add(move _2, const 0i32);   // scope 0 at $DIR/discriminant.rs:6:13: 6:68
+          _1 = Add(move _2, const 0i32);   // scope 0 at $DIR/discriminant.rs:11:13: 11:68
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000000))
                                            // mir::Constant
-                                           // + span: $DIR/discriminant.rs:6:67: 6:68
+                                           // + span: $DIR/discriminant.rs:11:67: 11:68
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-          StorageDead(_2);                 // scope 0 at $DIR/discriminant.rs:6:67: 6:68
-          StorageDead(_3);                 // scope 0 at $DIR/discriminant.rs:6:68: 6:69
-          _0 = const ();                   // scope 0 at $DIR/discriminant.rs:5:11: 7:2
+          StorageDead(_2);                 // scope 0 at $DIR/discriminant.rs:11:67: 11:68
+          StorageDead(_3);                 // scope 0 at $DIR/discriminant.rs:11:68: 11:69
+          _0 = const ();                   // scope 0 at $DIR/discriminant.rs:10:11: 12:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
-                                           // + span: $DIR/discriminant.rs:5:11: 7:2
+                                           // + span: $DIR/discriminant.rs:10:11: 12:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // scope 0 at $DIR/discriminant.rs:7:1: 7:2
-          return;                          // scope 0 at $DIR/discriminant.rs:7:2: 7:2
+          StorageDead(_1);                 // scope 0 at $DIR/discriminant.rs:12:1: 12:2
+          return;                          // scope 0 at $DIR/discriminant.rs:12:2: 12:2
       }
   }
   
diff --git a/src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff
index ec0341e3de2..75b4b7e5a62 100644
--- a/src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff
@@ -2,100 +2,93 @@
 + // MIR for `main` after ConstProp
   
   fn main() -> () {
-      let mut _0: ();                      // return place in scope 0 at $DIR/discriminant.rs:5:11: 5:11
-      let _1: i32;                         // in scope 0 at $DIR/discriminant.rs:6:9: 6:10
-      let mut _2: i32;                     // in scope 0 at $DIR/discriminant.rs:6:13: 6:64
-      let mut _3: std::option::Option<bool>; // in scope 0 at $DIR/discriminant.rs:6:34: 6:44
-      let mut _4: isize;                   // in scope 0 at $DIR/discriminant.rs:6:21: 6:31
+      let mut _0: ();                      // return place in scope 0 at $DIR/discriminant.rs:10:11: 10:11
+      let _1: i32;                         // in scope 0 at $DIR/discriminant.rs:11:9: 11:10
+      let mut _2: i32;                     // in scope 0 at $DIR/discriminant.rs:11:13: 11:64
+      let mut _3: std::option::Option<bool>; // in scope 0 at $DIR/discriminant.rs:11:34: 11:44
+      let mut _4: isize;                   // in scope 0 at $DIR/discriminant.rs:11:21: 11:31
       scope 1 {
-          debug x => _1;                   // in scope 1 at $DIR/discriminant.rs:6:9: 6:10
+          debug x => _1;                   // in scope 1 at $DIR/discriminant.rs:11:9: 11:10
       }
   
       bb0: {
-          StorageLive(_1);                 // scope 0 at $DIR/discriminant.rs:6:9: 6:10
-          StorageLive(_2);                 // scope 0 at $DIR/discriminant.rs:6:13: 6:64
-          StorageLive(_3);                 // scope 0 at $DIR/discriminant.rs:6:34: 6:44
--         _3 = std::option::Option::<bool>::Some(const true); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
-+         _3 = const std::option::Option::<bool>::Some(true); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
+          StorageLive(_1);                 // scope 0 at $DIR/discriminant.rs:11:9: 11:10
+          StorageLive(_2);                 // scope 0 at $DIR/discriminant.rs:11:13: 11:64
+          StorageLive(_3);                 // scope 0 at $DIR/discriminant.rs:11:34: 11:44
+-         _3 = std::option::Option::<bool>::Some(const true); // scope 0 at $DIR/discriminant.rs:11:34: 11:44
++         _3 = const std::option::Option::<bool>::Some(true); // scope 0 at $DIR/discriminant.rs:11:34: 11:44
                                            // ty::Const
 -                                          // + ty: bool
 +                                          // + ty: std::option::Option<bool>
                                            // + val: Value(Scalar(0x01))
                                            // mir::Constant
--                                          // + span: $DIR/discriminant.rs:6:39: 6:43
+-                                          // + span: $DIR/discriminant.rs:11:39: 11:43
 -                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
--         _4 = discriminant(_3);           // scope 0 at $DIR/discriminant.rs:6:21: 6:31
--         switchInt(move _4) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
-+                                          // + span: $DIR/discriminant.rs:6:34: 6:44
+-         _4 = discriminant(_3);           // scope 0 at $DIR/discriminant.rs:11:21: 11:31
+-         switchInt(move _4) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
++                                          // + span: $DIR/discriminant.rs:11:34: 11:44
 +                                          // + literal: Const { ty: std::option::Option<bool>, val: Value(Scalar(0x01)) }
-+         _4 = const 1isize;               // scope 0 at $DIR/discriminant.rs:6:21: 6:31
++         _4 = const 1isize;               // scope 0 at $DIR/discriminant.rs:11:21: 11:31
 +                                          // ty::Const
 +                                          // + ty: isize
 +                                          // + val: Value(Scalar(0x0000000000000001))
 +                                          // mir::Constant
-+                                          // + span: $DIR/discriminant.rs:6:21: 6:31
++                                          // + span: $DIR/discriminant.rs:11:21: 11:31
 +                                          // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000001)) }
-+         switchInt(const 1isize) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
++         switchInt(const 1isize) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
 +                                          // ty::Const
 +                                          // + ty: isize
 +                                          // + val: Value(Scalar(0x0000000000000001))
 +                                          // mir::Constant
-+                                          // + span: $DIR/discriminant.rs:6:21: 6:31
++                                          // + span: $DIR/discriminant.rs:11:21: 11:31
 +                                          // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000001)) }
       }
   
       bb1: {
-          _2 = const 10i32;                // scope 0 at $DIR/discriminant.rs:6:59: 6:61
+          _2 = const 10i32;                // scope 0 at $DIR/discriminant.rs:11:59: 11:61
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x0000000a))
                                            // mir::Constant
-                                           // + span: $DIR/discriminant.rs:6:59: 6:61
+                                           // + span: $DIR/discriminant.rs:11:59: 11:61
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
-          goto -> bb4;                     // scope 0 at $DIR/discriminant.rs:6:13: 6:64
+          goto -> bb4;                     // scope 0 at $DIR/discriminant.rs:11:13: 11:64
       }
   
       bb2: {
--         switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:6:26: 6:30
-+         switchInt(const true) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:6:26: 6:30
-+                                          // ty::Const
-+                                          // + ty: bool
-+                                          // + val: Value(Scalar(0x01))
-+                                          // mir::Constant
-+                                          // + span: $DIR/discriminant.rs:6:26: 6:30
-+                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+          switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:11:26: 11:30
       }
   
       bb3: {
-          _2 = const 42i32;                // scope 0 at $DIR/discriminant.rs:6:47: 6:49
+          _2 = const 42i32;                // scope 0 at $DIR/discriminant.rs:11:47: 11:49
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x0000002a))
                                            // mir::Constant
-                                           // + span: $DIR/discriminant.rs:6:47: 6:49
+                                           // + span: $DIR/discriminant.rs:11:47: 11:49
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
-          goto -> bb4;                     // scope 0 at $DIR/discriminant.rs:6:13: 6:64
+          goto -> bb4;                     // scope 0 at $DIR/discriminant.rs:11:13: 11:64
       }
   
       bb4: {
-          _1 = Add(move _2, const 0i32);   // scope 0 at $DIR/discriminant.rs:6:13: 6:68
+          _1 = Add(move _2, const 0i32);   // scope 0 at $DIR/discriminant.rs:11:13: 11:68
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000000))
                                            // mir::Constant
-                                           // + span: $DIR/discriminant.rs:6:67: 6:68
+                                           // + span: $DIR/discriminant.rs:11:67: 11:68
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-          StorageDead(_2);                 // scope 0 at $DIR/discriminant.rs:6:67: 6:68
-          StorageDead(_3);                 // scope 0 at $DIR/discriminant.rs:6:68: 6:69
-          _0 = const ();                   // scope 0 at $DIR/discriminant.rs:5:11: 7:2
+          StorageDead(_2);                 // scope 0 at $DIR/discriminant.rs:11:67: 11:68
+          StorageDead(_3);                 // scope 0 at $DIR/discriminant.rs:11:68: 11:69
+          _0 = const ();                   // scope 0 at $DIR/discriminant.rs:10:11: 12:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
-                                           // + span: $DIR/discriminant.rs:5:11: 7:2
+                                           // + span: $DIR/discriminant.rs:10:11: 12:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // scope 0 at $DIR/discriminant.rs:7:1: 7:2
-          return;                          // scope 0 at $DIR/discriminant.rs:7:2: 7:2
+          StorageDead(_1);                 // scope 0 at $DIR/discriminant.rs:12:1: 12:2
+          return;                          // scope 0 at $DIR/discriminant.rs:12:2: 12:2
       }
   }
   
diff --git a/src/test/run-make/static-pie/Makefile b/src/test/run-make/static-pie/Makefile
new file mode 100644
index 00000000000..1d3cc821389
--- /dev/null
+++ b/src/test/run-make/static-pie/Makefile
@@ -0,0 +1,15 @@
+-include ../../run-make-fulldeps/tools.mk
+
+# only-x86_64-unknown-linux-musl
+
+# How to manually run this
+# $ ./x.py test --target x86_64-unknown-linux-musl src/test/run-make/static-pie
+
+all:
+	$(RUSTC) --target $(TARGET) -C target-feature=+crt-static test-aslr.rs
+	# Check that no dynamic interpreter is set
+	! readelf -l $(call RUN_BINFILE,test-aslr) | $(CGREP) INTERP
+	# Check that we have a dynamic executable
+	readelf -l $(call RUN_BINFILE,test-aslr) | $(CGREP) DYNAMIC
+	# Check for address space layout randomization
+	$(call RUN,test-aslr) --test-aslr
diff --git a/src/test/run-make/static-pie/test-aslr.rs b/src/test/run-make/static-pie/test-aslr.rs
new file mode 100644
index 00000000000..f28e00f7f4c
--- /dev/null
+++ b/src/test/run-make/static-pie/test-aslr.rs
@@ -0,0 +1,43 @@
+const NUM_RUNS: usize = 10;
+
+fn run_self(exe: &str) -> usize {
+    use std::process::Command;
+    let mut set = std::collections::HashSet::new();
+
+    let mut cmd = Command::new(exe);
+    cmd.arg("--report");
+    (0..NUM_RUNS).for_each(|_| {
+        set.insert(cmd.output().expect("failed to execute process").stdout);
+    });
+    set.len()
+}
+
+fn main() {
+    let mut args = std::env::args();
+    let arg0 = args.next().unwrap();
+    match args.next() {
+        Some(s) if s.eq("--report") => {
+            println!("main = {:#?}", &main as *const _);
+        }
+        Some(s) if s.eq("--test-no-aslr") => {
+            let cnt = run_self(&arg0);
+            if cnt != 1 {
+                eprintln!("FAIL: {} most likely ASLR", arg0);
+                std::process::exit(1);
+            }
+            println!("PASS: {} does no ASLR", arg0);
+        }
+        Some(s) if s.eq("--test-aslr") => {
+            let cnt = run_self(&arg0);
+            if cnt != NUM_RUNS {
+                eprintln!("FAIL: {} most likely no ASLR", arg0);
+                std::process::exit(1);
+            }
+            println!("PASS: {} does ASLR", arg0);
+        }
+        Some(_) | None => {
+            println!("Usage: {} --test-no-aslr | --test-aslr", arg0);
+            std::process::exit(1);
+        }
+    }
+}
diff --git a/src/test/ui/cenum_impl_drop_cast.rs b/src/test/ui/cenum_impl_drop_cast.rs
new file mode 100644
index 00000000000..96e3d967e2c
--- /dev/null
+++ b/src/test/ui/cenum_impl_drop_cast.rs
@@ -0,0 +1,18 @@
+#![deny(cenum_impl_drop_cast)]
+
+enum E {
+    A = 0,
+}
+
+impl Drop for E {
+    fn drop(&mut self) {
+        println!("Drop");
+    }
+}
+
+fn main() {
+    let e = E::A;
+    let i = e as u32;
+    //~^ ERROR cannot cast enum `E` into integer `u32` because it implements `Drop`
+    //~| WARN this was previously accepted
+}
diff --git a/src/test/ui/cenum_impl_drop_cast.stderr b/src/test/ui/cenum_impl_drop_cast.stderr
new file mode 100644
index 00000000000..8d847a0c80b
--- /dev/null
+++ b/src/test/ui/cenum_impl_drop_cast.stderr
@@ -0,0 +1,16 @@
+error: cannot cast enum `E` into integer `u32` because it implements `Drop`
+  --> $DIR/cenum_impl_drop_cast.rs:15:13
+   |
+LL |     let i = e as u32;
+   |             ^^^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/cenum_impl_drop_cast.rs:1:9
+   |
+LL | #![deny(cenum_impl_drop_cast)]
+   |         ^^^^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #73333 <https://github.com/rust-lang/rust/issues/73333>
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/consts/const-eval/double_check2.stderr b/src/test/ui/consts/const-eval/double_check2.stderr
index 81fa5c0df13..93dd9a53ec9 100644
--- a/src/test/ui/consts/const-eval/double_check2.stderr
+++ b/src/test/ui/consts/const-eval/double_check2.stderr
@@ -5,7 +5,7 @@ LL | / static FOO: (&Foo, &Bar) = unsafe {(
 LL | |     Union { u8: &BAR }.foo,
 LL | |     Union { u8: &BAR }.bar,
 LL | | )};
-   | |___^ type validation failed: encountered 0x05 at .1.<deref>, but expected a valid enum discriminant
+   | |___^ type validation failed: encountered 0x05 at .1.<deref>, but expected a valid enum tag
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
 
diff --git a/src/test/ui/consts/const-eval/ub-enum.stderr b/src/test/ui/consts/const-eval/ub-enum.stderr
index e49fd3e0b97..1f7593c6db9 100644
--- a/src/test/ui/consts/const-eval/ub-enum.stderr
+++ b/src/test/ui/consts/const-eval/ub-enum.stderr
@@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value
   --> $DIR/ub-enum.rs:24:1
    |
 LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x00000001, but expected a valid enum discriminant
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x00000001, but expected a valid enum tag
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
 
@@ -26,7 +26,7 @@ error[E0080]: it is undefined behavior to use this value
   --> $DIR/ub-enum.rs:42:1
    |
 LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x00000000, but expected a valid enum discriminant
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x00000000, but expected a valid enum tag
    |
    = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
 
diff --git a/src/test/ui/layout/debug.stderr b/src/test/ui/layout/debug.stderr
index cd8ebdffb73..1a371c6b170 100644
--- a/src/test/ui/layout/debug.stderr
+++ b/src/test/ui/layout/debug.stderr
@@ -10,15 +10,15 @@ error: layout_of(E) = Layout {
         ],
     },
     variants: Multiple {
-        discr: Scalar {
+        tag: Scalar {
             value: Int(
                 I32,
                 false,
             ),
             valid_range: 0..=0,
         },
-        discr_kind: Tag,
-        discr_index: 0,
+        tag_encoding: Direct,
+        tag_field: 0,
         variants: [
             Layout {
                 fields: Arbitrary {
@@ -202,15 +202,15 @@ error: layout_of(std::result::Result<i32, i32>) = Layout {
         ],
     },
     variants: Multiple {
-        discr: Scalar {
+        tag: Scalar {
             value: Int(
                 I32,
                 false,
             ),
             valid_range: 0..=1,
         },
-        discr_kind: Tag,
-        discr_index: 0,
+        tag_encoding: Direct,
+        tag_field: 0,
         variants: [
             Layout {
                 fields: Arbitrary {
diff --git a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs
new file mode 100644
index 00000000000..3fb1cf9f557
--- /dev/null
+++ b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs
@@ -0,0 +1,6 @@
+#![feature(non_ascii_idents)]
+
+extern crate ьаг; //~ ERROR cannot load a crate with a non-ascii name `ьаг`
+//~| ERROR can't find crate for `ьаг`
+
+fn main() {}
diff --git a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr
new file mode 100644
index 00000000000..1e424237fd2
--- /dev/null
+++ b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr
@@ -0,0 +1,15 @@
+error: cannot load a crate with a non-ascii name `ьаг`
+  --> $DIR/crate_name_nonascii_forbidden-1.rs:3:1
+   |
+LL | extern crate ьаг;
+   | ^^^^^^^^^^^^^^^^^
+
+error[E0463]: can't find crate for `ьаг`
+  --> $DIR/crate_name_nonascii_forbidden-1.rs:3:1
+   |
+LL | extern crate ьаг;
+   | ^^^^^^^^^^^^^^^^^ can't find crate
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0463`.
diff --git a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs
new file mode 100644
index 00000000000..e1acdbff061
--- /dev/null
+++ b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs
@@ -0,0 +1,9 @@
+// compile-flags:--extern му_сгате
+// edition:2018
+#![feature(non_ascii_idents)]
+
+use му_сгате::baz; //~  ERROR cannot load a crate with a non-ascii name `му_сгате`
+                   //~| can't find crate for `му_сгате`
+
+
+fn main() {}
diff --git a/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr
new file mode 100644
index 00000000000..c06405ebb37
--- /dev/null
+++ b/src/test/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr
@@ -0,0 +1,15 @@
+error: cannot load a crate with a non-ascii name `му_сгате`
+  --> $DIR/crate_name_nonascii_forbidden-2.rs:5:5
+   |
+LL | use му_сгате::baz;
+   |     ^^^^^^^^
+
+error[E0463]: can't find crate for `му_сгате`
+  --> $DIR/crate_name_nonascii_forbidden-2.rs:5:5
+   |
+LL | use му_сгате::baz;
+   |     ^^^^^^^^ can't find crate
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0463`.