Skip to content

Commit c71484e

Browse files
committed
change error messages to be incorrect, but more helpful
1 parent 49dc0f2 commit c71484e

15 files changed

+15
-15
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
246246
self.dcx(),
247247
span,
248248
E0275,
249-
"overflow setting `{a}` to a subtype of `{b}`",
249+
"overflow assigning `{a}` to `{b}`",
250250
)
251251
}
252252
_ => {

tests/ui/impl-trait/issues/issue-84073.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ where
2929
}
3030

3131
fn main() {
32-
Race::new(|race| race.when()); //~ ERROR overflow setting `_` to a subtype of `Option<_>`
32+
Race::new(|race| race.when()); //~ ERROR overflow assigning `_` to `Option<_>`
3333
}

tests/ui/impl-trait/issues/issue-84073.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0275]: overflow setting `_` to a subtype of `Option<_>`
1+
error[E0275]: overflow assigning `_` to `Option<_>`
22
--> $DIR/issue-84073.rs:32:22
33
|
44
LL | Race::new(|race| race.when());

tests/ui/infinite/infinite-autoderef.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub fn main() {
1414
let mut x;
1515
loop {
1616
x = Box::new(x);
17-
//~^ ERROR overflow setting `Box<_>` to a subtype of `_`
17+
//~^ ERROR overflow assigning `Box<_>` to `_`
1818
x.foo;
1919
x.bar();
2020
}

tests/ui/infinite/infinite-autoderef.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0275]: overflow setting `Box<_>` to a subtype of `_`
1+
error[E0275]: overflow assigning `Box<_>` to `_`
22
--> $DIR/infinite-autoderef.rs:16:13
33
|
44
LL | x = Box::new(x);

tests/ui/occurs-check-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ fn main() {
55

66
g = f;
77
f = Box::new(g);
8-
//~^ ERROR overflow setting `Box<_>` to a subtype of `_`
8+
//~^ ERROR overflow assigning `Box<_>` to `_`
99
}

tests/ui/occurs-check-2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0275]: overflow setting `Box<_>` to a subtype of `_`
1+
error[E0275]: overflow assigning `Box<_>` to `_`
22
--> $DIR/occurs-check-2.rs:7:9
33
|
44
LL | f = Box::new(g);

tests/ui/occurs-check-3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ enum Clam<T> { A(T) }
44
fn main() {
55
let c;
66
c = Clam::A(c);
7-
//~^ ERROR overflow setting `Clam<_>` to a subtype of `_`
7+
//~^ ERROR overflow assigning `Clam<_>` to `_`
88
match c {
99
Clam::A::<isize>(_) => { }
1010
}

tests/ui/occurs-check-3.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0275]: overflow setting `Clam<_>` to a subtype of `_`
1+
error[E0275]: overflow assigning `Clam<_>` to `_`
22
--> $DIR/occurs-check-3.rs:6:9
33
|
44
LL | c = Clam::A(c);

tests/ui/occurs-check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn main() {
22
let f;
33
f = Box::new(f);
4-
//~^ ERROR overflow setting `Box<_>` to a subtype of `_`
4+
//~^ ERROR overflow assigning `Box<_>` to `_`
55
}

0 commit comments

Comments
 (0)