Skip to content

Commit b5d2a6c

Browse files
committed
feat: Add 'frontmatter' unstable feature
1 parent e55878b commit b5d2a6c

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
@@ -501,6 +501,8 @@ declare_features! (
501501
(incomplete, fn_delegation, "1.76.0", Some(118212)),
502502
/// Allows impls for the Freeze trait.
503503
(internal, freeze_impls, "1.78.0", Some(121675)),
504+
/// Frontmatter blocks for build tool metadata.
505+
(unstable, frontmatter, "CURRENT_RUSTC_VERSION", Some(136889)),
504506
/// Allows defining gen blocks and `gen fn`.
505507
(unstable, gen_blocks, "1.75.0", Some(117078)),
506508
/// 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
@@ -1044,6 +1044,7 @@ symbols! {
10441044
from_u16,
10451045
from_usize,
10461046
from_yeet,
1047+
frontmatter,
10471048
fs_create_dir,
10481049
fsub_algebraic,
10491050
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)