Skip to content

Commit 0c7dcba

Browse files
committed
Remove derive_new test dependency
It is the last thing depending on syn 1.0 in clippy
1 parent 8c48b93 commit 0c7dcba

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ itertools = "0.10.1"
3838

3939
# UI test dependencies
4040
clippy_utils = { path = "clippy_utils" }
41-
derive-new = "0.5"
4241
if_chain = "1.0"
4342
quote = "1.0"
4443
serde = { version = "1.0.125", features = ["derive"] }

tests/compile-test.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use test_utils::IS_RUSTC_TEST_SUITE;
1818
// in the depinfo file (otherwise cargo thinks they are unused)
1919
extern crate clippy_lints;
2020
extern crate clippy_utils;
21-
extern crate derive_new;
2221
extern crate futures;
2322
extern crate if_chain;
2423
extern crate itertools;
@@ -33,7 +32,6 @@ mod test_utils;
3332
static TEST_DEPENDENCIES: &[&str] = &[
3433
"clippy_lints",
3534
"clippy_utils",
36-
"derive_new",
3735
"futures",
3836
"if_chain",
3937
"itertools",

tests/ui/redundant_field_names.fixed

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
//@aux-build:proc_macros.rs
12
#![warn(clippy::redundant_field_names)]
23
#![allow(clippy::extra_unused_type_parameters, clippy::no_effect, dead_code, unused_variables)]
34

45
#[macro_use]
5-
extern crate derive_new;
6+
extern crate proc_macros;
67

78
use std::ops::{Range, RangeFrom, RangeInclusive, RangeTo, RangeToInclusive};
89

@@ -18,7 +19,6 @@ struct Person {
1819
foo: u8,
1920
}
2021

21-
#[derive(new)]
2222
pub struct S {
2323
v: String,
2424
}
@@ -57,6 +57,13 @@ fn main() {
5757
let _ = Range { start, end };
5858
let _ = RangeInclusive::new(start, end);
5959
let _ = RangeToInclusive { end };
60+
61+
external! {
62+
let v = String::new();
63+
let _ = S {
64+
v: v
65+
};
66+
}
6067
}
6168

6269
fn issue_3476() {

tests/ui/redundant_field_names.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
//@aux-build:proc_macros.rs
12
#![warn(clippy::redundant_field_names)]
23
#![allow(clippy::extra_unused_type_parameters, clippy::no_effect, dead_code, unused_variables)]
34

45
#[macro_use]
5-
extern crate derive_new;
6+
extern crate proc_macros;
67

78
use std::ops::{Range, RangeFrom, RangeInclusive, RangeTo, RangeToInclusive};
89

@@ -18,7 +19,6 @@ struct Person {
1819
foo: u8,
1920
}
2021

21-
#[derive(new)]
2222
pub struct S {
2323
v: String,
2424
}
@@ -57,6 +57,13 @@ fn main() {
5757
let _ = Range { start: start, end: end };
5858
let _ = RangeInclusive::new(start, end);
5959
let _ = RangeToInclusive { end: end };
60+
61+
external! {
62+
let v = String::new();
63+
let _ = S {
64+
v: v
65+
};
66+
}
6067
}
6168

6269
fn issue_3476() {

tests/ui/redundant_field_names.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ LL | let _ = RangeToInclusive { end: end };
4444
| ^^^^^^^^ help: replace it with: `end`
4545

4646
error: redundant field names in struct initialization
47-
--> $DIR/redundant_field_names.rs:81:25
47+
--> $DIR/redundant_field_names.rs:88:25
4848
|
4949
LL | let _ = RangeFrom { start: start };
5050
| ^^^^^^^^^^^^ help: replace it with: `start`

0 commit comments

Comments
 (0)