Skip to content

Commit 36dda45

Browse files
committed
add a HACK to allow stdarch migration
1 parent 16b9bb7 commit 36dda45

File tree

3 files changed

+9
-21
lines changed

3 files changed

+9
-21
lines changed

compiler/rustc_passes/src/stability.rs

+3
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
189189
&& let Some(fn_sig) = fn_sig
190190
&& const_stab.is_const_stable()
191191
&& !stab.is_some_and(|(s, _)| s.is_stable())
192+
// FIXME: we skip this check targets until
193+
// <https://github.com/rust-lang/stdarch/pull/1654> propagates.
194+
&& false
192195
{
193196
self.tcx
194197
.dcx()

tests/ui/consts/rustc-const-stability-require-const.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,16 @@ pub const fn foobar() {}
4747
pub const fn barfoo() {}
4848

4949
// `rustc_const_stable` also requires the function to be stable.
50+
// FIXME: these are disabled until <https://github.com/rust-lang/stdarch/pull/1654> propagates.
5051

5152
#[rustc_const_stable(feature = "barfoo_const", since = "1.0.0")]
5253
const fn barfoo_unmarked() {}
53-
//~^ ERROR can only be applied to functions that are declared `#[stable]`
54+
// FIXME disabled ERROR can only be applied to functions that are declared `#[stable]`
5455

5556
#[unstable(feature = "unstable", issue = "none")]
5657
#[rustc_const_stable(feature = "barfoo_const", since = "1.0.0")]
5758
pub const fn barfoo_unstable() {}
58-
//~^ ERROR can only be applied to functions that are declared `#[stable]`
59+
// FIXME disabled ERROR can only be applied to functions that are declared `#[stable]`
5960

6061
// `#[rustc_const_stable_indirect]` also requires a const fn
6162
#[rustc_const_stable_indirect]

tests/ui/consts/rustc-const-stability-require-const.stderr

+3-19
Original file line numberDiff line numberDiff line change
@@ -70,33 +70,17 @@ help: make the function or method const
7070
LL | pub extern "C" fn foo_c() {}
7171
| ^^^^^^^^^^^^^^^^^^^^^^^^^
7272

73-
error: attribute `#[rustc_const_stable]` can only be applied to functions that are declared `#[stable]`
74-
--> $DIR/rustc-const-stability-require-const.rs:52:1
75-
|
76-
LL | #[rustc_const_stable(feature = "barfoo_const", since = "1.0.0")]
77-
| ---------------------------------------------------------------- attribute specified here
78-
LL | const fn barfoo_unmarked() {}
79-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
80-
81-
error: attribute `#[rustc_const_stable]` can only be applied to functions that are declared `#[stable]`
82-
--> $DIR/rustc-const-stability-require-const.rs:57:1
83-
|
84-
LL | #[rustc_const_stable(feature = "barfoo_const", since = "1.0.0")]
85-
| ---------------------------------------------------------------- attribute specified here
86-
LL | pub const fn barfoo_unstable() {}
87-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88-
8973
error: attributes `#[rustc_const_unstable]`, `#[rustc_const_stable]` and `#[rustc_const_stable_indirect]` require the function or method to be `const`
90-
--> $DIR/rustc-const-stability-require-const.rs:63:1
74+
--> $DIR/rustc-const-stability-require-const.rs:64:1
9175
|
9276
LL | pub fn not_a_const_fn() {}
9377
| ^^^^^^^^^^^^^^^^^^^^^^^
9478
|
9579
help: make the function or method const
96-
--> $DIR/rustc-const-stability-require-const.rs:63:1
80+
--> $DIR/rustc-const-stability-require-const.rs:64:1
9781
|
9882
LL | pub fn not_a_const_fn() {}
9983
| ^^^^^^^^^^^^^^^^^^^^^^^
10084

101-
error: aborting due to 9 previous errors
85+
error: aborting due to 7 previous errors
10286

0 commit comments

Comments
 (0)