rust-analyzer/crates
bors[bot] a888441c47
Merge #2392
2392: Fix panic during the expansion of `column!` r=edwin0cheng a=marcogroppo

Fixes #2379. Well, this isn't the "proper" fix but it doesn't hurt, IMHO.

The problem is that `to_col_number`, called by `column_expand`, receives a position number that isn't included in the text range of the file. My (very limited) understanding is that the text is the one of the original file, while `pos` is relative to something else, probably the text of the macro. Notice that in this case the `column!` expansion seems to be triggered by `assert_eq!`, so we're in the middle of another expansion. This PR simply avoids the panic by checking the length of the text.

r? @edwin0cheng 


Co-authored-by: Marco Groppo <marco.groppo@gmail.com>
2019-11-25 02:42:17 +00:00
..
ra_arena Switch to variant-granularity field type inference 2019-11-25 00:12:36 +03:00
ra_assists Merge #2343 2019-11-24 08:32:07 +00:00
ra_batch Fix panic in batch analysis 2019-11-24 12:06:00 +03:00
ra_cfg Disable doctests 2019-11-17 18:35:05 +03:00
ra_cli Simplify 2019-11-24 20:53:42 +03:00
ra_db Pull macro up 2019-11-24 14:13:51 +03:00
ra_fmt fix 2190; add test for "replace if let with match" 2019-11-20 19:01:06 +01:00
ra_hir Switch to variant-granularity field type inference 2019-11-25 00:12:36 +03:00
ra_hir_def Merge #2396 2019-11-24 21:45:26 +00:00
ra_hir_expand Fix panic during the expansion of column! 2019-11-24 23:49:58 +01:00
ra_ide_api Switch to variant-granularity field type inference 2019-11-25 00:12:36 +03:00
ra_lsp_server Ban println in lsp_server 2019-11-22 10:46:56 +03:00
ra_mbe Fixed mbe trival subtree 2019-11-22 01:02:07 +08:00
ra_parser Disable doctests 2019-11-17 18:35:05 +03:00
ra_prof Disable doctests 2019-11-17 18:35:05 +03:00
ra_project_model Merge #2381 2019-11-24 15:59:47 +00:00
ra_syntax Merge #2343 2019-11-24 08:32:07 +00:00
ra_text_edit Disable doctests 2019-11-17 18:35:05 +03:00
ra_tt Disable doctests 2019-11-17 18:35:05 +03:00
ra_vfs_glob Disable doctests 2019-11-17 18:35:05 +03:00
test_utils Disable doctests 2019-11-17 18:35:05 +03:00