Skip to content

Commit fa4edcc

Browse files
authored
Rollup merge of #88030 - fee1-dead:fixme, r=oli-obk
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`````
2 parents fe71be7 + f25d2bd commit fa4edcc

File tree

5 files changed

+5
-18
lines changed

5 files changed

+5
-18
lines changed

compiler/rustc_infer/src/traits/engine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub trait TraitEngine<'tcx>: 'tcx {
6363
infcx: &InferCtxt<'_, 'tcx>,
6464
) -> Result<(), Vec<FulfillmentError<'tcx>>>;
6565

66-
// FIXME this should not provide a default body for chalk as chalk should be updated
66+
// FIXME(fee1-dead) this should not provide a default body for chalk as chalk should be updated
6767
fn select_with_constness_where_possible(
6868
&mut self,
6969
infcx: &InferCtxt<'_, 'tcx>,

compiler/rustc_trait_selection/src/traits/select/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
316316
self.infcx.tcx
317317
}
318318

319-
/// returns `true` if the predicate is considered `const` to
319+
/// Returns `true` if the predicate is considered `const` to
320320
/// this selection context.
321321
pub fn is_predicate_const(&self, pred: ty::Predicate<'_>) -> bool {
322322
match pred.kind().skip_binder() {

compiler/rustc_traits/src/type_op.rs

+2-13
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ use rustc_infer::infer::{InferCtxt, TyCtxtInferExt};
66
use rustc_infer::traits::TraitEngineExt as _;
77
use rustc_middle::ty::query::Providers;
88
use rustc_middle::ty::subst::{GenericArg, Subst, UserSelfTy, UserSubsts};
9-
use rustc_middle::ty::{
10-
self, FnSig, Lift, PolyFnSig, PredicateKind, Ty, TyCtxt, TypeFoldable, Variance,
11-
};
9+
use rustc_middle::ty::{self, FnSig, Lift, PolyFnSig, Ty, TyCtxt, TypeFoldable, Variance};
1210
use rustc_middle::ty::{ParamEnv, ParamEnvAnd, Predicate, ToPredicate};
1311
use rustc_span::DUMMY_SP;
1412
use rustc_trait_selection::infer::InferCtxtBuilderExt;
@@ -87,16 +85,7 @@ impl AscribeUserTypeCx<'me, 'tcx> {
8785
Ok(())
8886
}
8987

90-
fn prove_predicate(&mut self, mut predicate: Predicate<'tcx>) {
91-
if let PredicateKind::Trait(mut tr) = predicate.kind().skip_binder() {
92-
if let hir::Constness::Const = tr.constness {
93-
// FIXME check if we actually want to prove const predicates inside AscribeUserType
94-
tr.constness = hir::Constness::NotConst;
95-
predicate =
96-
predicate.kind().rebind(PredicateKind::Trait(tr)).to_predicate(self.tcx());
97-
}
98-
}
99-
88+
fn prove_predicate(&mut self, predicate: Predicate<'tcx>) {
10089
self.fulfill_cx.register_predicate_obligation(
10190
self.infcx,
10291
Obligation::new(ObligationCause::dummy(), self.param_env, predicate),

library/alloc/tests/const_fns.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub const MY_VEC: Vec<usize> = Vec::new();
1010
#[allow(dead_code)]
1111
pub const MY_STRING: String = String::new();
1212

13-
// FIXME remove this struct once we put `K: ?const Ord` on BTreeMap::new.
13+
// FIXME(fee1-dead) remove this struct once we put `K: ?const Ord` on BTreeMap::new.
1414
#[derive(PartialEq, Eq, PartialOrd)]
1515
pub struct MyType;
1616

library/alloc/tests/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
#![feature(string_remove_matches)]
2626
#![feature(const_btree_new)]
2727
#![feature(const_trait_impl)]
28-
// FIXME remove this when const_trait_impl is not incomplete anymore
29-
#![allow(incomplete_features)]
3028

3129
use std::collections::hash_map::DefaultHasher;
3230
use std::hash::{Hash, Hasher};

0 commit comments

Comments
 (0)