Demonstrate next-solver missing diagnostic
This commit is contained in:
parent
9c67cecd12
commit
055d31c7a5
4 changed files with 33 additions and 12 deletions
|
@ -1,7 +1,8 @@
|
|||
//@ 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(Clone)]
|
||||
|
@ -10,7 +11,7 @@ enum Day {
|
|||
}
|
||||
|
||||
struct Class {
|
||||
days: BTreeMap<u32, HashSet<Day>>
|
||||
days: BTreeMap<u32, HashSet<Day>>,
|
||||
}
|
||||
|
||||
impl Class {
|
|
@ -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();
|
||||
| ^
|
|
@ -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`.
|
|
@ -1,7 +1,8 @@
|
|||
//@ 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)]
|
||||
enum Day {
|
||||
|
@ -9,7 +10,7 @@ enum Day {
|
|||
}
|
||||
|
||||
struct Class {
|
||||
days: BTreeMap<u32, HashSet<Day>>
|
||||
days: BTreeMap<u32, HashSet<Day>>,
|
||||
}
|
||||
|
||||
impl Class {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue