rust/tests/run-pass/used_underscore_binding_macro.rs

32 lines
824 B
Rust
Raw Normal View History

2018-10-06 09:18:06 -07:00
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
2018-10-11 12:16:22 +02:00
2018-07-30 11:33:44 +02:00
#![allow(clippy::useless_attribute)] //issue #2910
2015-12-21 01:40:19 -08:00
2017-01-24 18:06:17 +01:00
#[macro_use]
extern crate serde_derive;
2015-12-21 01:40:19 -08:00
2017-04-12 11:06:32 +02:00
/// Test that we do not lint for unused underscores in a `MacroAttribute`
/// expansion
2018-07-30 11:33:44 +02:00
#[deny(clippy::used_underscore_binding)]
#[derive(Deserialize)]
2015-12-21 01:40:19 -08:00
struct MacroAttributesTest {
_foo: u32,
}
#[test]
fn macro_attributes_test() {
let _ = MacroAttributesTest { _foo: 0 };
2015-12-21 01:40:19 -08:00
}
fn main() {}