2017-02-07 14:05:30 -06:00
|
|
|
#![feature(plugin)]
|
|
|
|
|
|
|
|
#![plugin(clippy)]
|
|
|
|
#![deny(clippy)]
|
|
|
|
#![allow(unused, if_let_redundant_pattern_matching)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
#[derive(Debug)]
|
|
|
|
enum Foo {
|
|
|
|
A(String),
|
|
|
|
B,
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Thingy(Foo);
|
|
|
|
|
|
|
|
macro_rules! issue_1404 {
|
|
|
|
($idx:tt) => {{
|
|
|
|
let thingy = Thingy(Foo::A("Foo".into()));
|
|
|
|
let t = &thingy;
|
|
|
|
|
|
|
|
match t.$idx { Foo::A(ref val) => { println!("42"); }, _ => {} }
|
2017-02-08 07:58:07 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
}}
|
|
|
|
}
|
|
|
|
|
|
|
|
issue_1404!(0)
|
|
|
|
}
|