Merge pull request #1491 from Manishearth/into_iter_on_ref

fix explicit_into_iter_loop on references
This commit is contained in:
Oliver Schneider
2017-02-21 14:55:52 +01:00
committed by GitHub
4 changed files with 153 additions and 123 deletions

View File

@@ -569,6 +569,17 @@ pub fn span_lint_and_then<'a, 'tcx: 'a, T: LintContext<'tcx>, F>(
}
}
pub fn span_lint_and_sugg<'a, 'tcx: 'a, T: LintContext<'tcx>>(
cx: &'a T,
lint: &'static Lint,
sp: Span,
msg: &str,
help: &str,
sugg: String
) {
span_lint_and_then(cx, lint, sp, msg, |db| { db.span_suggestion(sp, help, sugg); });
}
/// Create a suggestion made from several `span → replacement`.
///
/// Note: in the JSON format (used by `compiletest_rs`), the help message will appear once per