From f25d2bd53b939a9f4e5adf5af7e9ebb3787f730a Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Sat, 14 Aug 2021 15:57:46 +0000 Subject: [PATCH] Assign FIXMEs to me and remove obsolete ones Also fixed capitalization of documentation --- compiler/rustc_infer/src/traits/engine.rs | 2 +- .../src/traits/select/mod.rs | 2 +- compiler/rustc_traits/src/type_op.rs | 15 ++------------- library/alloc/tests/const_fns.rs | 2 +- library/alloc/tests/lib.rs | 2 -- 5 files changed, 5 insertions(+), 18 deletions(-) diff --git a/compiler/rustc_infer/src/traits/engine.rs b/compiler/rustc_infer/src/traits/engine.rs index d60388b31c13c..42333dc29bc7c 100644 --- a/compiler/rustc_infer/src/traits/engine.rs +++ b/compiler/rustc_infer/src/traits/engine.rs @@ -63,7 +63,7 @@ pub trait TraitEngine<'tcx>: 'tcx { infcx: &InferCtxt<'_, 'tcx>, ) -> Result<(), Vec>>; - // FIXME this should not provide a default body for chalk as chalk should be updated + // FIXME(fee1-dead) this should not provide a default body for chalk as chalk should be updated fn select_with_constness_where_possible( &mut self, infcx: &InferCtxt<'_, 'tcx>, diff --git a/compiler/rustc_trait_selection/src/traits/select/mod.rs b/compiler/rustc_trait_selection/src/traits/select/mod.rs index dcf5ac63b78ea..38dbacbf2ae6c 100644 --- a/compiler/rustc_trait_selection/src/traits/select/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/select/mod.rs @@ -316,7 +316,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { self.infcx.tcx } - /// returns `true` if the predicate is considered `const` to + /// Returns `true` if the predicate is considered `const` to /// this selection context. pub fn is_predicate_const(&self, pred: ty::Predicate<'_>) -> bool { match pred.kind().skip_binder() { diff --git a/compiler/rustc_traits/src/type_op.rs b/compiler/rustc_traits/src/type_op.rs index f4a0cc6767f09..bd0acb0e53b6c 100644 --- a/compiler/rustc_traits/src/type_op.rs +++ b/compiler/rustc_traits/src/type_op.rs @@ -6,9 +6,7 @@ use rustc_infer::infer::{InferCtxt, TyCtxtInferExt}; use rustc_infer::traits::TraitEngineExt as _; use rustc_middle::ty::query::Providers; use rustc_middle::ty::subst::{GenericArg, Subst, UserSelfTy, UserSubsts}; -use rustc_middle::ty::{ - self, FnSig, Lift, PolyFnSig, PredicateKind, Ty, TyCtxt, TypeFoldable, Variance, -}; +use rustc_middle::ty::{self, FnSig, Lift, PolyFnSig, Ty, TyCtxt, TypeFoldable, Variance}; use rustc_middle::ty::{ParamEnv, ParamEnvAnd, Predicate, ToPredicate}; use rustc_span::DUMMY_SP; use rustc_trait_selection::infer::InferCtxtBuilderExt; @@ -87,16 +85,7 @@ impl AscribeUserTypeCx<'me, 'tcx> { Ok(()) } - fn prove_predicate(&mut self, mut predicate: Predicate<'tcx>) { - if let PredicateKind::Trait(mut tr) = predicate.kind().skip_binder() { - if let hir::Constness::Const = tr.constness { - // FIXME check if we actually want to prove const predicates inside AscribeUserType - tr.constness = hir::Constness::NotConst; - predicate = - predicate.kind().rebind(PredicateKind::Trait(tr)).to_predicate(self.tcx()); - } - } - + fn prove_predicate(&mut self, predicate: Predicate<'tcx>) { self.fulfill_cx.register_predicate_obligation( self.infcx, Obligation::new(ObligationCause::dummy(), self.param_env, predicate), diff --git a/library/alloc/tests/const_fns.rs b/library/alloc/tests/const_fns.rs index 02e8f8f40228f..b6ef3eee291fb 100644 --- a/library/alloc/tests/const_fns.rs +++ b/library/alloc/tests/const_fns.rs @@ -10,7 +10,7 @@ pub const MY_VEC: Vec = Vec::new(); #[allow(dead_code)] pub const MY_STRING: String = String::new(); -// FIXME remove this struct once we put `K: ?const Ord` on BTreeMap::new. +// FIXME(fee1-dead) remove this struct once we put `K: ?const Ord` on BTreeMap::new. #[derive(PartialEq, Eq, PartialOrd)] pub struct MyType; diff --git a/library/alloc/tests/lib.rs b/library/alloc/tests/lib.rs index f7d68b5a89e99..7284c05d5ff16 100644 --- a/library/alloc/tests/lib.rs +++ b/library/alloc/tests/lib.rs @@ -25,8 +25,6 @@ #![feature(string_remove_matches)] #![feature(const_btree_new)] #![feature(const_trait_impl)] -// FIXME remove this when const_trait_impl is not incomplete anymore -#![allow(incomplete_features)] use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher};