Report trait/impl sig inconsistency before method/body inconsistency
Closes #15657.
This commit is contained in:
parent
042cdeefc7
commit
073a1abff2
1 changed files with 11 additions and 10 deletions
|
|
@ -693,16 +693,6 @@ pub fn check_item(ccx: &CrateCtxt, it: &ast::Item) {
|
|||
debug!("ItemImpl {} with id {}", token::get_ident(it.ident), it.id);
|
||||
|
||||
let impl_pty = ty::lookup_item_type(ccx.tcx, ast_util::local_def(it.id));
|
||||
for impl_item in impl_items.iter() {
|
||||
match *impl_item {
|
||||
ast::MethodImplItem(ref m) => {
|
||||
check_method_body(ccx, &impl_pty.generics, &**m);
|
||||
}
|
||||
ast::TypeImplItem(_) => {
|
||||
// Nothing to do here.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
match *opt_trait_ref {
|
||||
Some(ref ast_trait_ref) => {
|
||||
|
|
@ -717,6 +707,17 @@ pub fn check_item(ccx: &CrateCtxt, it: &ast::Item) {
|
|||
None => { }
|
||||
}
|
||||
|
||||
for impl_item in impl_items.iter() {
|
||||
match *impl_item {
|
||||
ast::MethodImplItem(ref m) => {
|
||||
check_method_body(ccx, &impl_pty.generics, &**m);
|
||||
}
|
||||
ast::TypeImplItem(_) => {
|
||||
// Nothing to do here.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
ast::ItemTrait(_, _, _, ref trait_methods) => {
|
||||
let trait_def = ty::lookup_trait_def(ccx.tcx, local_def(it.id));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue