get rid of min_const_fn references in library/ and rustdoc
This commit is contained in:
parent
1ecdaa29f9
commit
43126f3573
3 changed files with 7 additions and 14 deletions
|
@ -53,17 +53,11 @@ pub struct RawVec<T, A: Allocator = Global> {
|
|||
}
|
||||
|
||||
impl<T> RawVec<T, Global> {
|
||||
/// HACK(Centril): This exists because `#[unstable]` `const fn`s needn't conform
|
||||
/// to `min_const_fn` and so they cannot be called in `min_const_fn`s either.
|
||||
/// HACK(Centril): This exists because stable `const fn` can only call stable `const fn`, so
|
||||
/// they cannot call `Self::new()`.
|
||||
///
|
||||
/// If you change `RawVec<T>::new` or dependencies, please take care to not
|
||||
/// introduce anything that would truly violate `min_const_fn`.
|
||||
///
|
||||
/// NOTE: We could avoid this hack and check conformance with some
|
||||
/// `#[rustc_force_min_const_fn]` attribute which requires conformance
|
||||
/// with `min_const_fn` but does not necessarily allow calling it in
|
||||
/// `stable(...) const fn` / user code not enabling `foo` when
|
||||
/// `#[rustc_const_unstable(feature = "foo", issue = "01234")]` is present.
|
||||
/// If you change `RawVec<T>::new` or dependencies, please take care to not introduce anything
|
||||
/// that would truly const-call something unstable.
|
||||
pub const NEW: Self = Self::new();
|
||||
|
||||
/// Creates the biggest possible `RawVec` (on the system heap)
|
||||
|
|
|
@ -10,7 +10,6 @@ use rustc_hir::def_id::DefId;
|
|||
use rustc_hir::Mutability;
|
||||
use rustc_metadata::creader::LoadedMacro;
|
||||
use rustc_middle::ty::{self, TyCtxt};
|
||||
use rustc_mir::const_eval::is_min_const_fn;
|
||||
use rustc_span::hygiene::MacroKind;
|
||||
use rustc_span::symbol::{kw, sym, Symbol};
|
||||
use rustc_span::Span;
|
||||
|
@ -210,7 +209,7 @@ fn build_external_function(cx: &mut DocContext<'_>, did: DefId) -> clean::Functi
|
|||
let sig = cx.tcx.fn_sig(did);
|
||||
|
||||
let constness =
|
||||
if is_min_const_fn(cx.tcx, did) { hir::Constness::Const } else { hir::Constness::NotConst };
|
||||
if cx.tcx.is_const_fn_raw(did) { hir::Constness::Const } else { hir::Constness::NotConst };
|
||||
let asyncness = cx.tcx.asyncness(did);
|
||||
let predicates = cx.tcx.predicates_of(did);
|
||||
let (generics, decl) = clean::enter_impl_trait(cx, |cx| {
|
||||
|
|
|
@ -22,7 +22,7 @@ use rustc_middle::middle::resolve_lifetime as rl;
|
|||
use rustc_middle::ty::fold::TypeFolder;
|
||||
use rustc_middle::ty::subst::{InternalSubsts, Subst};
|
||||
use rustc_middle::ty::{self, AdtKind, Lift, Ty, TyCtxt};
|
||||
use rustc_mir::const_eval::{is_const_fn, is_min_const_fn, is_unstable_const_fn};
|
||||
use rustc_mir::const_eval::{is_const_fn, is_unstable_const_fn};
|
||||
use rustc_span::hygiene::{AstPass, MacroKind};
|
||||
use rustc_span::symbol::{kw, sym, Ident, Symbol};
|
||||
use rustc_span::{self, ExpnKind};
|
||||
|
@ -1048,7 +1048,7 @@ impl Clean<Item> for ty::AssocItem {
|
|||
ty::TraitContainer(_) => self.defaultness.has_value(),
|
||||
};
|
||||
if provided {
|
||||
let constness = if is_min_const_fn(tcx, self.def_id) {
|
||||
let constness = if tcx.is_const_fn_raw(self.def_id) {
|
||||
hir::Constness::Const
|
||||
} else {
|
||||
hir::Constness::NotConst
|
||||
|
|
Loading…
Reference in a new issue