Avoid emitting a unhelpful cascading resolution error.

This commit is contained in:
Jeffrey Seyfried 2016-07-31 20:11:38 +00:00
parent ffcbd2deb5
commit 46bd5d3fa0
2 changed files with 6 additions and 0 deletions

View file

@ -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,

View file

@ -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() {}