Skip to content

Commit edf6c9c

Browse files
committed
Add an experimental feature gate for function delegation
In accordance with the [process](https://github.com/rust-lang/lang-team/blob/master/src/how_to/experiment.md). Detailed description of the feature can be found in the RFC repo - rust-lang/rfcs#3530.
1 parent e7b2285 commit edf6c9c

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed

compiler/rustc_feature/src/unstable.rs

+2
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,8 @@ declare_features! (
456456
(unstable, ffi_returns_twice, "1.34.0", Some(58314), None),
457457
/// Allows using `#[repr(align(...))]` on function items
458458
(unstable, fn_align, "1.53.0", Some(82232), None),
459+
/// Support delegating implementation of functions to other already implemented functions.
460+
(incomplete, fn_delegation, "CURRENT_RUSTC_VERSION", Some(118212), None),
459461
/// Allows defining gen blocks and `gen fn`.
460462
(unstable, gen_blocks, "1.75.0", Some(117078), None),
461463
/// Infer generic args for both consts and types.

compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,7 @@ symbols! {
787787
fmt,
788788
fmul_fast,
789789
fn_align,
790+
fn_delegation,
790791
fn_must_use,
791792
fn_mut,
792793
fn_once,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
todo!(); //~ ERROR
2+
3+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error: expected one of `!` or `::`, found `(`
2+
--> $DIR/feature-gate-fn_delegation.rs:1:1
3+
|
4+
LL | todo!();
5+
| ^^^^^^^
6+
| |
7+
| expected one of `!` or `::`
8+
| in this macro invocation
9+
|
10+
= note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
11+
12+
error: aborting due to previous error
13+

0 commit comments

Comments
 (0)