Avoid emitting a unhelpful cascading resolution error.
This commit is contained in:
parent
ffcbd2deb5
commit
46bd5d3fa0
2 changed files with 6 additions and 0 deletions
|
@ -1810,6 +1810,8 @@ impl<'a> Resolver<'a> {
|
|||
if let Def::Trait(_) = path_res.base_def {
|
||||
debug!("(resolving trait) found trait def: {:?}", path_res);
|
||||
Ok(path_res)
|
||||
} else if path_res.base_def == Def::Err {
|
||||
Err(true)
|
||||
} else {
|
||||
let mut err =
|
||||
resolve_struct_error(self,
|
||||
|
|
|
@ -13,4 +13,8 @@ type K = I;
|
|||
//~^ NOTE: aliases cannot be used for traits
|
||||
impl K for isize {} //~ ERROR: `K` is not a trait
|
||||
//~| is not a trait
|
||||
|
||||
use ImportError; //~ ERROR unresolved
|
||||
impl ImportError for () {} // check that this is not an additional error (c.f. #35142)
|
||||
|
||||
fn main() {}
|
||||
|
|
Loading…
Add table
Reference in a new issue