Visitar URL original
Merge #296 · taiki-e/pin-project@cad2d7b · GitHub
Skip to content

Commit cad2d7b

Browse files
bors[bot]taiki-e
andauthored
Merge #296
296: v0.4: Update minimal version of syn to 1.0.44 r=taiki-e a=taiki-e This is the backport of #295 Co-authored-by: Taiki Endo <te316e89@gmail.com>
2 parents db59688 + 38c4579 commit cad2d7b

12 files changed

Lines changed: 35 additions & 221 deletions

‎examples/enum-default-expanded.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
// fn main() {}
1515
// ```
1616

17-
#![allow(dead_code, unused_imports, unused_parens)]
18-
#![allow(clippy::just_underscores_and_digits)]
17+
#![allow(dead_code, unused_imports, unused_parens, unknown_lints, renamed_and_removed_lints)]
18+
#![allow(clippy::needless_lifetimes, clippy::just_underscores_and_digits)]
1919

2020
use pin_project::pin_project;
2121

@@ -100,7 +100,7 @@ const _: () = {
100100
//
101101
// See ./struct-default-expanded.rs for details.
102102
trait EnumMustNotImplDrop {}
103-
#[allow(clippy::drop_bounds)]
103+
#[allow(clippy::drop_bounds, drop_bounds)]
104104
impl<T: ::pin_project::__private::Drop> EnumMustNotImplDrop for T {}
105105
impl<T, U> EnumMustNotImplDrop for Enum<T, U> {}
106106
impl<T, U> ::pin_project::__private::PinnedDrop for Enum<T, U> {

‎examples/not_unpin-expanded.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
// }
1919
// ```
2020

21-
#![allow(dead_code, unused_imports, unused_parens)]
22-
#![allow(clippy::no_effect)]
21+
#![allow(dead_code, unused_imports, unused_parens, unknown_lints, renamed_and_removed_lints)]
22+
#![allow(clippy::no_effect, clippy::needless_lifetimes)]
2323

2424
use pin_project::pin_project;
2525

@@ -104,7 +104,7 @@ const _: () = {
104104
//
105105
// See ./struct-default-expanded.rs for details.
106106
trait StructMustNotImplDrop {}
107-
#[allow(clippy::drop_bounds)]
107+
#[allow(clippy::drop_bounds, drop_bounds)]
108108
impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
109109
impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
110110
impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {

‎examples/pinned_drop-expanded.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
// fn main() {}
2222
// ```
2323

24-
#![allow(dead_code, unused_imports, unused_parens)]
25-
#![allow(clippy::no_effect)]
24+
#![allow(dead_code, unused_imports, unused_parens, unknown_lints, renamed_and_removed_lints)]
25+
#![allow(clippy::no_effect, clippy::needless_lifetimes)]
2626

2727
use pin_project::{pin_project, pinned_drop};
2828
use std::pin::Pin;

‎examples/project_replace-expanded.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// fn main() {}
1616
// ```
1717

18-
#![allow(dead_code, unused_imports, unused_parens)]
19-
#![allow(clippy::no_effect)]
18+
#![allow(dead_code, unused_imports, unused_parens, unknown_lints, renamed_and_removed_lints)]
19+
#![allow(clippy::no_effect, clippy::needless_lifetimes)]
2020

2121
use pin_project::pin_project;
2222

@@ -143,7 +143,7 @@ const _: () = {
143143
//
144144
// See ./struct-default-expanded.rs for details.
145145
trait StructMustNotImplDrop {}
146-
#[allow(clippy::drop_bounds)]
146+
#[allow(clippy::drop_bounds, drop_bounds)]
147147
impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
148148
impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
149149
impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {

‎examples/struct-default-expanded.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// fn main() {}
1616
// ```
1717

18-
#![allow(dead_code, unused_imports, unused_parens)]
19-
#![allow(clippy::no_effect)]
18+
#![allow(dead_code, unused_imports, unused_parens, unknown_lints, renamed_and_removed_lints)]
19+
#![allow(clippy::no_effect, clippy::needless_lifetimes)]
2020

2121
use pin_project::pin_project;
2222

@@ -131,7 +131,7 @@ const _: () = {
131131
// then apply to your type, causing a compile-time error due to
132132
// the conflict with the second impl.
133133
trait StructMustNotImplDrop {}
134-
#[allow(clippy::drop_bounds)]
134+
#[allow(clippy::drop_bounds, drop_bounds)]
135135
impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
136136
impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
137137
// A dummy impl of `PinnedDrop`, to ensure that users don't accidentally

‎examples/unsafe_unpin-expanded.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
// fn main() {}
1818
// ```
1919

20-
#![allow(dead_code, unused_imports, unused_parens)]
21-
#![allow(clippy::no_effect)]
20+
#![allow(dead_code, unused_imports, unused_parens, unknown_lints, renamed_and_removed_lints)]
21+
#![allow(clippy::no_effect, clippy::needless_lifetimes)]
2222

2323
use pin_project::{pin_project, UnsafeUnpin};
2424

@@ -91,7 +91,7 @@ const _: () = {
9191
//
9292
// See ./struct-default-expanded.rs for details.
9393
trait StructMustNotImplDrop {}
94-
#[allow(clippy::drop_bounds)]
94+
#[allow(clippy::drop_bounds, drop_bounds)]
9595
impl<T: ::pin_project::__private::Drop> StructMustNotImplDrop for T {}
9696
impl<T, U> StructMustNotImplDrop for Struct<T, U> {}
9797
impl<T, U> ::pin_project::__private::PinnedDrop for Struct<T, U> {

‎pin-project-internal/Cargo.toml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ targets = ["x86_64-unknown-linux-gnu"]
2020
proc-macro = true
2121

2222
[dependencies]
23-
proc-macro2 = "1.0"
24-
quote = "1.0"
25-
syn = { version = "1.0.13", features = ["full", "visit-mut"] }
23+
proc-macro2 = "1"
24+
quote = "1"
25+
syn = { version = "1.0.44", features = ["full", "visit-mut"] }
2626

2727
[dev-dependencies]
2828
pin-project = { version = "0.4.26", path = ".." }
29-
rustversion = "1.0"
29+
rustversion = "1"

‎pin-project-internal/src/lib.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ use crate::utils::ProjKind;
109109
/// ```rust
110110
/// struct MyStruct {}
111111
/// trait MyStructMustNotImplDrop {}
112+
/// # #[allow(unknown_lints, drop_bounds)]
112113
/// impl<T: Drop> MyStructMustNotImplDrop for T {}
113114
/// impl MyStructMustNotImplDrop for MyStruct {}
114115
/// ```

‎tests/lint.rs‎

Lines changed: 9 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,39 @@
1-
#![warn(rust_2018_idioms, single_use_lifetimes)]
2-
#![warn(nonstandard_style, rust_2018_compatibility, unused)]
3-
// Note: This does not guarantee compatibility with `forbid(future_incompatible)` in the future.
1+
#![warn(nonstandard_style, rust_2018_idioms, rustdoc, unused)]
2+
// Note: This does not guarantee compatibility with forbidding these lints in the future.
43
// If rustc adds a new lint, we may not be able to keep this.
5-
#![forbid(future_incompatible)]
6-
#![warn(clippy::all, clippy::pedantic, clippy::nursery)]
4+
#![forbid(future_incompatible, rust_2018_compatibility)]
75
#![allow(unknown_lints)] // for old compilers
86
#![warn(
9-
absolute_paths_not_starting_with_crate,
10-
anonymous_parameters,
117
box_pointers,
128
deprecated_in_future,
139
elided_lifetimes_in_paths,
1410
explicit_outlives_requirements,
15-
indirect_structural_match,
16-
keyword_idents,
1711
macro_use_extern_crate,
1812
meta_variable_misuse,
1913
missing_copy_implementations,
2014
missing_crate_level_docs,
2115
missing_debug_implementations,
2216
missing_docs,
23-
missing_doc_code_examples,
2417
non_ascii_idents,
25-
private_doc_tests,
2618
single_use_lifetimes,
2719
trivial_casts,
2820
trivial_numeric_casts,
2921
unaligned_references,
3022
unreachable_pub,
31-
unstable_features,
3223
unused_extern_crates,
3324
unused_import_braces,
3425
unused_lifetimes,
3526
unused_qualifications,
3627
unused_results,
3728
variant_size_differences
3829
)]
39-
// unused_crate_dependencies: unrelated
40-
// unsafe_code: checked in forbid_unsafe module
30+
// absolute_paths_not_starting_with_crate, anonymous_parameters, keyword_idents, pointer_structural_match: forbidden as a part of future_incompatible
31+
// missing_doc_code_examples, private_doc_tests, invalid_html_tags: warned as a part of rustdoc
4132
// unsafe_block_in_unsafe_fn: unstable
33+
// unsafe_code: checked in forbid_unsafe module
34+
// unstable_features: deprecated: https://doc.rust-lang.org/beta/rustc/lints/listing/allowed-by-default.html#unstable-features
35+
// unused_crate_dependencies: unrelated
36+
#![warn(clippy::all, clippy::pedantic, clippy::nursery)]
4237

4338
// Check interoperability with rustc and clippy lints.
4439

@@ -132,41 +127,3 @@ pub mod clippy {
132127
},
133128
}
134129
}
135-
136-
#[allow(box_pointers)]
137-
#[rustversion::attr(not(nightly), ignore)]
138-
#[test]
139-
fn check_lint_list() {
140-
use std::{env, fs, path::PathBuf, process::Command, str};
141-
142-
type Result<T, E = Box<dyn std::error::Error>> = std::result::Result<T, E>;
143-
144-
fn assert_eq(expected_path: &str, actual: &str) -> Result<()> {
145-
let manifest_dir = env::var_os("CARGO_MANIFEST_DIR")
146-
.map(PathBuf::from)
147-
.expect("CARGO_MANIFEST_DIR not set");
148-
let expected_path = manifest_dir.join(expected_path);
149-
let expected = fs::read_to_string(&expected_path)?;
150-
if expected != actual {
151-
if env::var_os("CI").map_or(false, |v| v == "true") {
152-
panic!(
153-
"assertion failed:\n\nEXPECTED:\n{0}\n{1}\n{0}\n\nACTUAL:\n{0}\n{2}\n{0}\n",
154-
"-".repeat(60),
155-
expected,
156-
actual,
157-
);
158-
} else {
159-
fs::write(&expected_path, actual)?;
160-
}
161-
}
162-
Ok(())
163-
}
164-
165-
(|| -> Result<()> {
166-
let rustc = env::var_os("RUSTC").unwrap_or_else(|| "rustc".into());
167-
let output = Command::new(rustc).args(&["-W", "help"]).output()?;
168-
let new = str::from_utf8(&output.stdout)?;
169-
assert_eq("tests/lint.txt", new)
170-
})()
171-
.unwrap_or_else(|e| panic!("{}", e));
172-
}

0 commit comments

Comments
 (0)