about summary refs log tree commit diff
path: root/src/librustc_errors
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-11 01:44:55 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-08-15 20:38:12 +0300
commit67d6ce42063732d7c7b12d94f872dcafb5efb607 (patch)
tree4e9a94b42b8eeb2bd71603ea5fdabef42bc8b134 /src/librustc_errors
parentdfcbe75900f2cb813754ef104526ebce568fd75b (diff)
downloadrust-67d6ce42063732d7c7b12d94f872dcafb5efb607.tar.gz
rust-67d6ce42063732d7c7b12d94f872dcafb5efb607.zip
syntax_pos: `NO_EXPANSION`/`SyntaxContext::empty()` -> `SyntaxContext::root()`
For consistency with `ExpnId::root`.

Also introduce a helper `Span::with_root_ctxt` for creating spans with `SyntaxContext::root()` context
Diffstat (limited to 'src/librustc_errors')
-rw-r--r--src/librustc_errors/lib.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index f3e524152ff..4018a667bf2 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -43,8 +43,7 @@ use syntax_pos::{BytePos,
                  SourceFile,
                  FileName,
                  MultiSpan,
-                 Span,
-                 NO_EXPANSION};
+                 Span};
 
 /// Indicates the confidence in the correctness of a suggestion.
 ///
@@ -189,7 +188,7 @@ impl CodeSuggestion {
             // Find the bounding span.
             let lo = substitution.parts.iter().map(|part| part.span.lo()).min().unwrap();
             let hi = substitution.parts.iter().map(|part| part.span.hi()).min().unwrap();
-            let bounding_span = Span::new(lo, hi, NO_EXPANSION);
+            let bounding_span = Span::with_root_ctxt(lo, hi);
             let lines = cm.span_to_lines(bounding_span).unwrap();
             assert!(!lines.lines.is_empty());