Skip to content

Commit 25300e3

Browse files
committed
fixed tests
1 parent dba95f2 commit 25300e3

File tree

6 files changed

+49
-86
lines changed

6 files changed

+49
-86
lines changed

compiler/rustc_resolve/src/late/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2787,7 +2787,7 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
27872787
"Res", "Ret", "This", "Iter", "Type",
27882788
];
27892789
let is_common_generic = common_generic_names.contains(&&*ident);
2790-
let looks_like_camel_case = ident
2790+
let looks_like_camel_case = ident
27912791
.chars()
27922792
.next()
27932793
.is_some_and(|c| c.is_uppercase())

tests/ui/const-generics/generic_const_exprs/issue-109141.stderr

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ error[E0425]: cannot find value `HashesEntryLEN` in this scope
33
|
44
LL | struct EntriesBuffer(Box<[[u8; HashesEntryLEN]; 5]>);
55
| ^^^^^^^^^^^^^^ not found in this scope
6-
|
7-
help: you might be missing a const parameter
8-
|
9-
LL | struct EntriesBuffer<const HashesEntryLEN: /* Type */>(Box<[[u8; HashesEntryLEN]; 5]>);
10-
| ++++++++++++++++++++++++++++++++++
116

127
error: aborting due to 1 previous error
138

tests/ui/missing/missing-items/missing-type-parameter.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
fn foo<X>() { }
1+
fn foo<X>() {}
2+
3+
fn do_something() -> Option<ForgotToImport> {
4+
//~^ cannot find type `ForgotToImport` in this scope [E0412]
5+
None
6+
}
7+
8+
fn do_something_T() -> Option<T> {
9+
//~^ cannot find type `T` in this scope [E0412]
10+
None
11+
}
12+
13+
fn do_something_Type() -> Option<Type> {
14+
//~^ cannot find type `Type` in this scope [E0412]
15+
None
16+
}
217

318
fn main() {
419
foo(); //~ ERROR type annotations needed
Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
1+
error[E0412]: cannot find type `ForgotToImport` in this scope
2+
--> $DIR/missing-type-parameter.rs:3:29
3+
|
4+
LL | fn do_something() -> Option<ForgotToImport> {
5+
| ^^^^^^^^^^^^^^ not found in this scope
6+
7+
error[E0412]: cannot find type `T` in this scope
8+
--> $DIR/missing-type-parameter.rs:8:31
9+
|
10+
LL | fn do_something_T() -> Option<T> {
11+
| ^ not found in this scope
12+
|
13+
help: you might be missing a type parameter
14+
|
15+
LL | fn do_something_T<T>() -> Option<T> {
16+
| +++
17+
18+
error[E0412]: cannot find type `Type` in this scope
19+
--> $DIR/missing-type-parameter.rs:13:34
20+
|
21+
LL | fn do_something_Type() -> Option<Type> {
22+
| ^^^^ not found in this scope
23+
|
24+
help: you might be missing a type parameter
25+
|
26+
LL | fn do_something_Type<Type>() -> Option<Type> {
27+
| ++++++
28+
129
error[E0282]: type annotations needed
2-
--> $DIR/missing-type-parameter.rs:4:5
30+
--> $DIR/missing-type-parameter.rs:19:5
331
|
432
LL | foo();
533
| ^^^ cannot infer type of the type parameter `X` declared on the function `foo`
@@ -9,6 +37,7 @@ help: consider specifying the generic argument
937
LL | foo::<X>();
1038
| +++++
1139

12-
error: aborting due to 1 previous error
40+
error: aborting due to 4 previous errors
1341

14-
For more information about this error, try `rustc --explain E0282`.
42+
Some errors have detailed explanations: E0282, E0412.
43+
For more information about an error, try `rustc --explain E0282`.

tests/ui/traits/missing-type-param-suggestion-issue-139999.rs

Lines changed: 0 additions & 22 deletions
This file was deleted.

tests/ui/traits/missing-type-param-suggestion-issue-139999.stderr

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)