From a35f6c148ff9e0d6ff23b46d112302c393c9dcde Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Fri, 18 Feb 2022 17:30:16 -0800 Subject: [PATCH 1/4] Rustup to rust-lang/rust#89449 --- README.md | 8 ++++---- rust-toolchain | 2 +- src/traverse.rs | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index aae20a85..921f5e38 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ repository and compiled from source or installed from of the nightly toolchain is supported at any given time. -It's recommended to use `nightly-2021-09-30` toolchain. -You can install it by using `rustup install nightly-2021-09-30` if you already have rustup. +It's recommended to use `nightly-2021-10-15` toolchain. +You can install it by using `rustup install nightly-2021-10-15` if you already have rustup. Then you can do: ```sh -$ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2021-09-30 -$ cargo +nightly-2021-09-30 install --git https://github.com/rust-lang/rust-semverver +$ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2021-10-15 +$ cargo +nightly-2021-10-15 install --git https://github.com/rust-lang/rust-semverver ``` You'd also need `cmake` for some dependencies, and a few common libraries (if you hit diff --git a/rust-toolchain b/rust-toolchain index be691470..085c7531 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,4 +1,4 @@ # NOTE: Keep in sync with nightly date on README [toolchain] -channel = "nightly-2021-09-30" +channel = "nightly-2021-10-15" components = ["llvm-tools-preview", "rustc-dev"] diff --git a/src/traverse.rs b/src/traverse.rs index 2cc67961..c4c58139 100644 --- a/src/traverse.rs +++ b/src/traverse.rs @@ -17,7 +17,6 @@ use crate::{ typeck::{BoundContext, TypeComparisonContext}, }; use log::{debug, info}; -use rustc_const_eval::const_eval::is_const_fn; use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res, Res::Def}; use rustc_hir::def_id::DefId; use rustc_hir::hir_id::HirId; @@ -363,8 +362,8 @@ fn diff_fn<'tcx>(changes: &mut ChangeSet, tcx: TyCtxt<'tcx>, old: Res, new: Res) let old_def_id = old.def_id(); let new_def_id = new.def_id(); - let old_const = is_const_fn(tcx, old_def_id); - let new_const = is_const_fn(tcx, new_def_id); + let old_const = tcx.is_const_fn(old_def_id); + let new_const = tcx.is_const_fn(new_def_id); if old_const != new_const { changes.add_change( From f557ae7a25ccc95a2b5b9dc4be1351c0fc56a226 Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Fri, 18 Feb 2022 17:37:14 -0800 Subject: [PATCH 2/4] Rustup to rust-lang/rust#89939 --- README.md | 8 ++++---- rust-toolchain | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 921f5e38..f7ef039a 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ repository and compiled from source or installed from of the nightly toolchain is supported at any given time. -It's recommended to use `nightly-2021-10-15` toolchain. -You can install it by using `rustup install nightly-2021-10-15` if you already have rustup. +It's recommended to use `nightly-2021-10-16` toolchain. +You can install it by using `rustup install nightly-2021-10-16` if you already have rustup. Then you can do: ```sh -$ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2021-10-15 -$ cargo +nightly-2021-10-15 install --git https://github.com/rust-lang/rust-semverver +$ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2021-10-16 +$ cargo +nightly-2021-10-16 install --git https://github.com/rust-lang/rust-semverver ``` You'd also need `cmake` for some dependencies, and a few common libraries (if you hit diff --git a/rust-toolchain b/rust-toolchain index 085c7531..9ea85541 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,4 +1,4 @@ # NOTE: Keep in sync with nightly date on README [toolchain] -channel = "nightly-2021-10-15" +channel = "nightly-2021-10-16" components = ["llvm-tools-preview", "rustc-dev"] From 3c18a4adeca703a80785e7dab6e9759092e4283a Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Fri, 18 Feb 2022 17:45:12 -0800 Subject: [PATCH 3/4] Rustup to rust-lang/rust#89933 --- README.md | 8 ++++---- rust-toolchain | 2 +- tests/cases/pathologic_paths/stdout | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f7ef039a..7d4ff8bc 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ repository and compiled from source or installed from of the nightly toolchain is supported at any given time. -It's recommended to use `nightly-2021-10-16` toolchain. -You can install it by using `rustup install nightly-2021-10-16` if you already have rustup. +It's recommended to use `nightly-2021-10-20` toolchain. +You can install it by using `rustup install nightly-2021-10-20` if you already have rustup. Then you can do: ```sh -$ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2021-10-16 -$ cargo +nightly-2021-10-16 install --git https://github.com/rust-lang/rust-semverver +$ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2021-10-20 +$ cargo +nightly-2021-10-20 install --git https://github.com/rust-lang/rust-semverver ``` You'd also need `cmake` for some dependencies, and a few common libraries (if you hit diff --git a/rust-toolchain b/rust-toolchain index 9ea85541..c246c193 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,4 +1,4 @@ # NOTE: Keep in sync with nightly date on README [toolchain] -channel = "nightly-2021-10-16" +channel = "nightly-2021-10-20" components = ["llvm-tools-preview", "rustc-dev"] diff --git a/tests/cases/pathologic_paths/stdout b/tests/cases/pathologic_paths/stdout index 452fba08..f5d106ca 100644 --- a/tests/cases/pathologic_paths/stdout +++ b/tests/cases/pathologic_paths/stdout @@ -9,7 +9,7 @@ warning: path changes to `a` ... | 16 | | _ _ _ _ _ _ _ _ 17 | | _ _ _ _ _ _ _ _); - | |_______________________^ + | |______________________^ | = note: added definition (technically breaking) = note: this warning originates in the macro `blow` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -24,7 +24,7 @@ warning: path changes to `b` ... | 16 | | _ _ _ _ _ _ _ _ 17 | | _ _ _ _ _ _ _ _); - | |_______________________^ + | |______________________^ | = note: added definition (technically breaking) = note: this warning originates in the macro `blow` (in Nightly builds, run with -Z macro-backtrace for more info) From 5572ce62bf147d41a2fc625e042bfda7052c6c46 Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Fri, 18 Feb 2022 18:13:13 -0800 Subject: [PATCH 4/4] Rustup to rust-lang/rust#89427 --- README.md | 8 ++++---- rust-toolchain | 2 +- src/translate.rs | 1 + src/typeck.rs | 4 +++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7d4ff8bc..a20d6ee6 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ repository and compiled from source or installed from of the nightly toolchain is supported at any given time. -It's recommended to use `nightly-2021-10-20` toolchain. -You can install it by using `rustup install nightly-2021-10-20` if you already have rustup. +It's recommended to use `nightly-2021-10-25` toolchain. +You can install it by using `rustup install nightly-2021-10-25` if you already have rustup. Then you can do: ```sh -$ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2021-10-20 -$ cargo +nightly-2021-10-20 install --git https://github.com/rust-lang/rust-semverver +$ rustup component add rustc-dev llvm-tools-preview --toolchain nightly-2021-10-25 +$ cargo +nightly-2021-10-25 install --git https://github.com/rust-lang/rust-semverver ``` You'd also need `cmake` for some dependencies, and a few common libraries (if you hit diff --git a/rust-toolchain b/rust-toolchain index c246c193..c5012dbe 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,4 +1,4 @@ # NOTE: Keep in sync with nightly date on README [toolchain] -channel = "nightly-2021-10-20" +channel = "nightly-2021-10-25" components = ["llvm-tools-preview", "rustc-dev"] diff --git a/src/translate.rs b/src/translate.rs index 08d349f2..1dc8bd32 100644 --- a/src/translate.rs +++ b/src/translate.rs @@ -393,6 +393,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> { substs: target_substs, }, constness: pred.constness, + polarity: pred.polarity, } } else { return None; diff --git a/src/typeck.rs b/src/typeck.rs index ae490e8e..a74a6232 100644 --- a/src/typeck.rs +++ b/src/typeck.rs @@ -18,7 +18,8 @@ use rustc_middle::{ error::TypeError, fold::TypeFoldable, subst::{GenericArg, InternalSubsts, SubstsRef}, - GenericParamDefKind, ParamEnv, Predicate, PredicateKind, TraitRef, Ty, TyCtxt, + GenericParamDefKind, ImplPolarity, ParamEnv, Predicate, PredicateKind, TraitRef, Ty, + TyCtxt, }, }; use rustc_trait_selection::traits::FulfillmentContext; @@ -77,6 +78,7 @@ impl<'a, 'tcx> BoundContext<'a, 'tcx> { let predicate = ty::Binder::dummy(PredicateKind::Trait(TraitPredicate { trait_ref: checked_trait_ref, constness: BoundConstness::NotConst, + polarity: ImplPolarity::Positive, })) .to_predicate(self.infcx.tcx); let obligation = Obligation::new(ObligationCause::dummy(), self.given_param_env, predicate);