merge struct similar_name test into the general test file

This commit is contained in:
Oliver Schneider 2016-05-11 17:01:34 +02:00
parent f004120495
commit 0bef7b5f74
No known key found for this signature in database
GPG Key ID: 56D6EEA0FC67AC46
2 changed files with 14 additions and 14 deletions

View File

@ -11,8 +11,15 @@
//~| NOTE: lint level defined here //~| NOTE: lint level defined here
//~| NOTE: lint level defined here //~| NOTE: lint level defined here
//~| NOTE: lint level defined here //~| NOTE: lint level defined here
//~| NOTE: lint level defined here
#![allow(unused)] #![allow(unused)]
struct Foo {
apple: i32,
bpple: i32,
}
fn main() { fn main() {
let specter: i32; let specter: i32;
let spectre: i32; let spectre: i32;
@ -90,6 +97,13 @@ fn main() {
let rx_cake: i32; let rx_cake: i32;
} }
fn foo() {
let Foo { apple, bpple } = unimplemented!();
let Foo { apple: spring, //~NOTE existing binding defined here
bpple: sprang } = unimplemented!(); //~ ERROR: name is too similar
//~^HELP for further information
}
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
enum MaybeInst { enum MaybeInst {
Split, Split,

View File

@ -1,14 +0,0 @@
#![feature(plugin)]
#![plugin(clippy)]
#![deny(clippy,similar_names)]
#![allow(unused)]
struct Foo {
apple: i32,
bpple: i32,
}
fn main() {
let Foo { apple, bpple } = unimplemented!();
let Foo { apple: spring, bpple: sprang } = unimplemented!(); //~ ERROR: name is too similar
}