Deduplicate tests

* `ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-4`
and `ex3-both-anon-regions-both-are-structs-3`
* `ui/lint/lint-group-style` and `lint-group-nonstandard-style`
This commit is contained in:
Shotaro Yamada 2018-10-15 09:29:17 +09:00
parent 14f42a732f
commit ac6b3f88c7
5 changed files with 0 additions and 148 deletions

View File

@ -1,13 +0,0 @@
error: unsatisfied lifetime constraints
--> $DIR/ex3-both-anon-regions-both-are-structs-4.rs:16:5
|
LL | fn foo(mut x: Ref) {
| -----
| |
| has type `Ref<'_, '1>`
| has type `Ref<'2, '_>`
LL | x.a = x.b; //~ ERROR lifetime mismatch
| ^^^^^^^^^ assignment requires that `'1` must outlive `'2`
error: aborting due to previous error

View File

@ -1,19 +0,0 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// 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.
struct Ref<'a, 'b> {
a: &'a u32,
b: &'b u32,
}
fn foo(mut x: Ref) {
x.a = x.b; //~ ERROR lifetime mismatch
}
fn main() {}

View File

@ -1,13 +0,0 @@
error[E0623]: lifetime mismatch
--> $DIR/ex3-both-anon-regions-both-are-structs-4.rs:16:11
|
LL | fn foo(mut x: Ref) {
| ---
| |
| this type is declared with multiple lifetimes...
LL | x.a = x.b; //~ ERROR lifetime mismatch
| ^^^ ...but data with one lifetime flows into the other here
error: aborting due to previous error
For more information about this error, try `rustc --explain E0623`.

View File

@ -1,36 +0,0 @@
// Copyright 20142017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// 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.
#![deny(nonstandard_style)]
#![allow(dead_code)]
fn CamelCase() {} //~ ERROR should have a snake
#[allow(nonstandard_style)]
mod test {
fn CamelCase() {}
#[forbid(nonstandard_style)]
mod bad {
fn CamelCase() {} //~ ERROR should have a snake
static bad: isize = 1; //~ ERROR should have an upper
}
mod warn {
#![warn(nonstandard_style)]
fn CamelCase() {} //~ WARN should have a snake
struct snake_case; //~ WARN should have a camel
}
}
fn main() {}

View File

@ -1,67 +0,0 @@
error: function `CamelCase` should have a snake case name such as `camel_case`
--> $DIR/lint-group-style.rs:14:1
|
LL | fn CamelCase() {} //~ ERROR should have a snake
| ^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-group-style.rs:11:9
|
LL | #![deny(nonstandard_style)]
| ^^^^^^^^^^^^^^^^^
= note: #[deny(non_snake_case)] implied by #[deny(nonstandard_style)]
error: function `CamelCase` should have a snake case name such as `camel_case`
--> $DIR/lint-group-style.rs:22:9
|
LL | fn CamelCase() {} //~ ERROR should have a snake
| ^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-group-style.rs:20:14
|
LL | #[forbid(nonstandard_style)]
| ^^^^^^^^^^^^^^^^^
= note: #[forbid(non_snake_case)] implied by #[forbid(nonstandard_style)]
error: static variable `bad` should have an upper case name such as `BAD`
--> $DIR/lint-group-style.rs:24:9
|
LL | static bad: isize = 1; //~ ERROR should have an upper
| ^^^^^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-group-style.rs:20:14
|
LL | #[forbid(nonstandard_style)]
| ^^^^^^^^^^^^^^^^^
= note: #[forbid(non_upper_case_globals)] implied by #[forbid(nonstandard_style)]
warning: function `CamelCase` should have a snake case name such as `camel_case`
--> $DIR/lint-group-style.rs:30:9
|
LL | fn CamelCase() {} //~ WARN should have a snake
| ^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-group-style.rs:28:17
|
LL | #![warn(nonstandard_style)]
| ^^^^^^^^^^^^^^^^^
= note: #[warn(non_snake_case)] implied by #[warn(nonstandard_style)]
warning: type `snake_case` should have a camel case name such as `SnakeCase`
--> $DIR/lint-group-style.rs:32:9
|
LL | struct snake_case; //~ WARN should have a camel
| ^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-group-style.rs:28:17
|
LL | #![warn(nonstandard_style)]
| ^^^^^^^^^^^^^^^^^
= note: #[warn(non_camel_case_types)] implied by #[warn(nonstandard_style)]
error: aborting due to 3 previous errors