Auto merge of #9813 - Jarcho:issue_9811, r=xFrednet
Fix `explicit_auto_deref` fp fixes #9763 fixes #9811 changelog: `explicit_auto_deref`: Don't lint when the target type is a projection with generic arguments
This commit is contained in:
commit
432baf7026
@ -1385,6 +1385,7 @@ fn ty_auto_deref_stability<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, precedenc
|
||||
continue;
|
||||
},
|
||||
ty::Param(_) => TyPosition::new_deref_stable_for_result(precedence, ty),
|
||||
ty::Projection(_) if ty.has_non_region_param() => TyPosition::new_deref_stable_for_result(precedence, ty),
|
||||
ty::Infer(_) | ty::Error(_) | ty::Bound(..) | ty::Opaque(..) | ty::Placeholder(_) | ty::Dynamic(..) => {
|
||||
Position::ReborrowStable(precedence).into()
|
||||
},
|
||||
|
@ -266,4 +266,15 @@ fn main() {
|
||||
}
|
||||
x
|
||||
};
|
||||
|
||||
trait WithAssoc {
|
||||
type Assoc: ?Sized;
|
||||
}
|
||||
impl WithAssoc for String {
|
||||
type Assoc = str;
|
||||
}
|
||||
fn takes_assoc<T: WithAssoc>(_: &T::Assoc) -> T {
|
||||
unimplemented!()
|
||||
}
|
||||
let _: String = takes_assoc(&*String::new());
|
||||
}
|
||||
|
@ -266,4 +266,15 @@ fn main() {
|
||||
}
|
||||
*x
|
||||
};
|
||||
|
||||
trait WithAssoc {
|
||||
type Assoc: ?Sized;
|
||||
}
|
||||
impl WithAssoc for String {
|
||||
type Assoc = str;
|
||||
}
|
||||
fn takes_assoc<T: WithAssoc>(_: &T::Assoc) -> T {
|
||||
unimplemented!()
|
||||
}
|
||||
let _: String = takes_assoc(&*String::new());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user