Skip to content

Commit f4377a8

Browse files
authored
Rollup merge of #93682 - PatchMixolydic:where-in-the-world-is-const_fn_trait_bound, r=oli-obk
Update tracking issue for `const_fn_trait_bound` It previously pointed to #57563, the conglomerate issue for `const fn` (presumably under the feature gate `const_fn`). This tracking issue doesn't mention anything about `const_fn_trait_bound`(the only occurrence of "trait bound" is for the now-removed `?const Trait` syntax), which can be confusing to people who want to find out more about trait bounds on `const fn`s. This pull request changes the tracking issue to one meant specifically for `const_fn_trait_bound`, #93706, which can help collect information on this feature's stabilization and point users towards `const_trait_impl` if they're looking for const-in-const-contexts trait bounds. Fixes #93679. `````@rustbot````` modify labels +A-const-fn +F-const_trait_impl
2 parents bd245fa + 57b102f commit f4377a8

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

compiler/rustc_feature/src/active.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ declare_features! (
330330
/// Allows using and casting function pointers in a `const fn`.
331331
(active, const_fn_fn_ptr_basics, "1.48.0", Some(57563), None),
332332
/// Allows trait bounds in `const fn`.
333-
(active, const_fn_trait_bound, "1.53.0", Some(57563), None),
333+
(active, const_fn_trait_bound, "1.53.0", Some(93706), None),
334334
/// Allows `for _ in _` loops in const contexts.
335335
(active, const_for, "1.56.0", Some(87575), None),
336336
/// Allows argument and return position `impl Trait` in a `const fn`.

src/test/ui/consts/const_fn_trait_bound.stock.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0658]: trait bounds other than `Sized` on const fn parameters are unstabl
44
LL | const fn test1<T: std::ops::Add>() {}
55
| ^
66
|
7-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
7+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
88
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
99

1010
error[E0658]: trait objects in const fn are unstable
@@ -13,7 +13,7 @@ error[E0658]: trait objects in const fn are unstable
1313
LL | const fn test2(_x: &dyn Send) {}
1414
| ^^
1515
|
16-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
16+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
1717
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
1818

1919
error[E0658]: trait objects in const fn are unstable
@@ -22,7 +22,7 @@ error[E0658]: trait objects in const fn are unstable
2222
LL | const fn test3() -> &'static dyn Send { loop {} }
2323
| ^^^^^^^^^^^^^^^^^
2424
|
25-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
25+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
2626
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
2727

2828
error: aborting due to 3 previous errors

src/test/ui/consts/min_const_fn/min_const_fn.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ error[E0658]: trait bounds other than `Sized` on const fn parameters are unstabl
136136
LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t }
137137
| ^
138138
|
139-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
139+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
140140
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
141141

142142
error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
@@ -145,7 +145,7 @@ error[E0658]: trait bounds other than `Sized` on const fn parameters are unstabl
145145
LL | const fn foo11_2<T: Send>(t: T) -> T { t }
146146
| ^
147147
|
148-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
148+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
149149
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
150150

151151
error[E0013]: constant functions cannot refer to statics
@@ -218,7 +218,7 @@ LL |
218218
LL | const fn foo(&self) {}
219219
| ------------------- function declared as const here
220220
|
221-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
221+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
222222
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
223223

224224
error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
@@ -230,7 +230,7 @@ LL |
230230
LL | const fn foo2(&self) {}
231231
| -------------------- function declared as const here
232232
|
233-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
233+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
234234
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
235235

236236
error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
@@ -242,7 +242,7 @@ LL |
242242
LL | const fn foo3(&self) {}
243243
| -------------------- function declared as const here
244244
|
245-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
245+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
246246
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
247247

248248
error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
@@ -251,7 +251,7 @@ error[E0658]: trait bounds other than `Sized` on const fn parameters are unstabl
251251
LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
252252
| ^^^^^^^^^^^^^^^^^^^^
253253
|
254-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
254+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
255255
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
256256

257257
error[E0493]: destructors cannot be evaluated at compile-time
@@ -268,7 +268,7 @@ error[E0658]: trait bounds other than `Sized` on const fn parameters are unstabl
268268
LL | const fn no_apit(_x: impl std::fmt::Debug) {}
269269
| ^^^^^^^^^^^^^^^^^^^^
270270
|
271-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
271+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
272272
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
273273

274274
error[E0493]: destructors cannot be evaluated at compile-time
@@ -285,7 +285,7 @@ error[E0658]: trait objects in const fn are unstable
285285
LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {}
286286
| ^^
287287
|
288-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
288+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
289289
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
290290

291291
error[E0658]: trait objects in const fn are unstable
@@ -294,7 +294,7 @@ error[E0658]: trait objects in const fn are unstable
294294
LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
295295
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
296296
|
297-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
297+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
298298
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
299299

300300
error[E0658]: trait objects in const fn are unstable
@@ -305,7 +305,7 @@ LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1
305305
| |
306306
| function declared as const here
307307
|
308-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
308+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
309309
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
310310

311311
error[E0658]: trait objects in const fn are unstable
@@ -316,7 +316,7 @@ LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1
316316
| |
317317
| function declared as const here
318318
|
319-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
319+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
320320
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
321321

322322
error[E0658]: trait objects in const fn are unstable
@@ -327,7 +327,7 @@ LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1
327327
| |
328328
| function declared as const here
329329
|
330-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
330+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
331331
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
332332

333333
error[E0658]: function pointers cannot appear in constant functions

src/test/ui/consts/min_const_fn/min_const_fn_dyn.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | const fn no_inner_dyn_trait2(x: Hide) {
66
LL | x.0.field;
77
| ^^^^^^^^^
88
|
9-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
9+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
1010
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
1111

1212
error[E0658]: trait objects in const fn are unstable
@@ -17,7 +17,7 @@ LL | const fn no_inner_dyn_trait_ret() -> Hide { Hide(HasDyn { field: &0 }) }
1717
| |
1818
| function declared as const here
1919
|
20-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
20+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
2121
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
2222

2323
error: aborting due to 2 previous errors

src/test/ui/nll/issue-55825-const-fn.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0658]: trait objects in const fn are unstable
44
LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
7+
= note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
88
= help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
99

1010
error: aborting due to previous error

0 commit comments

Comments
 (0)