Bless test fallout (duplicate diagnostics)
This commit is contained in:
parent
76096efb48
commit
1dbabc1767
@ -64,7 +64,7 @@ fn check_fn(
|
|||||||
}
|
}
|
||||||
let ret_ty = return_ty(cx, cx.tcx.local_def_id_to_hir_id(fn_def_id).expect_owner());
|
let ret_ty = return_ty(cx, cx.tcx.local_def_id_to_hir_id(fn_def_id).expect_owner());
|
||||||
if let ty::Alias(ty::Opaque, AliasTy { def_id, args, .. }) = *ret_ty.kind() {
|
if let ty::Alias(ty::Opaque, AliasTy { def_id, args, .. }) = *ret_ty.kind() {
|
||||||
let preds = cx.tcx.explicit_item_bounds(def_id);
|
let preds = cx.tcx.explicit_item_super_predicates(def_id);
|
||||||
let mut is_future = false;
|
let mut is_future = false;
|
||||||
for (p, _span) in preds.iter_instantiated_copied(cx.tcx, args) {
|
for (p, _span) in preds.iter_instantiated_copied(cx.tcx, args) {
|
||||||
if let Some(trait_pred) = p.as_trait_clause() {
|
if let Some(trait_pred) = p.as_trait_clause() {
|
||||||
|
@ -96,7 +96,7 @@ fn contains_ty_adt_constructor_opaque_inner<'tcx>(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (predicate, _span) in cx.tcx.explicit_item_bounds(def_id).instantiate_identity_iter_copied() {
|
for (predicate, _span) in cx.tcx.explicit_item_super_predicates(def_id).instantiate_identity_iter_copied() {
|
||||||
match predicate.kind().skip_binder() {
|
match predicate.kind().skip_binder() {
|
||||||
// For `impl Trait<U>`, it will register a predicate of `T: Trait<U>`, so we go through
|
// For `impl Trait<U>`, it will register a predicate of `T: Trait<U>`, so we go through
|
||||||
// and check substitutions to find `U`.
|
// and check substitutions to find `U`.
|
||||||
@ -328,7 +328,7 @@ pub fn is_must_use_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
|
|||||||
},
|
},
|
||||||
ty::Tuple(args) => args.iter().any(|ty| is_must_use_ty(cx, ty)),
|
ty::Tuple(args) => args.iter().any(|ty| is_must_use_ty(cx, ty)),
|
||||||
ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. }) => {
|
ty::Alias(ty::Opaque, ty::AliasTy { def_id, .. }) => {
|
||||||
for (predicate, _) in cx.tcx.explicit_item_bounds(def_id).skip_binder() {
|
for (predicate, _) in cx.tcx.explicit_item_super_predicates(def_id).skip_binder() {
|
||||||
if let ty::ClauseKind::Trait(trait_predicate) = predicate.kind().skip_binder() {
|
if let ty::ClauseKind::Trait(trait_predicate) = predicate.kind().skip_binder() {
|
||||||
if cx.tcx.has_attr(trait_predicate.trait_ref.def_id, sym::must_use) {
|
if cx.tcx.has_attr(trait_predicate.trait_ref.def_id, sym::must_use) {
|
||||||
return true;
|
return true;
|
||||||
@ -729,7 +729,7 @@ pub fn ty_sig<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<ExprFnSig<'t
|
|||||||
ty::Alias(ty::Opaque, ty::AliasTy { def_id, args, .. }) => sig_from_bounds(
|
ty::Alias(ty::Opaque, ty::AliasTy { def_id, args, .. }) => sig_from_bounds(
|
||||||
cx,
|
cx,
|
||||||
ty,
|
ty,
|
||||||
cx.tcx.item_bounds(def_id).iter_instantiated(cx.tcx, args),
|
cx.tcx.item_super_predicates(def_id).iter_instantiated(cx.tcx, args),
|
||||||
cx.tcx.opt_parent(def_id),
|
cx.tcx.opt_parent(def_id),
|
||||||
),
|
),
|
||||||
ty::FnPtr(sig) => Some(ExprFnSig::Sig(sig, None)),
|
ty::FnPtr(sig) => Some(ExprFnSig::Sig(sig, None)),
|
||||||
@ -807,7 +807,7 @@ fn sig_for_projection<'tcx>(cx: &LateContext<'tcx>, ty: AliasTy<'tcx>) -> Option
|
|||||||
|
|
||||||
for (pred, _) in cx
|
for (pred, _) in cx
|
||||||
.tcx
|
.tcx
|
||||||
.explicit_item_bounds(ty.def_id)
|
.explicit_item_super_predicates(ty.def_id)
|
||||||
.iter_instantiated_copied(cx.tcx, ty.args)
|
.iter_instantiated_copied(cx.tcx, ty.args)
|
||||||
{
|
{
|
||||||
match pred.kind().skip_binder() {
|
match pred.kind().skip_binder() {
|
||||||
|
Loading…
Reference in New Issue
Block a user