Skip to content

Commit 48f950c

Browse files
authored
Rollup merge of rust-lang#102956 - TaKO8Ki:fix-102946, r=fee1-dead
Use `full_res` instead of `expect_full_res` Fixes rust-lang#102946 Fixes rust-lang#102978
2 parents 42991e5 + b11dddd commit 48f950c

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

compiler/rustc_resolve/src/late.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1969,7 +1969,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
19691969
None
19701970
}
19711971
})
1972-
.map(|res| res.expect_full_res())
1972+
.and_then(|res| res.full_res())
19731973
.filter(|res| {
19741974
// Permit the types that unambiguously always
19751975
// result in the same type constructor being used

src/test/ui/resolve/issue-102946.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
impl Error for str::Utf8Error {
2+
//~^ ERROR cannot find trait `Error` in this scope
3+
//~| ERROR ambiguous associated type
4+
fn description(&self) {}
5+
}
6+
7+
fn main() {}
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
error[E0405]: cannot find trait `Error` in this scope
2+
--> $DIR/issue-102946.rs:1:6
3+
|
4+
LL | impl Error for str::Utf8Error {
5+
| ^^^^^ not found in this scope
6+
|
7+
help: consider importing this trait
8+
|
9+
LL | use std::error::Error;
10+
|
11+
12+
error[E0223]: ambiguous associated type
13+
--> $DIR/issue-102946.rs:1:16
14+
|
15+
LL | impl Error for str::Utf8Error {
16+
| ^^^^^^^^^^^^^^
17+
|
18+
help: you are looking for the module in `std`, not the primitive type
19+
|
20+
LL | impl Error for std::str::Utf8Error {
21+
| +++++
22+
23+
error: aborting due to 2 previous errors
24+
25+
Some errors have detailed explanations: E0223, E0405.
26+
For more information about an error, try `rustc --explain E0223`.

0 commit comments

Comments
 (0)