diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/types.rs | 16 | ||||
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/lib.rs | 1 |
3 files changed, 9 insertions, 12 deletions
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index c8cb9267eb2..1c060fa0150 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -8,7 +8,6 @@ use arrayvec::ArrayVec; use rustc_ast::MetaItemInner; use rustc_ast_pretty::pprust; use rustc_attr::{ConstStability, Deprecation, Stability, StableSince}; -use rustc_const_eval::const_eval::is_unstable_const_fn; use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet}; use rustc_hir::def::{CtorKind, DefKind, Res}; use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE, LocalDefId}; @@ -641,12 +640,11 @@ impl Item { asyncness: ty::Asyncness, ) -> hir::FnHeader { let sig = tcx.fn_sig(def_id).skip_binder(); - let constness = - if tcx.is_const_fn(def_id) || is_unstable_const_fn(tcx, def_id).is_some() { - hir::Constness::Const - } else { - hir::Constness::NotConst - }; + let constness = if tcx.is_const_fn_raw(def_id) { + hir::Constness::Const + } else { + hir::Constness::NotConst + }; let asyncness = match asyncness { ty::Asyncness::Yes => hir::IsAsync::Async(DUMMY_SP), ty::Asyncness::No => hir::IsAsync::NotAsync, @@ -664,9 +662,7 @@ impl Item { safety }, abi, - constness: if tcx.is_const_fn(def_id) - || is_unstable_const_fn(tcx, def_id).is_some() - { + constness: if tcx.is_const_fn_raw(def_id) { hir::Constness::Const } else { hir::Constness::NotConst diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index ce96d1d0a95..8446235fb18 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1010,7 +1010,9 @@ fn render_stability_since_raw_with_extra( // don't display const unstable if entirely unstable None } else { - let unstable = if let Some(n) = issue { + let unstable = if let Some(n) = issue + && let Some(feature) = feature + { format!( "<a \ href=\"https://github.com/rust-lang/rust/issues/{n}\" \ diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index cb9b3985bf6..7c9dcd41e6a 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -37,7 +37,6 @@ extern crate rustc_abi; extern crate rustc_ast; extern crate rustc_ast_pretty; extern crate rustc_attr; -extern crate rustc_const_eval; extern crate rustc_data_structures; extern crate rustc_driver; extern crate rustc_errors; |
