Skip to content

Commit e17d254

Browse files
committed
Auto merge of rust-lang#13180 - Jarcho:deprecated_shrink, r=flip1995
Simplify lint deprecation A couple of small changes: * A few deprecations were changed to renames. They all had a message similar to "this lint has been replaced by ..." which is just describing a rename. * The website and warning message are now the same. The website description was usually just a wordier version that contained no extra information. This can be worked around if needed, but I don't think that will happen. * The legacy deprecations have been removed. rustc should handle this since it already suggests adding the `clippy::` for all lints (deprecated or not) when they're used without it. It wouldn't be a problem to add them back in. * The website no longer has a "view source" link for deprecated lints since they're no longer read from the HIR tree. I could store the line number, but the link seems totally useless for these lints. This came up as part of separating the internal lints into their own crate. Both the metadata collector and the lint registration code needs access to the deprecated and renamed lists. This form lets all the deprecations be a separate crate. r? `@flip1995` changelog: none
2 parents e611c8e + c2186e1 commit e17d254

22 files changed

+588
-1102
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5830,6 +5830,7 @@ Released 2018-09-13
58305830
[`result_unit_err`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err
58315831
[`result_unwrap_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#result_unwrap_used
58325832
[`return_self_not_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#return_self_not_must_use
5833+
[`reverse_range_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#reverse_range_loop
58335834
[`reversed_empty_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#reversed_empty_ranges
58345835
[`same_functions_in_if_condition`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_functions_in_if_condition
58355836
[`same_item_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push

clippy_dev/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn main() {
7474
new_name,
7575
uplift,
7676
} => update_lints::rename(&old_name, new_name.as_ref().unwrap_or(&old_name), uplift),
77-
DevCommand::Deprecate { name, reason } => update_lints::deprecate(&name, reason.as_deref()),
77+
DevCommand::Deprecate { name, reason } => update_lints::deprecate(&name, &reason),
7878
}
7979
}
8080

@@ -223,7 +223,7 @@ enum DevCommand {
223223
name: String,
224224
#[arg(long, short)]
225225
/// The reason for deprecation
226-
reason: Option<String>,
226+
reason: String,
227227
},
228228
}
229229

clippy_dev/src/serve.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ use std::process::Command;
33
use std::time::{Duration, SystemTime};
44
use std::{env, thread};
55

6+
#[cfg(windows)]
7+
const PYTHON: &str = "python";
8+
9+
#[cfg(not(windows))]
10+
const PYTHON: &str = "python3";
11+
612
/// # Panics
713
///
814
/// Panics if the python commands could not be spawned
@@ -23,7 +29,7 @@ pub fn run(port: u16, lint: Option<String>) -> ! {
2329
}
2430
if let Some(url) = url.take() {
2531
thread::spawn(move || {
26-
Command::new("python3")
32+
Command::new(PYTHON)
2733
.arg("-m")
2834
.arg("http.server")
2935
.arg(port.to_string())

0 commit comments

Comments
 (0)