Rollup merge of #66381 - Centril:66340, r=petrochenkov

find_deprecation: deprecation attr may be ill-formed meta.

Fixes #66340.

r? @petrochenkov
cc @pnkfelix
This commit is contained in:
Yuki Okushi 2019-11-17 13:36:15 +09:00 committed by GitHub
commit 842612fcc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View file

@ -0,0 +1,11 @@
// The original problem in #66340 was that `find_deprecation_generic`
// called `attr.meta().unwrap()` under the assumption that the attribute
// was a well-formed `MetaItem`.
fn main() {
foo()
}
#[deprecated(note = test)]
//~^ ERROR expected unsuffixed literal or identifier, found `test`
fn foo() {}

View file

@ -0,0 +1,8 @@
error: expected unsuffixed literal or identifier, found `test`
--> $DIR/issue-66340-deprecated-attr-non-meta-grammar.rs:9:21
|
LL | #[deprecated(note = test)]
| ^^^^
error: aborting due to previous error