Skip to content

Commit b9eb5be

Browse files
committed
test: Show frontmatter behavior before impl
1 parent ce36a96 commit b9eb5be

38 files changed

+365
-0
lines changed

Diff for: tests/ui/feature-gates/feature-gate-frontmatter.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
//~^ ERROR expected item, found `-`
3+
---
4+
5+
pub fn main() {
6+
}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/feature-gate-frontmatter.rs:1:1
3+
|
4+
LL | ---
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+

Diff for: tests/ui/frontmatter/frontmatter-escaped.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-----
2+
//~^ ERROR expected item, found `-`
3+
4+
---
5+
---
6+
7+
-----
8+
9+
#![feature(frontmatter)]
10+
11+
fn main() {
12+
}

Diff for: tests/ui/frontmatter/frontmatter-escaped.stderr

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-escaped.rs:1:1
3+
|
4+
LL | -----
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+

Diff for: tests/ui/frontmatter/frontmatter-ignored-space.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
3+
---
4+
//~^ ERROR expected item, found `-`
5+
6+
---
7+
8+
#![feature(frontmatter)]
9+
// ignore-tidy-end-whitespace
10+
// ignore-tidy-leading-newlines
11+
12+
fn main() {
13+
}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-ignored-space.rs:3:1
3+
|
4+
LL | ---
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![feature(frontmatter)]
2+
3+
---
4+
//~^ ERROR expected item, found `-`
5+
---
6+
7+
fn main() {
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-invalid-after-attribute.rs:3:1
3+
|
4+
LL | ---
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Comment
2+
3+
---
4+
//~^ ERROR expected item, found `-`
5+
---
6+
7+
#![feature(frontmatter)]
8+
9+
fn main() {
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-invalid-after-comment.rs:3:1
3+
|
4+
LL | ---
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+

Diff for: tests/ui/frontmatter/frontmatter-invalid-escaped.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
//~^ ERROR expected item, found `-`
3+
4+
-----
5+
-----
6+
7+
---
8+
9+
#![feature(frontmatter)]
10+
11+
fn main() {
12+
}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-invalid-escaped.rs:1:1
3+
|
4+
LL | ---
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+

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

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![feature(frontmatter)]
2+
//~^ unknown feature `frontmatter`
3+
4+
fn main() {
5+
---
6+
---
7+
}
8+
//~^ ERROR expected expression, found `}`
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error: expected expression, found `}`
2+
--> $DIR/frontmatter-invalid-in-fn.rs:7:1
3+
|
4+
LL | }
5+
| ^ expected expression
6+
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
14+
15+
For more information about this error, try `rustc --explain E0635`.
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
//~^ ERROR expected item, found `-`
3+
---
4+
5+
#![feature(frontmatter)]
6+
7+
fn main() {
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-invalid-indentation.rs:1:3
3+
|
4+
LL | ---
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
//~^ ERROR expected item, found `-`
3+
----
4+
5+
#![feature(frontmatter)]
6+
7+
fn main() {
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-invalid-mismatched-close.rs:1:1
3+
|
4+
LL | ---
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+

Diff for: tests/ui/frontmatter/frontmatter-invalid-multiple.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---cargo
2+
//~^ ERROR expected item, found `-`
3+
---
4+
5+
---buck
6+
---
7+
8+
#![feature(frontmatter)]
9+
10+
fn main() {
11+
}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-invalid-multiple.rs:1:1
3+
|
4+
LL | ---cargo
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---cargo,hello-world
2+
//~^ ERROR expected item, found `-`
3+
---
4+
5+
#![feature(frontmatter)]
6+
7+
fn main() {
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-invalid-non-ident-infostring.rs:1:1
3+
|
4+
LL | ---cargo,hello-world
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--
2+
//~^ ERROR expected item, found `-`
3+
--
4+
5+
#![feature(frontmatter)]
6+
7+
fn main() {
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-invalid-short-open.rs:1:1
3+
|
4+
LL | --
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
//~^ ERROR expected item, found `-`
3+
--- text
4+
5+
#![feature(frontmatter)]
6+
7+
fn main() {
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-invalid-trailing-text.rs:1:1
3+
|
4+
LL | ---
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+

Diff for: tests/ui/frontmatter/frontmatter-invalid-unclosed.rs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
//~^ ERROR expected item, found `-`
3+
4+
#![feature(frontmatter)]
5+
6+
fn main() {
7+
}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-invalid-unclosed.rs:1:1
3+
|
4+
LL | ---
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+

Diff for: tests/ui/frontmatter/frontmatter-with-body.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
//~^ ERROR expected item, found `-`
3+
[dependencies]
4+
---
5+
6+
#![feature(frontmatter)]
7+
8+
fn main() {
9+
}

Diff for: tests/ui/frontmatter/frontmatter-with-body.stderr

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-with-body.rs:1:1
3+
|
4+
LL | ---
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
--- cargo
2+
//~^ ERROR expected item, found `-`
3+
---
4+
5+
#![feature(frontmatter)]
6+
7+
fn main() {
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-with-infostring-spaces.rs:1:1
3+
|
4+
LL | --- cargo
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+

Diff for: tests/ui/frontmatter/frontmatter-with-infostring.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---cargo
2+
//~^ ERROR expected item, found `-`
3+
---
4+
5+
#![feature(frontmatter)]
6+
7+
fn main() {
8+
}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter-with-infostring.rs:1:1
3+
|
4+
LL | ---cargo
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+

Diff for: tests/ui/frontmatter/frontmatter.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
//~^ ERROR expected item, found `-`
3+
---
4+
5+
#![feature(frontmatter)]
6+
7+
fn main() {
8+
}

Diff for: tests/ui/frontmatter/frontmatter.stderr

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: expected item, found `-`
2+
--> $DIR/frontmatter.rs:1:1
3+
|
4+
LL | ---
5+
| ^ expected item
6+
|
7+
= note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>
8+
9+
error: aborting due to 1 previous error
10+

Diff for: tests/ui/unpretty/frontmatter.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
//~^ ERROR expected item, found `-`
3+
---
4+
5+
//@ compile-flags: -Zunpretty=normal
6+
7+
#![feature(frontmatter)]
8+
9+
fn main() {
10+
}

0 commit comments

Comments
 (0)