fix #102946
This commit is contained in:
parent
7e8d64e792
commit
b11dddd1c1
3 changed files with 34 additions and 1 deletions
|
@ -1969,7 +1969,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
|||
None
|
||||
}
|
||||
})
|
||||
.map(|res| res.expect_full_res())
|
||||
.and_then(|res| res.full_res())
|
||||
.filter(|res| {
|
||||
// Permit the types that unambiguously always
|
||||
// result in the same type constructor being used
|
||||
|
|
7
src/test/ui/resolve/issue-102946.rs
Normal file
7
src/test/ui/resolve/issue-102946.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
impl Error for str::Utf8Error {
|
||||
//~^ ERROR cannot find trait `Error` in this scope
|
||||
//~| ERROR ambiguous associated type
|
||||
fn description(&self) {}
|
||||
}
|
||||
|
||||
fn main() {}
|
26
src/test/ui/resolve/issue-102946.stderr
Normal file
26
src/test/ui/resolve/issue-102946.stderr
Normal file
|
@ -0,0 +1,26 @@
|
|||
error[E0405]: cannot find trait `Error` in this scope
|
||||
--> $DIR/issue-102946.rs:1:6
|
||||
|
|
||||
LL | impl Error for str::Utf8Error {
|
||||
| ^^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing this trait
|
||||
|
|
||||
LL | use std::error::Error;
|
||||
|
|
||||
|
||||
error[E0223]: ambiguous associated type
|
||||
--> $DIR/issue-102946.rs:1:16
|
||||
|
|
||||
LL | impl Error for str::Utf8Error {
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
help: you are looking for the module in `std`, not the primitive type
|
||||
|
|
||||
LL | impl Error for std::str::Utf8Error {
|
||||
| +++++
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0223, E0405.
|
||||
For more information about an error, try `rustc --explain E0223`.
|
Loading…
Add table
Reference in a new issue