2022-06-15 10:37:40 +00:00
|
|
|
// revisions: with-generic-asset without-generic-asset
|
|
|
|
// [with-generic-asset] compile-flags: --cfg feature="generic_assert"
|
|
|
|
|
2019-04-17 11:01:57 +00:00
|
|
|
// Ensure assert macro does not ignore trailing garbage.
|
|
|
|
//
|
|
|
|
// See https://github.com/rust-lang/rust/issues/60024 for details.
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert!(true some extra junk, "whatever");
|
|
|
|
//~^ ERROR expected one of
|
|
|
|
|
|
|
|
assert!(true some extra junk);
|
|
|
|
//~^ ERROR expected one of
|
|
|
|
|
|
|
|
assert!(true, "whatever" blah);
|
|
|
|
//~^ ERROR no rules expected
|
2019-04-24 22:44:28 +00:00
|
|
|
|
|
|
|
assert!(true "whatever" blah);
|
2020-02-28 13:10:33 +00:00
|
|
|
//~^ ERROR unexpected string literal
|
2019-04-24 22:44:28 +00:00
|
|
|
//~^^ ERROR no rules expected
|
|
|
|
|
|
|
|
assert!(true;);
|
2020-02-28 13:10:33 +00:00
|
|
|
//~^ ERROR macro requires an expression
|
2019-04-24 22:44:28 +00:00
|
|
|
|
|
|
|
assert!(false || true "error message");
|
2020-02-28 13:10:33 +00:00
|
|
|
//~^ ERROR unexpected string literal
|
2019-04-17 11:01:57 +00:00
|
|
|
}
|