Skip to content

Commit ce86f90

Browse files
committed
Auto merge of rust-lang#5632 - flip1995:rustup, r=phansch
Rustup changelog: none
2 parents 780572b + 6b3cf63 commit ce86f90

File tree

5 files changed

+14
-17
lines changed

5 files changed

+14
-17
lines changed

Diff for: clippy_lints/src/future_not_send.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_hir::intravisit::FnKind;
33
use rustc_hir::{Body, FnDecl, HirId};
44
use rustc_infer::infer::TyCtxtInferExt;
55
use rustc_lint::{LateContext, LateLintPass};
6-
use rustc_middle::ty::{Opaque, Predicate::Trait, ToPolyTraitRef};
6+
use rustc_middle::ty::{Opaque, PredicateKind::Trait, ToPolyTraitRef};
77
use rustc_session::{declare_lint_pass, declare_tool_lint};
88
use rustc_span::{sym, Span};
99
use rustc_trait_selection::traits::error_reporting::suggestions::InferCtxtExt;
@@ -91,7 +91,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for FutureNotSend {
9191
cx.tcx.infer_ctxt().enter(|infcx| {
9292
for FulfillmentError { obligation, .. } in send_errors {
9393
infcx.maybe_note_obligation_cause_for_async_await(db, &obligation);
94-
if let Trait(trait_pred, _) = obligation.predicate {
94+
if let Trait(trait_pred, _) = obligation.predicate.kind() {
9595
let trait_ref = trait_pred.to_poly_trait_ref();
9696
db.note(&*format!(
9797
"`{}` doesn't implement `{}`",

Diff for: clippy_lints/src/methods/mod.rs

+9-12
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use rustc_lint::{LateContext, LateLintPass, Lint, LintContext};
1818
use rustc_middle::hir::map::Map;
1919
use rustc_middle::lint::in_external_macro;
2020
use rustc_middle::ty::subst::GenericArgKind;
21-
use rustc_middle::ty::{self, Predicate, Ty};
21+
use rustc_middle::ty::{self, Ty};
2222
use rustc_session::{declare_lint_pass, declare_tool_lint};
2323
use rustc_span::source_map::Span;
2424
use rustc_span::symbol::{sym, SymbolStr};
@@ -1496,17 +1496,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Methods {
14961496
if let ty::Opaque(def_id, _) = ret_ty.kind {
14971497
// one of the associated types must be Self
14981498
for predicate in cx.tcx.predicates_of(def_id).predicates {
1499-
match predicate {
1500-
(Predicate::Projection(poly_projection_predicate), _) => {
1501-
let binder = poly_projection_predicate.ty();
1502-
let associated_type = binder.skip_binder();
1503-
1504-
// walk the associated type and check for Self
1505-
if contains_self_ty(associated_type) {
1506-
return;
1507-
}
1508-
},
1509-
(_, _) => {},
1499+
if let ty::PredicateKind::Projection(poly_projection_predicate) = predicate.0.kind() {
1500+
let binder = poly_projection_predicate.ty();
1501+
let associated_type = binder.skip_binder();
1502+
1503+
// walk the associated type and check for Self
1504+
if contains_self_ty(associated_type) {
1505+
return;
1506+
}
15101507
}
15111508
}
15121509
}

Diff for: clippy_lints/src/needless_pass_by_value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NeedlessPassByValue {
114114
let preds = traits::elaborate_predicates(cx.tcx, cx.param_env.caller_bounds.iter().copied())
115115
.filter(|p| !p.is_global())
116116
.filter_map(|obligation| {
117-
if let ty::Predicate::Trait(poly_trait_ref, _) = obligation.predicate {
117+
if let ty::PredicateKind::Trait(poly_trait_ref, _) = obligation.predicate.kind() {
118118
if poly_trait_ref.def_id() == sized_trait || poly_trait_ref.skip_binder().has_escaping_bound_vars()
119119
{
120120
return None;

Diff for: clippy_lints/src/utils/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ pub fn is_must_use_ty<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>) -> boo
12991299
ty::Tuple(ref substs) => substs.types().any(|ty| is_must_use_ty(cx, ty)),
13001300
ty::Opaque(ref def_id, _) => {
13011301
for (predicate, _) in cx.tcx.predicates_of(*def_id).predicates {
1302-
if let ty::Predicate::Trait(ref poly_trait_predicate, _) = predicate {
1302+
if let ty::PredicateKind::Trait(ref poly_trait_predicate, _) = predicate.kind() {
13031303
if must_use_attr(&cx.tcx.get_attrs(poly_trait_predicate.skip_binder().trait_ref.def_id)).is_some() {
13041304
return true;
13051305
}

Diff for: setup-toolchain.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ else
3232
TOOLCHAIN=()
3333
fi
3434

35-
rustup-toolchain-install-master -f -n master "${TOOLCHAIN[@]}" -c rustc-dev -- "$RUST_COMMIT"
35+
rustup-toolchain-install-master -f -n master "${TOOLCHAIN[@]}" -c rustc-dev -c llvm-tools -- "$RUST_COMMIT"
3636
rustup override set master

0 commit comments

Comments
 (0)