diff options
| author | bors <bors@rust-lang.org> | 2022-07-20 19:37:17 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-07-20 19:37:17 +0000 |
| commit | d68e7ebc38cb42b8b237392b28045edeec761503 (patch) | |
| tree | e8109432f17346411b536b520111848a173e8cf1 /compiler/rustc_span/src | |
| parent | a7468c60f8dbf5feb23ad840b174d7e57113a846 (diff) | |
| parent | a5a681100cb14af73926f309821903175b4fc2a2 (diff) | |
| download | rust-d68e7ebc38cb42b8b237392b28045edeec761503.tar.gz rust-d68e7ebc38cb42b8b237392b28045edeec761503.zip | |
Auto merge of #99520 - matthiaskrgr:rollup-05uuv5s, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #99212 (introduce `implied_by` in `#[unstable]` attribute) - #99352 (Use `typeck_results` to avoid duplicate `ast_ty_to_ty` call) - #99355 (better error for bad depth parameter on macro metavar expr) - #99480 (Diagnostic width span is not added when '0$' is used as width in format strings) - #99488 (compiletest: Allow using revisions with debuginfo tests.) - #99489 (rustdoc UI fixes) - #99508 (Avoid `Symbol` to `String` conversions) - #99510 (adapt assembly/static-relocation-model test for LLVM change) - #99516 (Use new tracking issue for proc_macro::tracked_*.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_span/src')
| -rw-r--r-- | compiler/rustc_span/src/source_map.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_span/src/symbol.rs | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/source_map.rs b/compiler/rustc_span/src/source_map.rs index afbb88e9233..b4a4424e876 100644 --- a/compiler/rustc_span/src/source_map.rs +++ b/compiler/rustc_span/src/source_map.rs @@ -718,6 +718,11 @@ impl SourceMap { sp } + /// Extends the given `Span` to contain the entire line it is on. + pub fn span_extend_to_line(&self, sp: Span) -> Span { + self.span_extend_to_prev_char(self.span_extend_to_next_char(sp, '\n', true), '\n', true) + } + /// Given a `Span`, tries to get a shorter span ending before the first occurrence of `char` /// `c`. pub fn span_until_char(&self, sp: Span, c: char) -> Span { diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index ec1d2c39b80..2ac1ecfe87e 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -800,6 +800,7 @@ symbols! { impl_lint_pass, impl_macros, impl_trait_in_bindings, + implied_by, import, import_shadowing, imported_main, |
