Demonstrate next-solver missing diagnostic
This commit is contained in:
parent
9c67cecd12
commit
055d31c7a5
4 changed files with 33 additions and 12 deletions
|
@ -1,16 +1,17 @@
|
||||||
//@ run-rustfix
|
//@[current] run-rustfix
|
||||||
|
//@ revisions: current next
|
||||||
|
//@[next] compile-flags: -Znext-solver
|
||||||
#![allow(unused_variables, dead_code)]
|
#![allow(unused_variables, dead_code)]
|
||||||
use std::collections::BTreeMap;
|
use std::collections::{BTreeMap, HashSet};
|
||||||
use std::collections::HashSet;
|
|
||||||
|
|
||||||
#[derive(Debug,Eq,PartialEq,Hash)]
|
#[derive(Debug, Eq, PartialEq, Hash)]
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
enum Day {
|
enum Day {
|
||||||
Mon,
|
Mon,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Class {
|
struct Class {
|
||||||
days: BTreeMap<u32, HashSet<Day>>
|
days: BTreeMap<u32, HashSet<Day>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Class {
|
impl Class {
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0308]: mismatched types
|
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();
|
LL | let mut x: HashSet<Day> = v.clone();
|
||||||
| ------------ ^^^^^^^^^ expected `HashSet<Day>`, found `&HashSet<Day>`
|
| ------------ ^^^^^^^^^ expected `HashSet<Day>`, found `&HashSet<Day>`
|
||||||
|
@ -9,7 +9,7 @@ LL | let mut x: HashSet<Day> = v.clone();
|
||||||
= note: expected struct `HashSet<_>`
|
= note: expected struct `HashSet<_>`
|
||||||
found reference `&HashSet<_>`
|
found reference `&HashSet<_>`
|
||||||
note: `HashSet<Day>` does not implement `Clone`, so `&HashSet<Day>` was cloned instead
|
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();
|
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,15 +1,16 @@
|
||||||
//@ run-rustfix
|
//@[current] run-rustfix
|
||||||
|
//@ revisions: current next
|
||||||
|
//@[next] compile-flags: -Znext-solver
|
||||||
#![allow(unused_variables, dead_code)]
|
#![allow(unused_variables, dead_code)]
|
||||||
use std::collections::BTreeMap;
|
use std::collections::{BTreeMap, HashSet};
|
||||||
use std::collections::HashSet;
|
|
||||||
|
|
||||||
#[derive(Debug,Eq,PartialEq,Hash)]
|
#[derive(Debug, Eq, PartialEq, Hash)]
|
||||||
enum Day {
|
enum Day {
|
||||||
Mon,
|
Mon,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Class {
|
struct Class {
|
||||||
days: BTreeMap<u32, HashSet<Day>>
|
days: BTreeMap<u32, HashSet<Day>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Class {
|
impl Class {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue