Commit 4e63ab6
committed
Improve
Rename `with_source_map` as `set_source_map`. Because `with` functions
(e.g. `with_session_globals`, `scoped_tls::ScopedKey::with`) are for
*getting* a value for the duration of a closure, and `set` functions
(e.g. `set_session_globals_then` `scoped_tls::ScopedKey::with`) are for
*setting* a value for the duration of a closure.
Also fix up the comment, which is wrong:
- The bit about `TyCtxt` is wrong.
- `span_debug1` doesn't exist any more.
- There's only one level of fallback, not two.
(This is effectively a follow-up to the changes in rust-lang#93936.)
Also add a comment explaining that `SessionGlobals::source_map` should
only be used when absolutely necessary.with_source_map.1 parent f049d5d commit 4e63ab6
File tree
2 files changed
+14
-11
lines changed- compiler
- rustc_interface/src
- rustc_span/src
2 files changed
+14
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
| |||
1013 | 1021 | | |
1014 | 1022 | | |
1015 | 1023 | | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
1026 | 1027 | | |
1027 | 1028 | | |
1028 | 1029 | | |
| |||
1041 | 1042 | | |
1042 | 1043 | | |
1043 | 1044 | | |
| 1045 | + | |
| 1046 | + | |
1044 | 1047 | | |
1045 | 1048 | | |
1046 | 1049 | | |
| |||
0 commit comments