about summary refs log tree commit diff
path: root/src/tools/clippy/clippy_utils
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-08-22 20:52:54 +0200
committerGitHub <noreply@github.com>2021-08-22 20:52:54 +0200
commit167ae26a889649fd6d6499eaeef3e7acd5c9c5df (patch)
treed76070466f359eb86baf0ac4f482f2b70bcb9874 /src/tools/clippy/clippy_utils
parent2638d27ba56d9d1fac481de95522b00383d44b91 (diff)
parent1df0b73196d0830413cc37659fe9da3a52002bd6 (diff)
downloadrust-167ae26a889649fd6d6499eaeef3e7acd5c9c5df.tar.gz
rust-167ae26a889649fd6d6499eaeef3e7acd5c9c5df.zip
Rollup merge of #88211 - petrochenkov:withhilo, r=jyn514
cleanup: `Span::new` -> `Span::with_lo`

Extracted from https://github.com/rust-lang/rust/pull/84373 as suggested in https://github.com/rust-lang/rust/pull/84373#issuecomment-857773867.
It turned out less useful then I expected, but anyway.
r? `@cjgillot`
`@bors` rollup
Diffstat (limited to 'src/tools/clippy/clippy_utils')
-rw-r--r--src/tools/clippy/clippy_utils/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/clippy/clippy_utils/src/lib.rs b/src/tools/clippy/clippy_utils/src/lib.rs
index 7d7c3b8846c..2777e5bd0c4 100644
--- a/src/tools/clippy/clippy_utils/src/lib.rs
+++ b/src/tools/clippy/clippy_utils/src/lib.rs
@@ -881,7 +881,7 @@ fn line_span<T: LintContext>(cx: &T, span: Span) -> Span {
     let source_map_and_line = cx.sess().source_map().lookup_line(span.lo()).unwrap();
     let line_no = source_map_and_line.line;
     let line_start = source_map_and_line.sf.lines[line_no];
-    Span::new(line_start, span.hi(), span.ctxt())
+    span.with_lo(line_start)
 }
 
 /// Gets the parent node, if any.