@@ -194,7 +194,7 @@ impl<'a> LintLevelsBuilder<'a> {
194194 struct_span_err ! ( sess, span, E0452 , "malformed lint attribute" )
195195 } ;
196196 for attr in attrs {
197- let level = match Level :: from_str ( & attr. name ( ) . as_str ( ) ) {
197+ let level = match attr. ident_str ( ) . and_then ( |name| Level :: from_str ( name ) ) {
198198 None => continue ,
199199 Some ( lvl) => lvl,
200200 } ;
@@ -255,9 +255,9 @@ impl<'a> LintLevelsBuilder<'a> {
255255 }
256256
257257 for li in metas {
258- let word = match li. word ( ) {
259- Some ( word ) => word ,
260- None => {
258+ let meta_item = match li. meta_item ( ) {
259+ Some ( meta_item ) if meta_item . is_word ( ) => meta_item ,
260+ _ => {
261261 let mut err = bad_attr ( li. span ) ;
262262 if let Some ( item) = li. meta_item ( ) {
263263 if let ast:: MetaItemKind :: NameValue ( _) = item. node {
@@ -270,23 +270,24 @@ impl<'a> LintLevelsBuilder<'a> {
270270 continue ;
271271 }
272272 } ;
273- let tool_name = if let Some ( lint_tool) = word. is_scoped ( ) {
274- if !attr:: is_known_lint_tool ( lint_tool) {
273+ let tool_name = if meta_item. ident . segments . len ( ) > 1 {
274+ let tool_ident = meta_item. ident . segments [ 0 ] . ident ;
275+ if !attr:: is_known_lint_tool ( tool_ident) {
275276 span_err ! (
276277 sess,
277- lint_tool . span,
278+ tool_ident . span,
278279 E0710 ,
279280 "an unknown tool name found in scoped lint: `{}`" ,
280- word . ident
281+ meta_item . ident
281282 ) ;
282283 continue ;
283284 }
284285
285- Some ( lint_tool . as_str ( ) )
286+ Some ( tool_ident . as_str ( ) )
286287 } else {
287288 None
288289 } ;
289- let name = word . name ( ) ;
290+ let name = meta_item . ident . segments . last ( ) . expect ( "empty lint name" ) . ident . name ;
290291 match store. check_lint_name ( & name. as_str ( ) , tool_name) {
291292 CheckLintNameResult :: Ok ( ids) => {
292293 let src = LintSource :: Node ( name, li. span , reason) ;
0 commit comments