Print dummy spans as no-location

This commit is contained in:
Tomasz Miąsko 2021-06-09 00:00:00 +00:00
parent ed597e7e19
commit fab319be73
5 changed files with 9 additions and 9 deletions

View File

@ -407,7 +407,7 @@ pub fn lookup_line(&self, pos: BytePos) -> Result<SourceFileAndLine, Lrc<SourceF
} }
fn span_to_string(&self, sp: Span, prefer_local: bool) -> String { fn span_to_string(&self, sp: Span, prefer_local: bool) -> String {
if self.files.borrow().source_files.is_empty() && sp.is_dummy() { if self.files.borrow().source_files.is_empty() || sp.is_dummy() {
return "no-location".to_string(); return "no-location".to_string();
} }

View File

@ -85,13 +85,13 @@ yields ()
bb8 (cleanup): { bb8 (cleanup): {
StorageDead(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16 StorageDead(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16
StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17 StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17
goto -> bb10; // scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1 goto -> bb10; // scope 2 at no-location
} }
bb9 (cleanup): { bb9 (cleanup): {
StorageDead(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16 StorageDead(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16
StorageDead(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17 StorageDead(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17
goto -> bb10; // scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1 goto -> bb10; // scope 2 at no-location
} }
bb10 (cleanup): { bb10 (cleanup): {

View File

@ -43,7 +43,7 @@ fn main() -> () {
_6 = const 1_i32; // scope 0 at $DIR/loop_test.rs:14:17: 14:18 _6 = const 1_i32; // scope 0 at $DIR/loop_test.rs:14:17: 14:18
FakeRead(ForLet(None), _6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14 FakeRead(ForLet(None), _6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14
StorageDead(_6); // scope 0 at $DIR/loop_test.rs:16:5: 16:6 StorageDead(_6); // scope 0 at $DIR/loop_test.rs:16:5: 16:6
goto -> bb3; // scope 0 at $DIR/loop_test.rs:1:1: 1:1 goto -> bb3; // scope 0 at no-location
} }
bb5 (cleanup): { bb5 (cleanup): {

View File

@ -94,8 +94,8 @@
_0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60
StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
- goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 - goto -> bb23; // scope 0 at no-location
+ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 + goto -> bb20; // scope 0 at no-location
} }
- bb10: { - bb10: {
@ -150,8 +150,8 @@
_0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60 _0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60
StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73 StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78 StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
- goto -> bb23; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 - goto -> bb23; // scope 0 at no-location
+ goto -> bb20; // scope 0 at $DIR/match-arm-scopes.rs:1:1: 1:1 + goto -> bb20; // scope 0 at no-location
} }
- bb15: { - bb15: {

View File

@ -40,7 +40,7 @@ fn while_loop(_1: bool) -> () {
bb4: { bb4: {
StorageDead(_4); // scope 0 at $DIR/while-storage.rs:13:9: 13:10 StorageDead(_4); // scope 0 at $DIR/while-storage.rs:13:9: 13:10
goto -> bb6; // scope 0 at $DIR/while-storage.rs:1:1: 1:1 goto -> bb6; // scope 0 at no-location
} }
bb5: { bb5: {