mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 08:53:35 +00:00
Rustup to rustc 1.25.0-nightly (7d6e5b9da
2018-01-27)
This commit is contained in:
parent
0a4634397c
commit
e40bc64f4f
@ -1167,7 +1167,8 @@ fn lint_unnecessary_fold(cx: &LateContext, expr: &hir::Expr, fold_args: &[hir::E
|
||||
|
||||
then {
|
||||
// Span containing `.fold(...)`
|
||||
let fold_span = fold_args[0].span.next_point().with_hi(fold_args[2].span.hi() + BytePos(1));
|
||||
let next_point = cx.sess().codemap().next_point(fold_args[0].span);
|
||||
let fold_span = next_point.with_hi(fold_args[2].span.hi() + BytePos(1));
|
||||
|
||||
let sugg = if replacement_has_args {
|
||||
format!(
|
||||
|
@ -502,9 +502,8 @@ impl<'a, 'b, 'c, T: LintContext<'c>> DiagnosticBuilderExt<'c, T> for rustc_error
|
||||
|
||||
fn suggest_remove_item(&mut self, cx: &T, item: Span, msg: &str) {
|
||||
let mut remove_span = item;
|
||||
let fmpos = cx.sess()
|
||||
.codemap()
|
||||
.lookup_byte_offset(remove_span.next_point().hi());
|
||||
let hi = cx.sess().codemap().next_point(remove_span).hi();
|
||||
let fmpos = cx.sess().codemap().lookup_byte_offset(hi);
|
||||
|
||||
if let Some(ref src) = fmpos.fm.src {
|
||||
let non_whitespace_offset = src[fmpos.pos.to_usize()..].find(|c| c != ' ' && c != '\t' && c != '\n');
|
||||
|
Loading…
Reference in New Issue
Block a user