Skip to content

Commit

Permalink
Rollup merge of rust-lang#88030 - fee1-dead:fixme, r=oli-obk
Browse files Browse the repository at this point in the history
Assign FIXMEs to me and remove obsolete ones

Also fixed capitalization of documentation

We also don't need to transform predicates to be non-const since we basically ignore const predicates in non-const contexts.

r? ``@oli-obk``
  • Loading branch information
GuillaumeGomez committed Aug 15, 2021
2 parents e58791a + f25d2bd commit 0bf6f83
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/traits/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub trait TraitEngine<'tcx>: 'tcx {
infcx: &InferCtxt<'_, 'tcx>,
) -> Result<(), Vec<FulfillmentError<'tcx>>>;

// 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>,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/select/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
15 changes: 2 additions & 13 deletions compiler/rustc_traits/src/type_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/tests/const_fns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub const MY_VEC: Vec<usize> = 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;

Expand Down
2 changes: 0 additions & 2 deletions library/alloc/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit 0bf6f83

Please sign in to comment.