mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
clippy_dev: Use the new ranges.
This commit is contained in:
@@ -132,14 +132,14 @@ fn remove_impl_lint_pass(lint_name_upper: &str, content: &mut String) {
|
||||
);
|
||||
|
||||
assert!(
|
||||
content[lint.declaration_range.clone()].contains(&name.to_uppercase()),
|
||||
content[lint.declaration_range].contains(&name.to_uppercase()),
|
||||
"error: `{}` does not contain lint `{}`'s declaration",
|
||||
path.display(),
|
||||
lint.name
|
||||
);
|
||||
|
||||
// Remove lint declaration (declare_clippy_lint!)
|
||||
content.replace_range(lint.declaration_range.clone(), "");
|
||||
content.replace_range(lint.declaration_range, "");
|
||||
|
||||
// Remove the module declaration (mod xyz;)
|
||||
let mod_decl = format!("\nmod {name};");
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#![feature(
|
||||
rustc_private,
|
||||
exit_status_error,
|
||||
if_let_guard,
|
||||
new_range,
|
||||
new_range_api,
|
||||
os_str_slice,
|
||||
os_string_truncate,
|
||||
rustc_private,
|
||||
slice_split_once
|
||||
)]
|
||||
#![warn(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use self::cursor::Cursor;
|
||||
use crate::utils::{ErrAction, File, expect_action};
|
||||
use core::ops::Range;
|
||||
use core::range::Range;
|
||||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
use walkdir::{DirEntry, WalkDir};
|
||||
|
||||
@@ -23,7 +23,7 @@ pub fn bump_version(mut version: Version) {
|
||||
dst.push_str(&src[..package.version_range.start]);
|
||||
write!(dst, "\"{}\"", version.toml_display()).unwrap();
|
||||
dst.push_str(&src[package.version_range.end..]);
|
||||
UpdateStatus::from_changed(src.get(package.version_range.clone()) != dst.get(package.version_range))
|
||||
UpdateStatus::from_changed(src.get(package.version_range) != dst.get(package.version_range))
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use core::fmt::{self, Display};
|
||||
use core::num::NonZero;
|
||||
use core::ops::Range;
|
||||
use core::range::Range;
|
||||
use core::str::FromStr;
|
||||
use std::ffi::OsStr;
|
||||
use std::fs::{self, OpenOptions};
|
||||
|
||||
Reference in New Issue
Block a user