about summary refs log tree commit diff
path: root/src/libsyntax/source_map
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-08-16 06:53:13 +0000
committerbors <bors@rust-lang.org>2019-08-16 06:53:13 +0000
commit5a6d801bf9399004a0f0a19e510d996f4686c093 (patch)
tree3950734898164dfdf746e2fc3d0951dbb1e0b6cc /src/libsyntax/source_map
parentf7af19c279b8b7ea3d2c21fcbd67164af8d5d968 (diff)
parent0bd3a852557c1e52c4c38207891e5230bfa62cdb (diff)
downloadrust-5a6d801bf9399004a0f0a19e510d996f4686c093.tar.gz
rust-5a6d801bf9399004a0f0a19e510d996f4686c093.zip
Auto merge of #63627 - Centril:rollup-v8i7x5i, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #62593 (Group all ABI tests.)
 - #63173 (Use libunwind from llvm-project submodule for musl targets)
 - #63535 (Continue refactoring resolve and hygiene)
 - #63539 (Suggest Rust 2018 on `<expr>.await` with no such field)
 - #63584 (libcore: more cleanups using `#![feature(associated_type_bounds)]`)
 - #63612 (Do not suggest `try_into` for base types inside of macro expansions)
 - #63615 (Fix typo in DoubleEndedIterator::nth_back doc)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libsyntax/source_map')
-rw-r--r--src/libsyntax/source_map/tests.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libsyntax/source_map/tests.rs b/src/libsyntax/source_map/tests.rs
index 427e86b56e1..c7b8332c53e 100644
--- a/src/libsyntax/source_map/tests.rs
+++ b/src/libsyntax/source_map/tests.rs
@@ -91,7 +91,7 @@ fn t6() {
 fn t7() {
     // Test span_to_lines for a span ending at the end of source_file
     let sm = init_source_map();
-    let span = Span::new(BytePos(12), BytePos(23), NO_EXPANSION);
+    let span = Span::with_root_ctxt(BytePos(12), BytePos(23));
     let file_lines = sm.span_to_lines(span).unwrap();
 
     assert_eq!(file_lines.file.name, PathBuf::from("blork.rs").into());
@@ -107,7 +107,7 @@ fn span_from_selection(input: &str, selection: &str) -> Span {
     assert_eq!(input.len(), selection.len());
     let left_index = selection.find('~').unwrap() as u32;
     let right_index = selection.rfind('~').map(|x|x as u32).unwrap_or(left_index);
-    Span::new(BytePos(left_index), BytePos(right_index + 1), NO_EXPANSION)
+    Span::with_root_ctxt(BytePos(left_index), BytePos(right_index + 1))
 }
 
 /// Tests span_to_snippet and span_to_lines for a span converting 3
@@ -137,7 +137,7 @@ fn span_to_snippet_and_lines_spanning_multiple_lines() {
 fn t8() {
     // Test span_to_snippet for a span ending at the end of source_file
     let sm = init_source_map();
-    let span = Span::new(BytePos(12), BytePos(23), NO_EXPANSION);
+    let span = Span::with_root_ctxt(BytePos(12), BytePos(23));
     let snippet = sm.span_to_snippet(span);
 
     assert_eq!(snippet, Ok("second line".to_string()));
@@ -147,7 +147,7 @@ fn t8() {
 fn t9() {
     // Test span_to_str for a span ending at the end of source_file
     let sm = init_source_map();
-    let span = Span::new(BytePos(12), BytePos(23), NO_EXPANSION);
+    let span = Span::with_root_ctxt(BytePos(12), BytePos(23));
     let sstr =  sm.span_to_string(span);
 
     assert_eq!(sstr, "blork.rs:2:1: 2:12");
@@ -198,10 +198,9 @@ impl SourceMapExtension for SourceMap {
             let lo = hi + offset;
             hi = lo + substring.len();
             if i == n {
-                let span = Span::new(
+                let span = Span::with_root_ctxt(
                     BytePos(lo as u32 + file.start_pos.0),
                     BytePos(hi as u32 + file.start_pos.0),
-                    NO_EXPANSION,
                 );
                 assert_eq!(&self.span_to_snippet(span).unwrap()[..],
                         substring);