Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Copy link
Contributor

@arielb1 arielb1 Jul 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use a match, or at least if-let-chain.

Err(true)
} else {
let mut err =
resolve_struct_error(self,
Expand Down
4 changes: 4 additions & 0 deletions src/test/compile-fail/issue-5035.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}