|
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. |
4 | 3 | // 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)] |
7 | 5 | #![allow(unknown_lints)] // for old compilers |
8 | 6 | #![warn( |
9 | | - absolute_paths_not_starting_with_crate, |
10 | | - anonymous_parameters, |
11 | 7 | box_pointers, |
12 | 8 | deprecated_in_future, |
13 | 9 | elided_lifetimes_in_paths, |
14 | 10 | explicit_outlives_requirements, |
15 | | - indirect_structural_match, |
16 | | - keyword_idents, |
17 | 11 | macro_use_extern_crate, |
18 | 12 | meta_variable_misuse, |
19 | 13 | missing_copy_implementations, |
20 | 14 | missing_crate_level_docs, |
21 | 15 | missing_debug_implementations, |
22 | 16 | missing_docs, |
23 | | - missing_doc_code_examples, |
24 | 17 | non_ascii_idents, |
25 | | - private_doc_tests, |
26 | 18 | single_use_lifetimes, |
27 | 19 | trivial_casts, |
28 | 20 | trivial_numeric_casts, |
29 | 21 | unaligned_references, |
30 | 22 | unreachable_pub, |
31 | | - unstable_features, |
32 | 23 | unused_extern_crates, |
33 | 24 | unused_import_braces, |
34 | 25 | unused_lifetimes, |
35 | 26 | unused_qualifications, |
36 | 27 | unused_results, |
37 | 28 | variant_size_differences |
38 | 29 | )] |
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 |
41 | 32 | // 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)] |
42 | 37 |
|
43 | 38 | // Check interoperability with rustc and clippy lints. |
44 | 39 |
|
@@ -132,41 +127,3 @@ pub mod clippy { |
132 | 127 | }, |
133 | 128 | } |
134 | 129 | } |
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