about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-02 11:48:58 +0000
committerbors <bors@rust-lang.org>2021-12-02 11:48:58 +0000
commitdd03c0ff3e203aad854004b6c47adcf8c001129d (patch)
treea626dba458c0d78a7833d38b5c5bb7f15daaea19
parent56533d9e872084454bb5dbfacb49df64f145fa9d (diff)
parent99eeb66e0ffa97309c29c3af69614553cbf88ef8 (diff)
downloadrust-dd03c0ff3e203aad854004b6c47adcf8c001129d.tar.gz
rust-dd03c0ff3e203aad854004b6c47adcf8c001129d.zip
Auto merge of #91354 - fee1-dead:const_env, r=spastorino
Cleanup: Eliminate ConstnessAnd

This is almost a behaviour-free change and purely a refactoring. "almost" because we appear to be using the wrong ParamEnv somewhere already, and this is now exposed by failing a test using the unstable `~const` feature.

We most definitely need to review all `without_const` and at some point should probably get rid of many of them by using `TraitPredicate` instead of `TraitRef`.

This is a continuation of https://github.com/rust-lang/rust/pull/90274.

r? `@oli-obk`

cc `@spastorino` `@ecstatic-morse`
-rw-r--r--clippy_lints/src/future_not_send.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/future_not_send.rs b/clippy_lints/src/future_not_send.rs
index 6b2ac985555..a9297adb426 100644
--- a/clippy_lints/src/future_not_send.rs
+++ b/clippy_lints/src/future_not_send.rs
@@ -67,8 +67,8 @@ impl<'tcx> LateLintPass<'tcx> for FutureNotSend {
             let mut is_future = false;
             for &(p, _span) in preds {
                 let p = p.subst(cx.tcx, subst);
-                if let Some(trait_ref) = p.to_opt_poly_trait_ref() {
-                    if Some(trait_ref.value.def_id()) == cx.tcx.lang_items().future_trait() {
+                if let Some(trait_pred) = p.to_opt_poly_trait_pred() {
+                    if Some(trait_pred.skip_binder().trait_ref.def_id) == cx.tcx.lang_items().future_trait() {
                         is_future = true;
                         break;
                     }