Skip to content

Commit 1765ee5

Browse files
committed
[errors] Add available attributes in unexpected attribute error
This is same as available types. Signed-off-by: Manas <manas18244@iiitd.ac.in>
1 parent ee2eb81 commit 1765ee5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/error.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl Display for QccErrorKind {
8787
NoSuchArg => "no such argument",
8888
NoFile => "no such file",
8989
ExpectedAttr => "expected attribute list as #[<attr>]",
90-
UnexpectedAttr => "unexpected attribute",
90+
UnexpectedAttr => "unexpected attribute [available: deter, nondeter]",
9191
LexerError => "lexer failed to tokenize",
9292
ParseError => "could not parse source",
9393
ExpectedFnForAttr => "expected a function for attribute",
@@ -396,7 +396,10 @@ mod tests {
396396
let e1: Result<()> = Err(UnexpectedAttr.into());
397397
match e1 {
398398
Ok(_) => unreachable!(),
399-
Err(ref e) => assert_eq!(e.to_string(), "unexpected attribute"),
399+
Err(ref e) => assert_eq!(
400+
e.to_string(),
401+
"unexpected attribute [available: deter, nondeter]"
402+
),
400403
}
401404

402405
let e2: Result<()> = Err(NoFile.into());

0 commit comments

Comments
 (0)