File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,10 @@ fn check_duplicated_attr(
37
37
}
38
38
let Some ( ident) = attr. ident ( ) else { return } ;
39
39
let name = ident. name ;
40
- if name == sym:: doc || name == sym:: cfg_attr {
40
+ if name == sym:: doc || name == sym:: cfg_attr || name == sym :: rustc_on_unimplemented {
41
41
// FIXME: Would be nice to handle `cfg_attr` as well. Only problem is to check that cfg
42
42
// conditions are the same.
43
+ // `#[rustc_on_unimplemented]` contains duplicated subattributes, that's expected.
43
44
return ;
44
45
}
45
46
if let Some ( direct_parent) = parent. last ( )
Original file line number Diff line number Diff line change @@ -15,4 +15,17 @@ fn foo() {}
15
15
#[ cfg( unix) ] //~ ERROR: duplicated attribute
16
16
fn bar ( ) { }
17
17
18
+ // No warning:
19
+ #[ rustc_on_unimplemented(
20
+ on(
21
+ _Self = "&str" ,
22
+ label = "`a"
23
+ ) ,
24
+ on(
25
+ _Self = "alloc::string::String" ,
26
+ label = "a"
27
+ ) ,
28
+ ) ]
29
+ trait Abc { }
30
+
18
31
fn main ( ) { }
You can’t perform that action at this time.
0 commit comments