Skip to content

Commit 055d31c

Browse files
committed
Demonstrate next-solver missing diagnostic
1 parent 9c67cec commit 055d31c

4 files changed

+33
-12
lines changed

tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.fixed renamed to tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.current.fixed

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
//@ run-rustfix
1+
//@[current] run-rustfix
2+
//@ revisions: current next
3+
//@[next] compile-flags: -Znext-solver
24
#![allow(unused_variables, dead_code)]
3-
use std::collections::BTreeMap;
4-
use std::collections::HashSet;
5+
use std::collections::{BTreeMap, HashSet};
56

6-
#[derive(Debug,Eq,PartialEq,Hash)]
7+
#[derive(Debug, Eq, PartialEq, Hash)]
78
#[derive(Clone)]
89
enum Day {
910
Mon,
1011
}
1112

1213
struct Class {
13-
days: BTreeMap<u32, HashSet<Day>>
14+
days: BTreeMap<u32, HashSet<Day>>,
1415
}
1516

1617
impl Class {

tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.stderr renamed to tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.current.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:18:39
2+
--> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:19:39
33
|
44
LL | let mut x: HashSet<Day> = v.clone();
55
| ------------ ^^^^^^^^^ expected `HashSet<Day>`, found `&HashSet<Day>`
@@ -9,7 +9,7 @@ LL | let mut x: HashSet<Day> = v.clone();
99
= note: expected struct `HashSet<_>`
1010
found reference `&HashSet<_>`
1111
note: `HashSet<Day>` does not implement `Clone`, so `&HashSet<Day>` was cloned instead
12-
--> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:18:39
12+
--> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:19:39
1313
|
1414
LL | let mut x: HashSet<Day> = v.clone();
1515
| ^
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:19:39
3+
|
4+
LL | let mut x: HashSet<Day> = v.clone();
5+
| ------------ ^^^^^^^^^ expected `HashSet<Day>`, found `&HashSet<Day>`
6+
| |
7+
| expected due to this
8+
|
9+
= note: expected struct `HashSet<_>`
10+
found reference `&HashSet<_>`
11+
note: `HashSet<Day>` does not implement `Clone`, so `&HashSet<Day>` was cloned instead
12+
--> $DIR/assignment-of-clone-call-on-ref-due-to-missing-bound.rs:19:39
13+
|
14+
LL | let mut x: HashSet<Day> = v.clone();
15+
| ^
16+
17+
error: aborting due to 1 previous error
18+
19+
For more information about this error, try `rustc --explain E0308`.

tests/ui/moves/assignment-of-clone-call-on-ref-due-to-missing-bound.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
//@ run-rustfix
1+
//@[current] run-rustfix
2+
//@ revisions: current next
3+
//@[next] compile-flags: -Znext-solver
24
#![allow(unused_variables, dead_code)]
3-
use std::collections::BTreeMap;
4-
use std::collections::HashSet;
5+
use std::collections::{BTreeMap, HashSet};
56

6-
#[derive(Debug,Eq,PartialEq,Hash)]
7+
#[derive(Debug, Eq, PartialEq, Hash)]
78
enum Day {
89
Mon,
910
}
1011

1112
struct Class {
12-
days: BTreeMap<u32, HashSet<Day>>
13+
days: BTreeMap<u32, HashSet<Day>>,
1314
}
1415

1516
impl Class {

0 commit comments

Comments
 (0)