rust/compiler
Yuki Okushi 4ff55ecf04
Rollup merge of #86104 - FabianWolff:issue-86085, r=davidtwco
Fix span calculation in format strings

This pull request fixes #86085. The ICE described there is due to an error in the span calculation inside format strings, if the format string is the result of a macro invocation:
```rust
fn main() {
    format!(concat!("abc}"));
}
```
currently produces:
```
error: invalid format string: unmatched `}` found
 --> test.rs:2:17
  |
2 |     format!(concat!("abc}"));
  |                 ^ unmatched `}` in format string
```
which is obviously incorrect. This happens because the span of the entire `concat!()` is combined with the _relative_ location of the unmatched `` `}` `` in the _result_ of the macro invocation (i.e. 4).

In #86085, this has led to a span that starts or ends in the middle of a multibyte character, but the root cause was the same. This pull request fixes the problem.
2021-06-17 05:54:52 +09:00
..
rustc
rustc_apfloat Use the now available implementation of IntoIterator for arrays 2021-06-14 23:40:09 +02:00
rustc_arena
rustc_ast Add support for using qualified paths with structs in expression and pattern 2021-06-10 13:18:41 +02:00
rustc_ast_lowering Auto merge of #86321 - JohnTitor:rollup-q61c8q4, r=JohnTitor 2021-06-15 20:15:23 +00:00
rustc_ast_passes simplify validate_generic_param_order 2021-06-13 01:39:57 +03:00
rustc_ast_pretty Add support for using qualified paths with structs in expression and pattern 2021-06-10 13:18:41 +02:00
rustc_attr
rustc_builtin_macros Fix span calculation in format strings 2021-06-07 17:42:42 +02:00
rustc_codegen_cranelift Auto merge of #86291 - crlf0710:trait_vtbl_refactor, r=bjorn3 2021-06-16 07:20:27 +00:00
rustc_codegen_llvm Auto merge of #86020 - nagisa:nagisa/outliner, r=pnkfelix 2021-06-10 15:11:01 +00:00
rustc_codegen_ssa Refactor to make interpreter and codegen backend neutral to vtable internal representation. 2021-06-15 01:59:00 +08:00
rustc_data_structures Auto merge of #85885 - bjorn3:remove_box_region, r=cjgillot 2021-06-11 16:11:20 +00:00
rustc_driver
rustc_error_codes Fix typo with custom a custom -> with a custom 2021-06-13 21:21:45 +02:00
rustc_errors Auto merge of #85903 - bjorn3:rustc_serialize_cleanup, r=varkor 2021-06-07 14:40:26 +00:00
rustc_expand Use the now available implementation of IntoIterator for arrays 2021-06-14 23:40:09 +02:00
rustc_feature Add support for using qualified paths with structs in expression and pattern 2021-06-10 13:18:41 +02:00
rustc_fs_util
rustc_graphviz
rustc_hir Hash DefId in rustc_span. 2021-06-11 12:25:02 +02:00
rustc_hir_pretty
rustc_incremental Do not require the DefPathTable to construct the on-disk cache. 2021-06-08 22:23:03 +02:00
rustc_index
rustc_infer Use the now available implementation of IntoIterator for arrays 2021-06-14 23:40:09 +02:00
rustc_interface Auto merge of #85885 - bjorn3:remove_box_region, r=cjgillot 2021-06-11 16:11:20 +00:00
rustc_lexer
rustc_lint Add support for using qualified paths with structs in expression and pattern 2021-06-10 13:18:41 +02:00
rustc_lint_defs
rustc_llvm
rustc_macros
rustc_metadata Auto merge of #85885 - bjorn3:remove_box_region, r=cjgillot 2021-06-11 16:11:20 +00:00
rustc_middle Auto merge of #86291 - crlf0710:trait_vtbl_refactor, r=bjorn3 2021-06-16 07:20:27 +00:00
rustc_mir Rollup merge of #85870 - ptrojahn:mir_dump_whitespace, r=davidtwco 2021-06-17 05:54:46 +09:00
rustc_mir_build
rustc_parse Add support for using qualified paths with structs in expression and pattern 2021-06-10 13:18:41 +02:00
rustc_parse_format
rustc_passes Fix ICE when doc aliases were put on function params 2021-06-15 19:01:11 +02:00
rustc_plugin_impl
rustc_privacy Add more tests + visit_ty in some places 2021-06-09 19:28:41 +01:00
rustc_query_impl Auto merge of #85154 - cjgillot:lessfn, r=bjorn3 2021-06-15 14:52:58 +00:00
rustc_query_system Auto merge of #85154 - cjgillot:lessfn, r=bjorn3 2021-06-15 14:52:58 +00:00
rustc_resolve Rollup merge of #85608 - scottmcm:stabilize-control-flow-enum-basics, r=m-ou-se 2021-06-15 17:40:08 +09:00
rustc_save_analysis Revert "Merge CrateDisambiguator into StableCrateId" 2021-06-07 10:37:45 +02:00
rustc_serialize Use the now available implementation of IntoIterator for arrays 2021-06-14 23:40:09 +02:00
rustc_session Auto merge of #86311 - LeSeulArtichaut:cleanup-array-iter, r=jackh726 2021-06-15 07:46:48 +00:00
rustc_span Rollup merge of #85608 - scottmcm:stabilize-control-flow-enum-basics, r=m-ou-se 2021-06-15 17:40:08 +09:00
rustc_symbol_mangling Revert "Merge CrateDisambiguator into StableCrateId" 2021-06-07 10:37:45 +02:00
rustc_target Use the now available implementation of IntoIterator for arrays 2021-06-14 23:40:09 +02:00
rustc_trait_selection Refactor to make interpreter and codegen backend neutral to vtable internal representation. 2021-06-15 01:59:00 +08:00
rustc_traits
rustc_ty_utils Revert "Merge CrateDisambiguator into StableCrateId" 2021-06-07 10:37:45 +02:00
rustc_type_ir
rustc_typeck Use the now available implementation of IntoIterator for arrays 2021-06-14 23:40:09 +02:00