Skip to content

Commit 197154b

Browse files
committed
feat: Add 'frontmatter' unstable feature
1 parent b9eb5be commit 197154b

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
@@ -510,6 +510,8 @@ declare_features! (
510510
(incomplete, fn_delegation, "1.76.0", Some(118212)),
511511
/// Allows impls for the Freeze trait.
512512
(internal, freeze_impls, "1.78.0", Some(121675)),
513+
/// Frontmatter blocks for build tool metadata.
514+
(unstable, frontmatter, "CURRENT_RUSTC_VERSION", Some(136889)),
513515
/// Allows defining gen blocks and `gen fn`.
514516
(unstable, gen_blocks, "1.75.0", Some(117078)),
515517
/// 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
@@ -1007,6 +1007,7 @@ symbols! {
10071007
from_str_method,
10081008
from_usize,
10091009
from_yeet,
1010+
frontmatter,
10101011
fs_create_dir,
10111012
fsub_algebraic,
10121013
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)