diff options
| author | P1start <rewi-github@whanau.org> | 2014-09-13 14:10:10 +1200 |
|---|---|---|
| committer | P1start <rewi-github@whanau.org> | 2014-10-03 20:39:56 +1300 |
| commit | 073a1abff28c01a541d96a5c7b1bbc5c9c9d0401 (patch) | |
| tree | adf2e430059b36af6809c21415e83107230fc996 | |
| parent | 042cdeefc7708291057770ddd5becf14288dad71 (diff) | |
| download | rust-073a1abff28c01a541d96a5c7b1bbc5c9c9d0401.tar.gz rust-073a1abff28c01a541d96a5c7b1bbc5c9c9d0401.zip | |
Report trait/impl sig inconsistency before method/body inconsistency
Closes #15657.
| -rw-r--r-- | src/librustc/middle/typeck/check/mod.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index d882ee5d0e5..ca5d711d360 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -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)); |
