about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-02-21 14:56:04 +0000
committerbors <bors@rust-lang.org>2025-02-21 14:56:04 +0000
commit71e06b9c59d6af50fdc55aed75620493d29baf98 (patch)
tree1bcad1953bae13a0114731ea8d0962abea2f3abf /tests
parent9f48dedc9763334a587c66558974635807a113ed (diff)
parent636f4f19d84237de41974ef17c77ac915b380790 (diff)
downloadrust-71e06b9c59d6af50fdc55aed75620493d29baf98.tar.gz
rust-71e06b9c59d6af50fdc55aed75620493d29baf98.zip
Auto merge of #137371 - matthiaskrgr:rollup-3qkdqar, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #128080 (Specify scope in `out_of_scope_macro_calls` lint)
 - #135630 (add more `s390x` target features)
 - #136089 (Reduce `Box::default` stack copies in debug mode)
 - #137204 (Clarify MIR dialects and phases)
 - #137299 (Simplify `Postorder` customization.)
 - #137302 (Use a probe to avoid registering stray region obligations when re-checking drops in MIR typeck)
 - #137305 (Tweaks in and around `rustc_middle`)
 - #137313 (Some codegen_llvm cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
-rw-r--r--tests/codegen/box-default-debug-copies.rs28
-rw-r--r--tests/ui/attributes/key-value-expansion-scope.rs12
-rw-r--r--tests/ui/attributes/key-value-expansion-scope.stderr24
-rw-r--r--tests/ui/borrowck/bad-drop-side-effects.rs18
-rw-r--r--tests/ui/borrowck/bad-drop-side-effects.stderr9
-rw-r--r--tests/ui/check-cfg/target_feature.stderr11
6 files changed, 84 insertions, 18 deletions
diff --git a/tests/codegen/box-default-debug-copies.rs b/tests/codegen/box-default-debug-copies.rs
new file mode 100644
index 00000000000..06cc41b21c0
--- /dev/null
+++ b/tests/codegen/box-default-debug-copies.rs
@@ -0,0 +1,28 @@
+//@ compile-flags: -Copt-level=0
+
+// Test to make sure that `<Box<T>>::default` does not create too many copies of `T` on the stack.
+// in debug mode. This regressed in dd0620b86721ae8cae86736443acd3f72ba6fc32 to
+// four `T` allocas.
+//
+// See https://github.com/rust-lang/rust/issues/136043 for more context.
+//
+// FIXME: This test only wants to ensure that there are at most two allocas of `T` created, instead
+// of checking for exactly two.
+
+#![crate_type = "lib"]
+
+#[allow(dead_code)]
+pub struct Thing([u8; 1000000]);
+
+impl Default for Thing {
+    fn default() -> Self {
+        Thing([0; 1000000])
+    }
+}
+
+// CHECK-COUNT-2: %{{.*}} = alloca {{.*}}1000000
+// CHECK-NOT: %{{.*}} = alloca {{.*}}1000000
+#[no_mangle]
+pub fn box_default_single_copy() -> Box<Thing> {
+    Box::default()
+}
diff --git a/tests/ui/attributes/key-value-expansion-scope.rs b/tests/ui/attributes/key-value-expansion-scope.rs
index b6eab1571d4..49a59502377 100644
--- a/tests/ui/attributes/key-value-expansion-scope.rs
+++ b/tests/ui/attributes/key-value-expansion-scope.rs
@@ -1,7 +1,7 @@
-#![doc = in_root!()] //~ WARN cannot find macro `in_root` in this scope
+#![doc = in_root!()] //~ WARN cannot find macro `in_root`
                      //~| WARN this was previously accepted by the compiler
 #![doc = in_mod!()] //~ ERROR cannot find macro `in_mod` in this scope
-#![doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape` in this scope
+#![doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape`
                            //~| WARN this was previously accepted by the compiler
 #![doc = in_block!()] //~ ERROR cannot find macro `in_block` in this scope
 
@@ -18,10 +18,10 @@ fn before() {
 
 macro_rules! in_root { () => { "" } }
 
-#[doc = in_mod!()] //~ WARN cannot find macro `in_mod` in this scope
+#[doc = in_mod!()] //~ WARN cannot find macro `in_mod`
                    //~| WARN this was previously accepted by the compiler
 mod macros_stay {
-    #![doc = in_mod!()] //~ WARN cannot find macro `in_mod` in this scope
+    #![doc = in_mod!()] //~ WARN cannot find macro `in_mod`
                         //~| WARN this was previously accepted by the compiler
 
     macro_rules! in_mod { () => { "" } }
@@ -33,10 +33,10 @@ mod macros_stay {
 }
 
 #[macro_use]
-#[doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape` in this scope
+#[doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape`
                           //~| WARN this was previously accepted by the compiler
 mod macros_escape {
-    #![doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape` in this scope
+    #![doc = in_mod_escape!()] //~ WARN cannot find macro `in_mod_escape`
                                //~| WARN this was previously accepted by the compiler
 
     macro_rules! in_mod_escape { () => { "" } }
diff --git a/tests/ui/attributes/key-value-expansion-scope.stderr b/tests/ui/attributes/key-value-expansion-scope.stderr
index d22fef7dd25..91a602e57d9 100644
--- a/tests/ui/attributes/key-value-expansion-scope.stderr
+++ b/tests/ui/attributes/key-value-expansion-scope.stderr
@@ -126,62 +126,62 @@ LL |     #![doc = in_block!()]
    |
    = help: have you added the `#[macro_use]` on the module/import?
 
-warning: cannot find macro `in_root` in this scope
+warning: cannot find macro `in_root` in the current scope when looking from the crate root
   --> $DIR/key-value-expansion-scope.rs:1:10
    |
 LL | #![doc = in_root!()]
-   |          ^^^^^^^
+   |          ^^^^^^^ not found from the crate root
    |
    = 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 #124535 <https://github.com/rust-lang/rust/issues/124535>
    = help: import `macro_rules` with `use` to make it callable above its definition
    = note: `#[warn(out_of_scope_macro_calls)]` on by default
 
-warning: cannot find macro `in_mod_escape` in this scope
+warning: cannot find macro `in_mod_escape` in the current scope when looking from the crate root
   --> $DIR/key-value-expansion-scope.rs:4:10
    |
 LL | #![doc = in_mod_escape!()]
-   |          ^^^^^^^^^^^^^
+   |          ^^^^^^^^^^^^^ not found from the crate root
    |
    = 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 #124535 <https://github.com/rust-lang/rust/issues/124535>
    = help: import `macro_rules` with `use` to make it callable above its definition
 
-warning: cannot find macro `in_mod` in this scope
+warning: cannot find macro `in_mod` in the current scope when looking from module `macros_stay`
   --> $DIR/key-value-expansion-scope.rs:21:9
    |
 LL | #[doc = in_mod!()]
-   |         ^^^^^^
+   |         ^^^^^^ not found from module `macros_stay`
    |
    = 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 #124535 <https://github.com/rust-lang/rust/issues/124535>
    = help: import `macro_rules` with `use` to make it callable above its definition
 
-warning: cannot find macro `in_mod` in this scope
+warning: cannot find macro `in_mod` in the current scope when looking from module `macros_stay`
   --> $DIR/key-value-expansion-scope.rs:24:14
    |
 LL |     #![doc = in_mod!()]
-   |              ^^^^^^
+   |              ^^^^^^ not found from module `macros_stay`
    |
    = 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 #124535 <https://github.com/rust-lang/rust/issues/124535>
    = help: import `macro_rules` with `use` to make it callable above its definition
 
-warning: cannot find macro `in_mod_escape` in this scope
+warning: cannot find macro `in_mod_escape` in the current scope when looking from module `macros_escape`
   --> $DIR/key-value-expansion-scope.rs:36:9
    |
 LL | #[doc = in_mod_escape!()]
-   |         ^^^^^^^^^^^^^
+   |         ^^^^^^^^^^^^^ not found from module `macros_escape`
    |
    = 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 #124535 <https://github.com/rust-lang/rust/issues/124535>
    = help: import `macro_rules` with `use` to make it callable above its definition
 
-warning: cannot find macro `in_mod_escape` in this scope
+warning: cannot find macro `in_mod_escape` in the current scope when looking from module `macros_escape`
   --> $DIR/key-value-expansion-scope.rs:39:14
    |
 LL |     #![doc = in_mod_escape!()]
-   |              ^^^^^^^^^^^^^
+   |              ^^^^^^^^^^^^^ not found from module `macros_escape`
    |
    = 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 #124535 <https://github.com/rust-lang/rust/issues/124535>
diff --git a/tests/ui/borrowck/bad-drop-side-effects.rs b/tests/ui/borrowck/bad-drop-side-effects.rs
new file mode 100644
index 00000000000..a09b7087608
--- /dev/null
+++ b/tests/ui/borrowck/bad-drop-side-effects.rs
@@ -0,0 +1,18 @@
+// Regression test for <https://github.com/rust-lang/rust/issues/137288>.
+
+trait B {
+    type C;
+}
+
+impl<U> B for &Missing {
+//~^ ERROR cannot find type `Missing` in this scope
+    type C = ();
+}
+
+struct E<T: B> {
+    g: <T as B>::C,
+}
+
+fn h(i: Box<E<&()>>) {}
+
+fn main() {}
diff --git a/tests/ui/borrowck/bad-drop-side-effects.stderr b/tests/ui/borrowck/bad-drop-side-effects.stderr
new file mode 100644
index 00000000000..0a5998c7e48
--- /dev/null
+++ b/tests/ui/borrowck/bad-drop-side-effects.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `Missing` in this scope
+  --> $DIR/bad-drop-side-effects.rs:7:16
+   |
+LL | impl<U> B for &Missing {
+   |                ^^^^^^^ not found in this scope
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0412`.
diff --git a/tests/ui/check-cfg/target_feature.stderr b/tests/ui/check-cfg/target_feature.stderr
index 70852423bdb..51808c5c7bc 100644
--- a/tests/ui/check-cfg/target_feature.stderr
+++ b/tests/ui/check-cfg/target_feature.stderr
@@ -58,6 +58,7 @@ LL |     cfg!(target_feature = "_UNEXPECTED_VALUE");
 `cssc`
 `d`
 `d32`
+`deflate-conversion`
 `dit`
 `doloop`
 `dotprod`
@@ -72,6 +73,7 @@ LL |     cfg!(target_feature = "_UNEXPECTED_VALUE");
 `ecv`
 `edsp`
 `elrw`
+`enhanced-sort`
 `ermsb`
 `exception-handling`
 `extended-const`
@@ -109,11 +111,13 @@ LL |     cfg!(target_feature = "_UNEXPECTED_VALUE");
 `frintts`
 `fxsr`
 `gfni`
+`guarded-storage`
 `hard-float`
 `hard-float-abi`
 `hard-tp`
 `hbc`
 `high-registers`
+`high-word`
 `hvx`
 `hvx-length128b`
 `hwdiv`
@@ -151,6 +155,7 @@ LL |     cfg!(target_feature = "_UNEXPECTED_VALUE");
 `multivalue`
 `mutable-globals`
 `neon`
+`nnp-assist`
 `nontrapping-fptoint`
 `nvic`
 `paca`
@@ -229,6 +234,7 @@ LL |     cfg!(target_feature = "_UNEXPECTED_VALUE");
 `thumb-mode`
 `thumb2`
 `tme`
+`transactional-execution`
 `trust`
 `trustzone`
 `ual`
@@ -262,6 +268,11 @@ LL |     cfg!(target_feature = "_UNEXPECTED_VALUE");
 `vdspv1`
 `vdspv2`
 `vector`
+`vector-enhancements-1`
+`vector-enhancements-2`
+`vector-packed-decimal`
+`vector-packed-decimal-enhancement`
+`vector-packed-decimal-enhancement-2`
 `vfp2`
 `vfp3`
 `vfp4`