2024-04-18 10:48:52 -05:00
|
|
|
//@aux-build:proc_macro_attr.rs
|
2024-05-21 12:39:30 -05:00
|
|
|
#![feature(rustc_attrs)]
|
2024-03-21 16:20:40 -05:00
|
|
|
#![warn(clippy::duplicated_attributes)]
|
|
|
|
#![cfg(any(unix, windows))]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
#![allow(dead_code)] //~ ERROR: duplicated attribute
|
2024-04-04 12:52:55 -05:00
|
|
|
#![cfg(any(unix, windows))] // Should not warn!
|
2024-03-21 16:20:40 -05:00
|
|
|
|
2024-04-18 10:48:52 -05:00
|
|
|
#[macro_use]
|
|
|
|
extern crate proc_macro_attr;
|
|
|
|
|
2024-03-21 16:20:40 -05:00
|
|
|
#[cfg(any(unix, windows, target_os = "linux"))]
|
|
|
|
#[allow(dead_code)]
|
|
|
|
#[allow(dead_code)] //~ ERROR: duplicated attribute
|
2024-04-04 12:52:55 -05:00
|
|
|
#[cfg(any(unix, windows, target_os = "linux"))] // Should not warn!
|
2024-03-21 16:20:40 -05:00
|
|
|
fn foo() {}
|
|
|
|
|
2024-04-04 12:52:55 -05:00
|
|
|
#[cfg(unix)]
|
|
|
|
#[cfg(windows)]
|
2024-04-18 10:48:52 -05:00
|
|
|
#[cfg(unix)] // cfgs are not handled
|
2024-04-04 12:52:55 -05:00
|
|
|
fn bar() {}
|
|
|
|
|
2024-05-21 12:39:30 -05:00
|
|
|
// No warning:
|
|
|
|
#[rustc_on_unimplemented(on(_Self = "&str", label = "`a"), on(_Self = "alloc::string::String", label = "a"))]
|
|
|
|
trait Abc {}
|
|
|
|
|
2024-04-18 10:48:52 -05:00
|
|
|
#[proc_macro_attr::duplicated_attr()] // Should not warn!
|
|
|
|
fn babar() {}
|
|
|
|
|
2024-09-24 04:58:04 -05:00
|
|
|
#[allow(missing_docs, reason = "library for internal use only")]
|
|
|
|
#[allow(exported_private_dependencies, reason = "library for internal use only")]
|
|
|
|
fn duplicate_reason() {}
|
|
|
|
|
2024-03-21 16:20:40 -05:00
|
|
|
fn main() {}
|