Skip to content

Commit

Permalink
Auto merge of #5538 - csmoe:rustup, r=phansch
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Apr 27, 2020
2 parents d13ffbe + 305177d commit 251f873
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/needless_pass_by_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 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_map(|obligation| {
if let ty::Predicate::Trait(poly_trait_ref, _) = obligation.predicate {
Expand Down
13 changes: 6 additions & 7 deletions clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
use rustc_trait_selection::traits;
let predicates = cx
.tcx
.predicates_of(did)
.predicates
.iter()
.filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None })
.collect();
let predicates =
cx.tcx
.predicates_of(did)
.predicates
.iter()
.filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None });
!traits::normalize_and_test_predicates(
cx.tcx,
traits::elaborate_predicates(cx.tcx, predicates)
Expand Down

0 comments on commit 251f873

Please sign in to comment.