about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-26 13:52:50 +0000
committerbors <bors@rust-lang.org>2025-07-26 13:52:50 +0000
commit133798f9fb2887bcccf1098937540e280dd58465 (patch)
treedf34122479708d436ecd1859616975aecd42de8e /tests
parent8708f3cd1f96d226f6420a58ebdd61aa0bc08b0a (diff)
parent429cc9a0dd6b3047c2bc88d5df1a3e34981336be (diff)
downloadrust-133798f9fb2887bcccf1098937540e280dd58465.tar.gz
rust-133798f9fb2887bcccf1098937540e280dd58465.zip
Auto merge of #144502 - matthiaskrgr:rollup-o81uk9m, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#144331 (Disable non_exhaustive_omitted_patterns within matches! macro)
 - rust-lang/rust#144376 (Suggest unwrapping when private method name is available in inner type)
 - rust-lang/rust#144421 (Call `is_parsed_attribute` rather than keeping track of a list of parsed attributes manually)
 - rust-lang/rust#144424 (Allow setting `release-blog-post` label with rustbot)
 - rust-lang/rust#144427 (rename ext_tool_checks to extra_checks and use mod.rs)
 - rust-lang/rust#144435 (rustc-dev-guide subtree update)
 - rust-lang/rust#144448 (Limit defaultness query to impl of trait)
 - rust-lang/rust#144462 (Allow pretty printing paths with `-Zself-profile-events=args`)
 - rust-lang/rust#144463 (change_tracker: fix a typo)
 - rust-lang/rust#144468 (resolve: Do not create `NameResolutions` on access unless necessary)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
-rw-r--r--tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-abort.mir6
-rw-r--r--tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-unwind.mir6
-rw-r--r--tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-abort.mir6
-rw-r--r--tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-unwind.mir6
-rw-r--r--tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff2
-rw-r--r--tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir4
-rw-r--r--tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir4
-rw-r--r--tests/mir-opt/pre-codegen/matches_macro.issue_77355_opt.PreCodegen.after.mir2
-rw-r--r--tests/ui/README.md4
-rw-r--r--tests/ui/self-profile/pretty_print_no_ice.rs14
-rw-r--r--tests/ui/suggestions/enum-method-probe.fixed7
-rw-r--r--tests/ui/suggestions/enum-method-probe.rs7
-rw-r--r--tests/ui/suggestions/enum-method-probe.stderr21
13 files changed, 77 insertions, 12 deletions
diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-abort.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-abort.mir
index 5876c55c52b..b5c23822162 100644
--- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-abort.mir
+++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-abort.mir
@@ -8,12 +8,14 @@ fn num_to_digit(_1: char) -> u32 {
         let _2: std::option::Option<u32>;
         scope 2 (inlined Option::<u32>::is_some) {
             let mut _3: isize;
+            scope 3 {
+            }
         }
     }
-    scope 3 (inlined #[track_caller] Option::<u32>::unwrap) {
+    scope 4 (inlined #[track_caller] Option::<u32>::unwrap) {
         let mut _5: isize;
         let mut _6: !;
-        scope 4 {
+        scope 5 {
         }
     }
 
diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-unwind.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-unwind.mir
index f1185353a43..f22b8835735 100644
--- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-unwind.mir
+++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.32bit.panic-unwind.mir
@@ -8,12 +8,14 @@ fn num_to_digit(_1: char) -> u32 {
         let _2: std::option::Option<u32>;
         scope 2 (inlined Option::<u32>::is_some) {
             let mut _3: isize;
+            scope 3 {
+            }
         }
     }
-    scope 3 (inlined #[track_caller] Option::<u32>::unwrap) {
+    scope 4 (inlined #[track_caller] Option::<u32>::unwrap) {
         let mut _5: isize;
         let mut _6: !;
-        scope 4 {
+        scope 5 {
         }
     }
 
diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-abort.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-abort.mir
index 5876c55c52b..b5c23822162 100644
--- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-abort.mir
+++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-abort.mir
@@ -8,12 +8,14 @@ fn num_to_digit(_1: char) -> u32 {
         let _2: std::option::Option<u32>;
         scope 2 (inlined Option::<u32>::is_some) {
             let mut _3: isize;
+            scope 3 {
+            }
         }
     }
-    scope 3 (inlined #[track_caller] Option::<u32>::unwrap) {
+    scope 4 (inlined #[track_caller] Option::<u32>::unwrap) {
         let mut _5: isize;
         let mut _6: !;
-        scope 4 {
+        scope 5 {
         }
     }
 
diff --git a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-unwind.mir b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-unwind.mir
index f1185353a43..f22b8835735 100644
--- a/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-unwind.mir
+++ b/tests/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.64bit.panic-unwind.mir
@@ -8,12 +8,14 @@ fn num_to_digit(_1: char) -> u32 {
         let _2: std::option::Option<u32>;
         scope 2 (inlined Option::<u32>::is_some) {
             let mut _3: isize;
+            scope 3 {
+            }
         }
     }
-    scope 3 (inlined #[track_caller] Option::<u32>::unwrap) {
+    scope 4 (inlined #[track_caller] Option::<u32>::unwrap) {
         let mut _5: isize;
         let mut _6: !;
-        scope 4 {
+        scope 5 {
         }
     }
 
diff --git a/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff b/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff
index 281f43b355d..3ce82fd0d47 100644
--- a/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff
+++ b/tests/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff
@@ -7,6 +7,8 @@
       let mut _2: bool;
       let mut _3: isize;
 +     let mut _4: isize;
+      scope 1 {
+      }
   
       bb0: {
           StorageLive(_2);
diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir
index 1a1c8b4b942..83478e60b5d 100644
--- a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir
+++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-abort.mir
@@ -25,9 +25,11 @@ fn step_forward(_1: u16, _2: usize) -> u16 {
         }
         scope 8 (inlined Option::<u16>::is_none) {
             scope 9 (inlined Option::<u16>::is_some) {
+                scope 10 {
+                }
             }
         }
-        scope 10 (inlined core::num::<impl u16>::wrapping_add) {
+        scope 11 (inlined core::num::<impl u16>::wrapping_add) {
         }
     }
 
diff --git a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir
index e7e19af048a..ac7a6e04451 100644
--- a/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir
+++ b/tests/mir-opt/pre-codegen/checked_ops.step_forward.PreCodegen.after.panic-unwind.mir
@@ -25,9 +25,11 @@ fn step_forward(_1: u16, _2: usize) -> u16 {
         }
         scope 8 (inlined Option::<u16>::is_none) {
             scope 9 (inlined Option::<u16>::is_some) {
+                scope 10 {
+                }
             }
         }
-        scope 10 (inlined core::num::<impl u16>::wrapping_add) {
+        scope 11 (inlined core::num::<impl u16>::wrapping_add) {
         }
     }
 
diff --git a/tests/mir-opt/pre-codegen/matches_macro.issue_77355_opt.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/matches_macro.issue_77355_opt.PreCodegen.after.mir
index d41135c6a4f..2d6f82f6137 100644
--- a/tests/mir-opt/pre-codegen/matches_macro.issue_77355_opt.PreCodegen.after.mir
+++ b/tests/mir-opt/pre-codegen/matches_macro.issue_77355_opt.PreCodegen.after.mir
@@ -4,6 +4,8 @@ fn issue_77355_opt(_1: Foo) -> u64 {
     debug num => _1;
     let mut _0: u64;
     let mut _2: isize;
+    scope 1 {
+    }
 
     bb0: {
         _2 = discriminant(_1);
diff --git a/tests/ui/README.md b/tests/ui/README.md
index b635b6326fc..be387e220f6 100644
--- a/tests/ui/README.md
+++ b/tests/ui/README.md
@@ -1233,6 +1233,10 @@ Exercises sanitizer support. See [Sanitizer | The rustc book](https://doc.rust-l
 
 Tests with erroneous ways of using `self`, such as using `this.x` syntax as seen in other languages, having it not be the first argument, or using it in a non-associated function (no `impl` or `trait`). It also contains correct uses of `self` which have previously been observed to cause ICEs.
 
+## `tests/ui/self-profile/`: self-profiling
+
+Tests related to the self-profiler (`-Zself-profile`) functionality of rustc.
+
 ## `tests/ui/sepcomp/`: Separate Compilation
 
 In this directory, multiple crates are compiled, but some of them have `inline` functions, meaning they must be inlined into a different crate despite having been compiled separately.
diff --git a/tests/ui/self-profile/pretty_print_no_ice.rs b/tests/ui/self-profile/pretty_print_no_ice.rs
new file mode 100644
index 00000000000..71b15e82650
--- /dev/null
+++ b/tests/ui/self-profile/pretty_print_no_ice.rs
@@ -0,0 +1,14 @@
+// Checks that when we use `-Zself-profile-events=args`, it is possible to pretty print paths
+// using `trimmed_def_paths` even without producing diagnostics.
+//
+// Issue: <https://github.com/rust-lang/rust/issues/144457>.
+
+//@ compile-flags: -Zself-profile={{build-base}} -Zself-profile-events=args
+//@ build-pass
+
+use std::sync::atomic::AtomicUsize;
+use std::sync::atomic::Ordering::Relaxed;
+
+fn main() {
+    AtomicUsize::new(0).load(Relaxed);
+}
diff --git a/tests/ui/suggestions/enum-method-probe.fixed b/tests/ui/suggestions/enum-method-probe.fixed
index e097fa8cc1d..b7fd6f112d5 100644
--- a/tests/ui/suggestions/enum-method-probe.fixed
+++ b/tests/ui/suggestions/enum-method-probe.fixed
@@ -56,4 +56,11 @@ fn test_option_in_unit_return() {
     //~| HELP consider using `Option::expect` to unwrap the `Foo` value, panicking if the value is an `Option::None`
 }
 
+fn test_option_private_method() {
+    let res: Option<_> = Some(vec![1, 2, 3]);
+    res.expect("REASON").len();
+    //~^ ERROR method `len` is private
+    //~| HELP consider using `Option::expect` to unwrap the `Vec<{integer}>` value, panicking if the value is an `Option::None`
+}
+
 fn main() {}
diff --git a/tests/ui/suggestions/enum-method-probe.rs b/tests/ui/suggestions/enum-method-probe.rs
index 665ee7d0aaa..cbb819b7c8c 100644
--- a/tests/ui/suggestions/enum-method-probe.rs
+++ b/tests/ui/suggestions/enum-method-probe.rs
@@ -56,4 +56,11 @@ fn test_option_in_unit_return() {
     //~| HELP consider using `Option::expect` to unwrap the `Foo` value, panicking if the value is an `Option::None`
 }
 
+fn test_option_private_method() {
+    let res: Option<_> = Some(vec![1, 2, 3]);
+    res.len();
+    //~^ ERROR method `len` is private
+    //~| HELP consider using `Option::expect` to unwrap the `Vec<{integer}>` value, panicking if the value is an `Option::None`
+}
+
 fn main() {}
diff --git a/tests/ui/suggestions/enum-method-probe.stderr b/tests/ui/suggestions/enum-method-probe.stderr
index 6ed14984f47..e66973d9d95 100644
--- a/tests/ui/suggestions/enum-method-probe.stderr
+++ b/tests/ui/suggestions/enum-method-probe.stderr
@@ -94,6 +94,23 @@ help: consider using `Option::expect` to unwrap the `Foo` value, panicking if th
 LL |     res.expect("REASON").get();
    |        +++++++++++++++++
 
-error: aborting due to 6 previous errors
+error[E0624]: method `len` is private
+  --> $DIR/enum-method-probe.rs:61:9
+   |
+LL |     res.len();
+   |         ^^^ private method
+  --> $SRC_DIR/core/src/option.rs:LL:COL
+   |
+   = note: private method defined here
+   |
+note: the method `len` exists on the type `Vec<{integer}>`
+  --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+help: consider using `Option::expect` to unwrap the `Vec<{integer}>` value, panicking if the value is an `Option::None`
+   |
+LL |     res.expect("REASON").len();
+   |        +++++++++++++++++
+
+error: aborting due to 7 previous errors
 
-For more information about this error, try `rustc --explain E0599`.
+Some errors have detailed explanations: E0599, E0624.
+For more information about an error, try `rustc --explain E0599`.