about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <github333195615777966@oli-obk.de>2025-03-17 08:58:08 +0000
committerOli Scherer <github333195615777966@oli-obk.de>2025-03-19 14:38:23 +0000
commit055d31c7a5aa2ef642d3d390665ba52e36a7895c (patch)
tree5e7a2ab974b8537be6bba0c78d3c5276b23f919b
parent9c67cecd12d79f1bbc00a74f70e7ef9fff086a5a (diff)
downloadrust-055d31c7a5aa2ef642d3d390665ba52e36a7895c.tar.gz
rust-055d31c7a5aa2ef642d3d390665ba52e36a7895c.zip
Demonstrate next-solver missing diagnostic
-rw-r--r--tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.current.fixed (renamed from tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.fixed)11
-rw-r--r--tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.current.stderr (renamed from tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.stderr)4
-rw-r--r--tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.next.stderr19
-rw-r--r--tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.rs11
4 files changed, 33 insertions, 12 deletions
diff --git a/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.fixed b/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.current.fixed
index 85b1853c23b..4a27c66b89e 100644
--- a/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.fixed
+++ b/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.current.fixed
@@ -1,16 +1,17 @@
-//@ run-rustfix
+//@[current] run-rustfix
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
 #![allow(unused_variables, dead_code)]
-use std::collections::BTreeMap;
-use std::collections::HashSet;
+use std::collections::{BTreeMap, HashSet};
 
-#[derive(Debug,Eq,PartialEq,Hash)]
+#[derive(Debug, Eq, PartialEq, Hash)]
 #[derive(Clone)]
 enum Day {
     Mon,
 }
 
 struct Class {
-    days: BTreeMap<u32, HashSet<Day>>
+    days: BTreeMap<u32, HashSet<Day>>,
 }
 
 impl Class {
diff --git a/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.stderr b/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.current.stderr
index 6a9d76f7998..301f3c3a458 100644
--- a/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.stderr
+++ b/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.current.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:18:39
+  --> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:19:39
    |
 LL |             let mut x: HashSet<Day> = v.clone();
    |                        ------------   ^^^^^^^^^ expected `HashSet<Day>`, found `&HashSet<Day>`
@@ -9,7 +9,7 @@ LL |             let mut x: HashSet<Day> = v.clone();
    = note: expected struct `HashSet<_>`
            found reference `&HashSet<_>`
 note: `HashSet<Day>` does not implement `Clone`, so `&HashSet<Day>` was cloned instead
-  --> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:18:39
+  --> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:19:39
    |
 LL |             let mut x: HashSet<Day> = v.clone();
    |                                       ^
diff --git a/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.next.stderr b/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.next.stderr
new file mode 100644
index 00000000000..4e71c57ea1a
--- /dev/null
+++ b/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.next.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+  --> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:19:39
+   |
+LL |             let mut x: HashSet<Day> = v.clone();
+   |                        ------------   ^^^^^^^^^ expected `HashSet<Day>`, found `&HashSet<Day>`
+   |                        |
+   |                        expected due to this
+   |
+   = note: expected struct `HashSet<_>`
+           found reference `&HashSet<_>`
+note: `HashSet<Day>` does not implement `Clone`, so `&HashSet<Day>` was cloned instead
+  --> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:19:39
+   |
+LL |             let mut x: HashSet<Day> = v.clone();
+   |                                       ^
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.rs b/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.rs
index 740cda470d9..7fadbce2b98 100644
--- a/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.rs
+++ b/tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.rs
@@ -1,15 +1,16 @@
-//@ run-rustfix
+//@[current] run-rustfix
+//@ revisions: current next
+//@[next] compile-flags: -Znext-solver
 #![allow(unused_variables, dead_code)]
-use std::collections::BTreeMap;
-use std::collections::HashSet;
+use std::collections::{BTreeMap, HashSet};
 
-#[derive(Debug,Eq,PartialEq,Hash)]
+#[derive(Debug, Eq, PartialEq, Hash)]
 enum Day {
     Mon,
 }
 
 struct Class {
-    days: BTreeMap<u32, HashSet<Day>>
+    days: BTreeMap<u32, HashSet<Day>>,
 }
 
 impl Class {