Change missing trailing comma span to point to span where comma is missing from

Signed-off-by: Torstein Grindvik <torstein.grindvik@nordicsemi.no>
This commit is contained in:
Torstein Grindvik committed 2023-07-02 15:19:03 +02:00
1 parent 6512c153dd
commit a3169ac17b
5 files changed
+29 -2

No files matched your search

+1
View File
@@ -22,6 +22,7 @@ dioxus-rsx = { workspace = true }
# testing
[dev-dependencies]
dioxus = { workspace = true }
rustversion = "1.0"
trybuild = "1.0"
+5
View File
@@ -0,0 +1,5 @@
#[test]
fn rsx() {
let t = trybuild::TestCases::new();
t.compile_fail("tests/rsx/trailing-comma-0.rs");
}
@@ -0,0 +1,13 @@
// Given an `rsx!` invocation with a missing trailing comma,
// ensure the stderr output has an informative span.
use dioxus::prelude::*;
fn main() {
rsx! {
p {
class: "foo bar"
"Hello world"
}
};
}
@@ -0,0 +1,5 @@
error: missing trailing comma
--> tests/rsx/trailing-comma-0.rs:9:20
|
9 | class: "foo bar"
| ^^^^^^^^^