mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
Auto merge of #5538 - csmoe:rustup, r=phansch
rustup: rust-lang/rust#71628 cc https://github.com/rust-lang/rust/issues/71608 changelog: none
This commit is contained in:
commit
f2486b3d35
2 changed files with 7 additions and 8 deletions
|
@ -111,7 +111,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
|
||||||
|
|
||||||
let fn_def_id = cx.tcx.hir().local_def_id(hir_id);
|
let fn_def_id = cx.tcx.hir().local_def_id(hir_id);
|
||||||
|
|
||||||
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.to_vec())
|
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.iter().copied())
|
||||||
.filter(|p| !p.is_global())
|
.filter(|p| !p.is_global())
|
||||||
.filter_map(|obligation| {
|
.filter_map(|obligation| {
|
||||||
if let ty::Predicate::Trait(poly_trait_ref, _) = obligation.predicate {
|
if let ty::Predicate::Trait(poly_trait_ref, _) = obligation.predicate {
|
||||||
|
|
|
@ -1384,13 +1384,12 @@ pub fn is_trait_impl_item(cx: &LateContext<'_, '_>, hir_id: HirId) -> bool {
|
||||||
/// ```
|
/// ```
|
||||||
pub fn fn_has_unsatisfiable_preds(cx: &LateContext<'_, '_>, did: DefId) -> bool {
|
pub fn fn_has_unsatisfiable_preds(cx: &LateContext<'_, '_>, did: DefId) -> bool {
|
||||||
use rustc_trait_selection::traits;
|
use rustc_trait_selection::traits;
|
||||||
let predicates = cx
|
let predicates =
|
||||||
.tcx
|
cx.tcx
|
||||||
.predicates_of(did)
|
.predicates_of(did)
|
||||||
.predicates
|
.predicates
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None })
|
.filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None });
|
||||||
.collect();
|
|
||||||
!traits::normalize_and_test_predicates(
|
!traits::normalize_and_test_predicates(
|
||||||
cx.tcx,
|
cx.tcx,
|
||||||
traits::elaborate_predicates(cx.tcx, predicates)
|
traits::elaborate_predicates(cx.tcx, predicates)
|
||||||
|
|
Loading…
Add table
Reference in a new issue