Skip to content

Commit

Permalink
Auto merge of rust-lang#11497 - Alexendoo:remove-derive-new, r=dswij
Browse files Browse the repository at this point in the history
Remove `derive_new` test dependency

It is the last thing depending on syn 1.0 in clippy

changelog: none
  • Loading branch information
bors committed Sep 14, 2023
2 parents 2009b58 + 0c7dcba commit 0273ed3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ itertools = "0.10.1"

# UI test dependencies
clippy_utils = { path = "clippy_utils" }
derive-new = "0.5"
if_chain = "1.0"
quote = "1.0"
serde = { version = "1.0.125", features = ["derive"] }
Expand Down
2 changes: 0 additions & 2 deletions tests/compile-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use test_utils::IS_RUSTC_TEST_SUITE;
// in the depinfo file (otherwise cargo thinks they are unused)
extern crate clippy_lints;
extern crate clippy_utils;
extern crate derive_new;
extern crate futures;
extern crate if_chain;
extern crate itertools;
Expand All @@ -33,7 +32,6 @@ mod test_utils;
static TEST_DEPENDENCIES: &[&str] = &[
"clippy_lints",
"clippy_utils",
"derive_new",
"futures",
"if_chain",
"itertools",
Expand Down
11 changes: 9 additions & 2 deletions tests/ui/redundant_field_names.fixed
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//@aux-build:proc_macros.rs
#![warn(clippy::redundant_field_names)]
#![allow(clippy::extra_unused_type_parameters, clippy::no_effect, dead_code, unused_variables)]

#[macro_use]
extern crate derive_new;
extern crate proc_macros;

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

Expand All @@ -18,7 +19,6 @@ struct Person {
foo: u8,
}

#[derive(new)]
pub struct S {
v: String,
}
Expand Down Expand Up @@ -57,6 +57,13 @@ fn main() {
let _ = Range { start, end };
let _ = RangeInclusive::new(start, end);
let _ = RangeToInclusive { end };

external! {
let v = String::new();
let _ = S {
v: v
};
}
}

fn issue_3476() {
Expand Down
11 changes: 9 additions & 2 deletions tests/ui/redundant_field_names.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//@aux-build:proc_macros.rs
#![warn(clippy::redundant_field_names)]
#![allow(clippy::extra_unused_type_parameters, clippy::no_effect, dead_code, unused_variables)]

#[macro_use]
extern crate derive_new;
extern crate proc_macros;

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

Expand All @@ -18,7 +19,6 @@ struct Person {
foo: u8,
}

#[derive(new)]
pub struct S {
v: String,
}
Expand Down Expand Up @@ -57,6 +57,13 @@ fn main() {
let _ = Range { start: start, end: end };
let _ = RangeInclusive::new(start, end);
let _ = RangeToInclusive { end: end };

external! {
let v = String::new();
let _ = S {
v: v
};
}
}

fn issue_3476() {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/redundant_field_names.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ LL | let _ = RangeToInclusive { end: end };
| ^^^^^^^^ help: replace it with: `end`

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

0 comments on commit 0273ed3

Please sign in to comment.