mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-16 01:38:13 +00:00
a888441c47
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> |
||
---|---|---|
.. | ||
ra_arena | ||
ra_assists | ||
ra_batch | ||
ra_cfg | ||
ra_cli | ||
ra_db | ||
ra_fmt | ||
ra_hir | ||
ra_hir_def | ||
ra_hir_expand | ||
ra_ide_api | ||
ra_lsp_server | ||
ra_mbe | ||
ra_parser | ||
ra_prof | ||
ra_project_model | ||
ra_syntax | ||
ra_text_edit | ||
ra_tt | ||
ra_vfs_glob | ||
test_utils |