Fix rebase
This commit is contained in:
parent
c52dbbc643
commit
cb6408afc6
4 changed files with 8 additions and 11 deletions
|
@ -83,7 +83,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
|
|||
}
|
||||
let mut visitor = AssocTypeFinder(FxIndexSet::default());
|
||||
trait_fn_sig.output().visit_with(&mut visitor);
|
||||
if let Some(id) = tcx.hir().as_local_hir_id(trait_def_id) {
|
||||
if let Some(id) = trait_def_id.as_local().map(|id| tcx.hir().as_local_hir_id(id)) {
|
||||
let parent_id = tcx.hir().get_parent_item(id);
|
||||
let trait_item = tcx.hir().expect_item(parent_id);
|
||||
if let ItemKind::Trait(_, _, generics, _, _) = &trait_item.kind {
|
||||
|
@ -103,9 +103,10 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
|
|||
let assoc_item = self.tcx().associated_item(trait_def_id);
|
||||
let mut visitor = TypeParamSpanVisitor { tcx: self.tcx(), types: vec![] };
|
||||
match assoc_item.kind {
|
||||
ty::AssocKind::Method => {
|
||||
ty::AssocKind::Fn => {
|
||||
let hir = self.tcx().hir();
|
||||
if let Some(hir_id) = hir.as_local_hir_id(assoc_item.def_id) {
|
||||
if let Some(hir_id) = assoc_item.def_id.as_local().map(|id| hir.as_local_hir_id(id))
|
||||
{
|
||||
if let Some(decl) = hir.fn_decl_by_hir_id(hir_id) {
|
||||
visitor.visit_fn_decl(decl);
|
||||
}
|
||||
|
|
|
@ -58,8 +58,8 @@ note: ...so that the expression is assignable
|
|||
|
|
||||
LL | let x: &'a _ = &y;
|
||||
| ^^
|
||||
= note: expected `&'a &()`
|
||||
found `&'a &'b ()`
|
||||
= note: expected `&'a &()`
|
||||
found `&'a &'b ()`
|
||||
note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 1:6...
|
||||
--> $DIR/E0490.rs:1:6
|
||||
|
|
||||
|
|
|
@ -2,10 +2,10 @@ error: `impl` item signature doesn't match `trait` item signature
|
|||
--> $DIR/mismatched_trait_impl.rs:9:5
|
||||
|
|
||||
LL | fn foo(&self, x: &'a u32, y: &u32) -> &'a u32;
|
||||
| ---------------------------------------------- expected fn(&i32, &'a u32, &u32) -> &'a u32
|
||||
| ---------------------------------------------- expected `fn(&i32, &'a u32, &u32) -> &'a u32`
|
||||
...
|
||||
LL | fn foo(&self, x: &u32, y: &'a u32) -> &'a u32 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found fn(&i32, &u32, &u32) -> &u32
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&i32, &u32, &u32) -> &u32`
|
||||
|
|
||||
= note: expected `fn(&i32, &'a u32, &u32) -> &'a u32`
|
||||
found `fn(&i32, &u32, &u32) -> &u32`
|
||||
|
|
|
@ -8,8 +8,6 @@ LL | extern "rust-call" fn call(&self, (_,): (T,)) {}
|
|||
|
|
||||
= note: expected fn pointer `extern "rust-call" fn(&Foo, (&'a T,))`
|
||||
found fn pointer `extern "rust-call" fn(&Foo, (T,))`
|
||||
= help: type parameters must be constrained to match other types
|
||||
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
|
||||
|
||||
error[E0053]: method `call_mut` has an incompatible type for trait
|
||||
--> $DIR/issue-20225.rs:11:3
|
||||
|
@ -21,8 +19,6 @@ LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
|
|||
|
|
||||
= note: expected fn pointer `extern "rust-call" fn(&mut Foo, (&'a T,))`
|
||||
found fn pointer `extern "rust-call" fn(&mut Foo, (T,))`
|
||||
= help: type parameters must be constrained to match other types
|
||||
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
|
||||
|
||||
error[E0053]: method `call_once` has an incompatible type for trait
|
||||
--> $DIR/issue-20225.rs:18:3
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue