Skip to content
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

Add an experimental feature gate for function delegation #117978

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,8 @@ declare_features! (
(unstable, ffi_returns_twice, "1.34.0", Some(58314), None),
/// Allows using `#[repr(align(...))]` on function items
(unstable, fn_align, "1.53.0", Some(82232), None),
/// Support delegating implementation of functions to other already implemented functions.
(incomplete, fn_delegation, "CURRENT_RUSTC_VERSION", Some(118212), None),
/// Allows defining gen blocks and `gen fn`.
(unstable, gen_blocks, "1.75.0", Some(117078), None),
/// Infer generic args for both consts and types.
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ symbols! {
fmt,
fmul_fast,
fn_align,
fn_delegation,
fn_must_use,
fn_mut,
fn_once,
Expand Down
3 changes: 3 additions & 0 deletions tests/ui/feature-gates/feature-gate-fn_delegation.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
todo!(); //~ ERROR

fn main() {}
13 changes: 13 additions & 0 deletions tests/ui/feature-gates/feature-gate-fn_delegation.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error: expected one of `!` or `::`, found `(`
--> $DIR/feature-gate-fn_delegation.rs:1:1
|
LL | todo!();
| ^^^^^^^
| |
| expected one of `!` or `::`
| in this macro invocation
|
= note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

Loading