-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc: Clarify const-stability with regard to normal stability #125599
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -627,7 +627,7 @@ impl Item { | |
) -> 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_none() { | ||
if tcx.is_const_fn(def_id) || is_unstable_const_fn(tcx, def_id).is_some() { | ||
hir::Constness::Const | ||
} else { | ||
hir::Constness::NotConst | ||
|
@@ -649,9 +649,8 @@ impl Item { | |
hir::Safety::Unsafe | ||
}, | ||
abi, | ||
constness: if abi == Abi::RustIntrinsic | ||
&& tcx.is_const_fn(def_id) | ||
&& is_unstable_const_fn(tcx, def_id).is_none() | ||
Comment on lines
-652
to
-654
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure what this intrinsic special-casing was about, so I should probably look into if we still need it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, it seems like it was just to be conservative, but I can't think of any reason why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove it and see what's breaking? 😆 |
||
constness: if tcx.is_const_fn(def_id) | ||
|| is_unstable_const_fn(tcx, def_id).is_some() | ||
{ | ||
hir::Constness::Const | ||
} else { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that not only is this necessary for this PR, but also is more accurate since it matches how the function is actually declared.