Skip to content

Commit 63193da

Browse files
authored
Unrolled build for #148678
Rollup merge of #148678 - xonx4l:EO412_replacement_with_EO425, r=Kivooeo Merge E0412 into E0425 This PR merge E0412 into E0425 as both mean the same thing to users. This fixes #148558.
2 parents 646a3f8 + 4b000cf commit 63193da

File tree

202 files changed

+557
-570
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+557
-570
lines changed

compiler/rustc_error_codes/src/error_codes/E0412.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
A used type name is not in scope.
1+
#### Note: this error code is no longer emitted by the compiler.
22

33
Erroneous code examples:
44

5-
```compile_fail,E0412
5+
```compile_fail,E0425
66
impl Something {} // error: type name `Something` is not in scope
77
88
// or:
@@ -42,7 +42,7 @@ module. To fix this, you can follow the suggestion and use File directly or
4242
`use super::File;` which will import the types from the parent namespace. An
4343
example that causes this error is below:
4444

45-
```compile_fail,E0412
45+
```compile_fail,E0425
4646
use std::fs::File;
4747
4848
mod foo {

compiler/rustc_resolve/src/late.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ impl PathSource<'_, '_, '_> {
622622
(PathSource::Trait(_), true) => E0404,
623623
(PathSource::Trait(_), false) => E0405,
624624
(PathSource::Type | PathSource::DefineOpaques, true) => E0573,
625-
(PathSource::Type | PathSource::DefineOpaques, false) => E0412,
625+
(PathSource::Type | PathSource::DefineOpaques, false) => E0425,
626626
(PathSource::Struct(_), true) => E0574,
627627
(PathSource::Struct(_), false) => E0422,
628628
(PathSource::Expr(..), true) | (PathSource::Delegation, true) => E0423,
@@ -3158,7 +3158,7 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
31583158
result
31593159
}
31603160

3161-
/// When evaluating a `trait` use its associated types' idents for suggestions in E0412.
3161+
/// When evaluating a `trait` use its associated types' idents for suggestions in E0425.
31623162
fn resolve_trait_items(&mut self, trait_items: &'ast [Box<AssocItem>]) {
31633163
let trait_assoc_items =
31643164
replace(&mut self.diag_metadata.current_trait_assoc_items, Some(trait_items));
@@ -4363,15 +4363,15 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
43634363

43644364
// There are two different error messages user might receive at
43654365
// this point:
4366-
// - E0412 cannot find type `{}` in this scope
4366+
// - E0425 cannot find type `{}` in this scope
43674367
// - E0433 failed to resolve: use of undeclared type or module `{}`
43684368
//
43694369
// The first one is emitted for paths in type-position, and the
43704370
// latter one - for paths in expression-position.
43714371
//
43724372
// Thus (since we're in expression-position at this point), not to
43734373
// confuse the user, we want to keep the *message* from E0433 (so
4374-
// `parent_err`), but we want *hints* from E0412 (so `err`).
4374+
// `parent_err`), but we want *hints* from E0425 (so `err`).
43754375
//
43764376
// And that's what happens below - we're just mixing both messages
43774377
// into a single one.

compiler/rustc_resolve/src/late/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
705705
if !enum_candidates.is_empty() {
706706
enum_candidates.sort();
707707

708-
// Contextualize for E0412 "cannot find type", but don't belabor the point
708+
// Contextualize for E0425 "cannot find type", but don't belabor the point
709709
// (that it's a variant) for E0573 "expected type, found variant".
710710
let preamble = if res.is_none() {
711711
let others = match enum_candidates.len() {
@@ -1135,7 +1135,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> {
11351135
}
11361136

11371137
self.suggest_ident_hidden_by_hygiene(err, path, span);
1138-
} else if err_code == E0412 {
1138+
// cannot find type in this scope
11391139
if let Some(correct) = Self::likely_rust_type(path) {
11401140
err.span_suggestion(
11411141
span,

src/tools/clippy/tests/ui/crashes/ice-6252.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0412]: cannot find type `PhantomData` in this scope
1+
error[E0425]: cannot find type `PhantomData` in this scope
22
--> tests/ui/crashes/ice-6252.rs:9:9
33
|
44
LL | _n: PhantomData,
@@ -9,7 +9,7 @@ help: consider importing this struct
99
LL + use std::marker::PhantomData;
1010
|
1111

12-
error[E0412]: cannot find type `VAL` in this scope
12+
error[E0425]: cannot find type `VAL` in this scope
1313
--> tests/ui/crashes/ice-6252.rs:12:63
1414
|
1515
LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
@@ -31,5 +31,5 @@ LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
3131

3232
error: aborting due to 3 previous errors
3333

34-
Some errors have detailed explanations: E0046, E0412.
34+
Some errors have detailed explanations: E0046, E0425.
3535
For more information about an error, try `rustc --explain E0046`.

tests/rustdoc-ui/impl-fn-nesting.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ error[E0405]: cannot find trait `UnknownBound` in this scope
1010
LL | pub fn f<B: UnknownBound>(a: UnknownType, b: B) {
1111
| ^^^^^^^^^^^^ not found in this scope
1212

13-
error[E0412]: cannot find type `UnknownType` in this scope
13+
error[E0425]: cannot find type `UnknownType` in this scope
1414
--> $DIR/impl-fn-nesting.rs:11:30
1515
|
1616
LL | pub fn f<B: UnknownBound>(a: UnknownType, b: B) {
@@ -34,7 +34,7 @@ error[E0405]: cannot find trait `UnknownBound` in this scope
3434
LL | impl<T: UnknownBound> UnknownTrait for T {}
3535
| ^^^^^^^^^^^^ not found in this scope
3636

37-
error[E0412]: cannot find type `UnknownType` in this scope
37+
error[E0425]: cannot find type `UnknownType` in this scope
3838
--> $DIR/impl-fn-nesting.rs:18:25
3939
|
4040
LL | impl ValidTrait for UnknownType {}
@@ -46,19 +46,19 @@ error[E0405]: cannot find trait `UnknownBound` in this scope
4646
LL | impl ValidTrait for ValidType where ValidTrait: UnknownBound {}
4747
| ^^^^^^^^^^^^ not found in this scope
4848

49-
error[E0412]: cannot find type `UnknownType` in this scope
49+
error[E0425]: cannot find type `UnknownType` in this scope
5050
--> $DIR/impl-fn-nesting.rs:25:21
5151
|
5252
LL | type Item = UnknownType;
5353
| ^^^^^^^^^^^ not found in this scope
5454

55-
error[E0412]: cannot find type `UnknownType` in this scope
55+
error[E0425]: cannot find type `UnknownType` in this scope
5656
--> $DIR/impl-fn-nesting.rs:44:37
5757
|
5858
LL | pub fn doubly_nested(c: UnknownType) {
5959
| ^^^^^^^^^^^ not found in this scope
6060

6161
error: aborting due to 10 previous errors
6262

63-
Some errors have detailed explanations: E0405, E0412.
63+
Some errors have detailed explanations: E0405, E0425.
6464
For more information about an error, try `rustc --explain E0405`.

tests/ui/annotate-snippet/missing-type.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0412]: cannot find type `Iter` in this scope
1+
error[E0425]: cannot find type `Iter` in this scope
22
--> $DIR/missing-type.rs:5:12
33
|
44
LL | let x: Iter;
@@ -18,4 +18,4 @@ LL + use std::collections::hash_map::Iter;
1818

1919
error: aborting due to 1 previous error
2020

21-
For more information about this error, try `rustc --explain E0412`.
21+
For more information about this error, try `rustc --explain E0425`.

tests/ui/argument-suggestions/extern-fn-arg-names.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0412]: cannot find type `err` in this scope
1+
error[E0425]: cannot find type `err` in this scope
22
--> $DIR/extern-fn-arg-names.rs:2:29
33
|
44
LL | fn dstfn(src: i32, dst: err);
@@ -22,5 +22,5 @@ LL | dstfn(1, /* dst */);
2222

2323
error: aborting due to 2 previous errors
2424

25-
Some errors have detailed explanations: E0061, E0412.
25+
Some errors have detailed explanations: E0061, E0425.
2626
For more information about an error, try `rustc --explain E0061`.

tests/ui/argument-suggestions/issue-109831.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
struct A;
22
struct B;
33

4-
fn f(b1: B, b2: B, a2: C) {} //~ ERROR E0412
4+
fn f(b1: B, b2: B, a2: C) {} //~ ERROR E0425
55

66
fn main() {
77
f(A, A, B, C); //~ ERROR E0425

tests/ui/argument-suggestions/issue-109831.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0412]: cannot find type `C` in this scope
1+
error[E0425]: cannot find type `C` in this scope
22
--> $DIR/issue-109831.rs:4:24
33
|
44
LL | struct A;
@@ -48,5 +48,5 @@ LL + f(/* B */, /* B */, B);
4848

4949
error: aborting due to 3 previous errors
5050

51-
Some errors have detailed explanations: E0061, E0412, E0425.
51+
Some errors have detailed explanations: E0061, E0425.
5252
For more information about an error, try `rustc --explain E0061`.

tests/ui/asm/issue-113788.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
//@ needs-asm-support
33
//@ only-x86_64
44
fn main() {
5-
let peb: *const PEB; //~ ERROR cannot find type `PEB` in this scope [E0412]
5+
let peb: *const PEB; //~ ERROR cannot find type `PEB` in this scope [E0425]
66
unsafe { std::arch::asm!("mov {0}, fs:[0x30]", out(reg) peb); }
77
}

0 commit comments

Comments
 (0)