Skip to content

Commit 66038fa

Browse files
committed
test(lints): Show bug with lints on stable
1 parent a7555f9 commit 66038fa

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

tests/testsuite/lints.rs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,70 @@ See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#lints for mo
6767
.run();
6868
}
6969

70+
#[cargo_test]
71+
fn malformed_on_stable() {
72+
let foo = project()
73+
.file(
74+
"Cargo.toml",
75+
r#"
76+
lints = 20
77+
[package]
78+
name = "foo"
79+
version = "0.0.1"
80+
authors = []
81+
82+
"#,
83+
)
84+
.file("src/lib.rs", "")
85+
.build();
86+
87+
foo.cargo("check")
88+
.with_status(101)
89+
.with_stderr(
90+
"\
91+
error: failed to parse manifest[..]
92+
93+
Caused by:
94+
invalid type: integer `20`, expected a map
95+
in `lints`
96+
",
97+
)
98+
.run();
99+
}
100+
101+
#[cargo_test]
102+
fn malformed_on_nightly() {
103+
let foo = project()
104+
.file(
105+
"Cargo.toml",
106+
r#"
107+
cargo-features = ["lints"]
108+
lints = 20
109+
[package]
110+
name = "foo"
111+
version = "0.0.1"
112+
authors = []
113+
114+
"#,
115+
)
116+
.file("src/lib.rs", "")
117+
.build();
118+
119+
foo.cargo("check")
120+
.masquerade_as_nightly_cargo(&["lints"])
121+
.with_status(101)
122+
.with_stderr(
123+
"\
124+
error: failed to parse manifest[..]
125+
126+
Caused by:
127+
invalid type: integer `20`, expected a map
128+
in `lints`
129+
",
130+
)
131+
.run();
132+
}
133+
70134
#[cargo_test]
71135
fn fail_on_invalid_tool() {
72136
let foo = project()

0 commit comments

Comments
 (0)