提交 073a1abf 编写于 作者: P P1start

Report trait/impl sig inconsistency before method/body inconsistency

Closes #15657.
上级 042cdeef
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册