Upgrade to Rust 1.86 and bump MSRV to 1.84 (#17171)

<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

I decided to disable the new
[`needless_continue`](https://rust-lang.github.io/rust-clippy/master/index.html#needless_continue)
rule because I often found the explicit `continue` more readable over an
empty block or having to invert the condition of an other branch.


## Test Plan

`cargo test`

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Micha Reiser 2025-04-03 17:59:44 +02:00 committed by GitHub
parent fedd982fd5
commit 8a4158c5f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
135 changed files with 285 additions and 255 deletions

View file

@ -2,6 +2,7 @@
#![allow(clippy::print_stdout, clippy::print_stderr)]
use std::collections::HashSet;
use std::fmt::Write as _;
use std::fs;
use std::path::PathBuf;
@ -29,8 +30,7 @@ pub(crate) fn main(args: &Args) -> Result<()> {
if let Some(explanation) = rule.explanation() {
let mut output = String::new();
output.push_str(&format!("# {} ({})", rule.as_ref(), rule.noqa_code()));
output.push('\n');
let _ = writeln!(&mut output, "# {} ({})", rule.as_ref(), rule.noqa_code());
let (linter, _) = Linter::parse_code(&rule.noqa_code().to_string()).unwrap();
if linter.url().is_some() {
@ -49,11 +49,12 @@ pub(crate) fn main(args: &Args) -> Result<()> {
common_prefix.to_lowercase()
);
output.push_str(&format!(
let _ = write!(
output,
"Derived from the **[{}](../rules.md#{})** linter.",
linter.name(),
anchor
));
anchor,
);
output.push('\n');
output.push('\n');
}
@ -155,8 +156,8 @@ fn process_documentation(documentation: &str, out: &mut String, rule_name: &str)
}
let anchor = option.replace('.', "_");
out.push_str(&format!("- [`{option}`][{option}]\n"));
after.push_str(&format!("[{option}]: ../settings.md#{anchor}\n"));
let _ = writeln!(out, "- [`{option}`][{option}]");
let _ = writeln!(&mut after, "[{option}]: ../settings.md#{anchor}");
referenced_options.insert(option);
continue;
@ -171,7 +172,7 @@ fn process_documentation(documentation: &str, out: &mut String, rule_name: &str)
if let Some(OptionEntry::Field(field)) = Options::metadata().find(option) {
if referenced_options.insert(option) {
let anchor = option.replace('.', "_");
after.push_str(&format!("[{option}]: ../settings.md#{anchor}\n"));
let _ = writeln!(&mut after, "[{option}]: ../settings.md#{anchor}");
}
if field.deprecated.is_some() {
eprintln!("Rule {rule_name} references deprecated option {option}.");