Skip to content

Commit 73ba1de

Browse files
committed
cannot find type
1 parent a3964c2 commit 73ba1de

31 files changed

+41
-40
lines changed

compiler/rustc_resolve/src/diagnostics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2501,6 +2501,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
25012501
)
25022502
});
25032503

2504+
let message = format!("cannot find type `{ident}` in {scope}");
25042505
(message, format!("use of undeclared type `{ident}`"), suggestion)
25052506
} else {
25062507
let mut suggestion = None;

tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
fn main() {
66
let mut a = E::StructVar { boxed: Box::new(5_i32) };
7-
//~^ ERROR cannot find `E`
7+
//~^ ERROR cannot find type `E`
88
match a {
99
E::StructVar { box boxed } => { }
10-
//~^ ERROR cannot find `E`
10+
//~^ ERROR cannot find type `E`
1111
}
1212
}

tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0433]: cannot find `E` in this scope
1+
error[E0433]: cannot find type `E` in this scope
22
--> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:6:17
33
|
44
LL | let mut a = E::StructVar { boxed: Box::new(5_i32) };
@@ -7,7 +7,7 @@ LL | let mut a = E::StructVar { boxed: Box::new(5_i32) };
77
| use of undeclared type `E`
88
| help: a trait with a similar name exists: `Eq`
99

10-
error[E0433]: cannot find `E` in this scope
10+
error[E0433]: cannot find type `E` in this scope
1111
--> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:9:9
1212
|
1313
LL | E::StructVar { box boxed } => { }

tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ error: defaults for generic parameters are not allowed in `for<...>` binders
4343
LL | for<const N: usize = 3, T = u32> [(); COT::BYTES]:,
4444
| ^^^^^^^
4545

46-
error[E0433]: cannot find `COT` in this scope
46+
error[E0433]: cannot find type `COT` in this scope
4747
--> $DIR/ice-predicates-of-no-entry-found-for-key-119275.rs:10:43
4848
|
4949
LL | for<const N: usize = 3, T = u32> [(); COT::BYTES]:,

tests/ui/const-generics/issues/issue-82956.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0433]: cannot find `IntoIter` in this scope
1+
error[E0433]: cannot find type `IntoIter` in this scope
22
--> $DIR/issue-82956.rs:25:24
33
|
44
LL | let mut iter = IntoIter::new(self);

tests/ui/consts/const_refs_to_static-ice-121413.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0433]: cannot find `AtomicUsize` in this scope
1+
error[E0433]: cannot find type `AtomicUsize` in this scope
22
--> $DIR/const_refs_to_static-ice-121413.rs:8:24
33
|
44
LL | static FOO: Sync = AtomicUsize::new(0);

tests/ui/derived-errors/issue-31997-1.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0433]: cannot find `HashMap` in this scope
1+
error[E0433]: cannot find type `HashMap` in this scope
22
--> $DIR/issue-31997-1.rs:20:19
33
|
44
LL | let mut map = HashMap::new();

tests/ui/error-codes/E0433.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0433]: cannot find `NonExistingMap` in this scope
1+
error[E0433]: cannot find type `NonExistingMap` in this scope
22
--> $DIR/E0433.rs:2:15
33
|
44
LL | let map = NonExistingMap::new();

tests/ui/generic-associated-types/equality-bound.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn sum2<I: Iterator>(i: I) -> i32 where I::Item = i32 {
88
}
99
fn sum3<J: Iterator>(i: J) -> i32 where I::Item = i32 {
1010
//~^ ERROR equality constraints are not yet supported in `where` clauses
11-
//~| ERROR cannot find `I`
11+
//~| ERROR cannot find type `I`
1212
panic!()
1313
}
1414

tests/ui/generic-associated-types/equality-bound.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ LL | struct K {}
164164
LL | fn from_iter<T>(_: T) -> Self where T::Item = A, T: IntoIterator,
165165
| ^ help: a struct with a similar name exists: `K`
166166

167-
error[E0433]: cannot find `I` in this scope
167+
error[E0433]: cannot find type `I` in this scope
168168
--> $DIR/equality-bound.rs:9:41
169169
|
170170
LL | fn sum3<J: Iterator>(i: J) -> i32 where I::Item = i32 {

0 commit comments

Comments
 (0)