auto merge of #17761 : bkoropoff/rust/issue-17758, r=alexcrichton
This fixes an ICE and closes issue #17758
This commit is contained in:
commit
07aeac8ac8
@ -869,6 +869,19 @@ impl<'a, 'tcx> ErrorReporting for InferCtxt<'a, 'tcx> {
|
||||
ast::TypeImplItem(_) => None,
|
||||
}
|
||||
},
|
||||
ast_map::NodeTraitItem(ref item) => {
|
||||
match **item {
|
||||
ast::ProvidedMethod(ref m) => {
|
||||
Some((m.pe_fn_decl(),
|
||||
m.pe_generics(),
|
||||
m.pe_fn_style(),
|
||||
m.pe_ident(),
|
||||
Some(&m.pe_explicit_self().node),
|
||||
m.span))
|
||||
}
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
_ => None
|
||||
},
|
||||
None => None
|
||||
|
22
src/test/compile-fail/issue-17758.rs
Normal file
22
src/test/compile-fail/issue-17758.rs
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Test that regionck suggestions in a provided method of a trait
|
||||
// don't ICE
|
||||
|
||||
trait Foo<'a> {
|
||||
fn foo(&'a self);
|
||||
fn bar(&self) {
|
||||
self.foo();
|
||||
//~^ ERROR mismatched types: expected `&'a Self`, found `&Self` (lifetime mismatch)
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user