forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#129659 - RalfJung:const-fn-lang-feat, r=fee…
…1-dead const fn stability checking: also check declared language features Fixes rust-lang#129656 `@oli-obk` I assume it is just an oversight that this didn't use `features().declared()`? Or is there a deep reason that this must only check `declared_lib_features`?
- Loading branch information
Showing
3 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//! Ensure that we can use a language feature with a `const fn`: | ||
//! enabling the feature gate actually lets us call the function. | ||
//@ check-pass | ||
|
||
#![feature(staged_api, abi_unadjusted)] | ||
#![stable(feature = "rust_test", since = "1.0.0")] | ||
|
||
#[unstable(feature = "abi_unadjusted", issue = "42")] | ||
#[rustc_const_unstable(feature = "abi_unadjusted", issue = "42")] | ||
const fn my_fun() {} | ||
|
||
#[unstable(feature = "abi_unadjusted", issue = "42")] | ||
#[rustc_const_unstable(feature = "abi_unadjusted", issue = "42")] | ||
const fn my_fun2() { | ||
my_fun() | ||
} | ||
|
||
fn main() { | ||
const { my_fun2() }; | ||
} |