@@ -193,7 +193,7 @@ impl<'a> LintLevelsBuilder<'a> {
193193 struct_span_err ! ( sess, span, E0452 , "malformed lint attribute" )
194194 } ;
195195 for attr in attrs {
196- let level = match Level :: from_str ( & attr. name ( ) . as_str ( ) ) {
196+ let level = match attr. ident_str ( ) . and_then ( |name| Level :: from_str ( name ) ) {
197197 None => continue ,
198198 Some ( lvl) => lvl,
199199 } ;
@@ -254,9 +254,9 @@ impl<'a> LintLevelsBuilder<'a> {
254254 }
255255
256256 for li in metas {
257- let word = match li. word ( ) {
258- Some ( word ) => word ,
259- None => {
257+ let meta_item = match li. meta_item ( ) {
258+ Some ( meta_item ) if meta_item . is_word ( ) => meta_item ,
259+ _ => {
260260 let mut err = bad_attr ( li. span ) ;
261261 if let Some ( item) = li. meta_item ( ) {
262262 if let ast:: MetaItemKind :: NameValue ( _) = item. node {
@@ -269,23 +269,24 @@ impl<'a> LintLevelsBuilder<'a> {
269269 continue ;
270270 }
271271 } ;
272- let tool_name = if let Some ( lint_tool) = word. is_scoped ( ) {
273- if !attr:: is_known_lint_tool ( lint_tool) {
272+ let tool_name = if meta_item. ident . segments . len ( ) > 1 {
273+ let tool_ident = meta_item. ident . segments [ 0 ] . ident ;
274+ if !attr:: is_known_lint_tool ( tool_ident) {
274275 span_err ! (
275276 sess,
276- lint_tool . span,
277+ tool_ident . span,
277278 E0710 ,
278279 "an unknown tool name found in scoped lint: `{}`" ,
279- word . ident
280+ meta_item . ident
280281 ) ;
281282 continue ;
282283 }
283284
284- Some ( lint_tool . as_str ( ) )
285+ Some ( tool_ident . as_str ( ) )
285286 } else {
286287 None
287288 } ;
288- let name = word . name ( ) ;
289+ let name = meta_item . ident . segments . last ( ) . expect ( "empty lint name" ) . ident . name ;
289290 match store. check_lint_name ( & name. as_str ( ) , tool_name) {
290291 CheckLintNameResult :: Ok ( ids) => {
291292 let src = LintSource :: Node ( name, li. span , reason) ;
0 commit comments