Skip to content

Commit 593a95c

Browse files
committed
feat: Add 'frontmatter' unstable feature
1 parent 09566d1 commit 593a95c

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

Diff for: compiler/rustc_feature/src/unstable.rs

+2
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,8 @@ declare_features! (
500500
(incomplete, fn_delegation, "1.76.0", Some(118212)),
501501
/// Allows impls for the Freeze trait.
502502
(internal, freeze_impls, "1.78.0", Some(121675)),
503+
/// Frontmatter blocks for build tool metadata.
504+
(unstable, frontmatter, "CURRENT_RUSTC_VERSION", Some(136889)),
503505
/// Allows defining gen blocks and `gen fn`.
504506
(unstable, gen_blocks, "1.75.0", Some(117078)),
505507
/// Infer generic args for both consts and types.

Diff for: compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,7 @@ symbols! {
10141014
from_str_method,
10151015
from_usize,
10161016
from_yeet,
1017+
frontmatter,
10171018
fs_create_dir,
10181019
fsub_algebraic,
10191020
fsub_fast,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# `frontmatter`
2+
3+
The tracking issue for this feature is: [#136889]
4+
5+
[#136889]: https://github.com/rust-lang/rust/issues/136889
6+
7+
------------------------
8+
9+
The `frontmatter` feature adds support for a specialized and simplified attribute syntax
10+
intended for external tools to consume.

Diff for: tests/ui/frontmatter/frontmatter-invalid-in-fn.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(frontmatter)]
2-
//~^ unknown feature `frontmatter`
32

43
fn main() {
54
---
+2-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
error: expected expression, found `}`
2-
--> $DIR/frontmatter-invalid-in-fn.rs:7:1
2+
--> $DIR/frontmatter-invalid-in-fn.rs:6:1
33
|
44
LL | }
55
| ^ expected expression
66

7-
error[E0635]: unknown feature `frontmatter`
8-
--> $DIR/frontmatter-invalid-in-fn.rs:1:12
9-
|
10-
LL | #![feature(frontmatter)]
11-
| ^^^^^^^^^^^
12-
13-
error: aborting due to 2 previous errors
7+
error: aborting due to 1 previous error
148

15-
For more information about this error, try `rustc --explain E0635`.

0 commit comments

Comments
 (0)