Skip to content

Commit 719a9b6

Browse files
committed
Register arg_iter as a supplementary lint
1 parent d55843f commit 719a9b6

5 files changed

Lines changed: 7 additions & 3 deletions

File tree

dylint-link/src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,11 @@ where
102102

103103
#[cfg(not(target_os = "windows"))]
104104
#[allow(clippy::unnecessary_wraps)]
105-
fn output_path<'a, I>(mut iter: I) -> Result<Option<PathBuf>>
105+
fn output_path<'a, I>(iter: I) -> Result<Option<PathBuf>>
106106
where
107-
I: Iterator<Item = &'a String>,
107+
I: IntoIterator<Item = &'a String>,
108108
{
109+
let mut iter = iter.into_iter();
109110
while let Some(arg) = iter.next() {
110111
if arg == "-o" {
111112
if let Some(path) = iter.next() {

examples/general/non_local_effect_before_error_return/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ fn collect_locals_and_constants<'tcx>(
302302
cx: &LateContext<'tcx>,
303303
mir: &'tcx Body<'tcx>,
304304
path: &[BasicBlock],
305-
args: impl Iterator<Item = &'tcx Operand<'tcx>>,
305+
args: impl IntoIterator<Item = &'tcx Operand<'tcx>>,
306306
) -> (DenseBitSet<Local>, Vec<&'tcx ConstOperand<'tcx>>) {
307307
let mut locals_narrowly = DenseBitSet::new_empty(mir.local_decls.len());
308308
let mut locals_widely = DenseBitSet::new_empty(mir.local_decls.len());

examples/supplementary/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/supplementary/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ publish = false
1010
crate-type = ["cdylib"]
1111

1212
[dependencies]
13+
arg_iter = { path = "arg_iter", features = ["rlib"] }
1314
commented_out_code = { path = "commented_out_code", features = ["rlib"] }
1415
escaping_doc_link = { path = "escaping_doc_link", features = ["rlib"] }
1516
inconsistent_struct_pattern = { path = "inconsistent_struct_pattern", features = [

examples/supplementary/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ extern crate rustc_session;
1010
#[unsafe(no_mangle)]
1111
pub fn register_lints(sess: &rustc_session::Session, lint_store: &mut rustc_lint::LintStore) {
1212
// smoelius: Please keep the following `register_lints` calls sorted by crate name.
13+
arg_iter::register_lints(sess, lint_store);
1314
commented_out_code::register_lints(sess, lint_store);
1415
escaping_doc_link::register_lints(sess, lint_store);
1516
inconsistent_struct_pattern::register_lints(sess, lint_store);

0 commit comments

Comments
 (0)