1
Fork 0
rust/compiler/rustc_ast_lowering
Matthias Krüger a5ee722f1e
Rollup merge of #91273 - Badel2:ice-index-str, r=estebank
Fix ICE #91268 by checking that the snippet ends with a `)`

Fix #91268

Previously it was assumed that the last character of `snippet` will be a `)`, so using `snippet.len() - 1` as an index should be safe. However as we see in the test, it is possible to enter that branch without a closing `)`, and it will trigger the panic if the last character happens to be multibyte.

The fix is to ensure that the snippet ends with `)`, and skip the suggestion otherwise.
2021-12-03 06:24:14 +01:00
..
src Rollup merge of #91273 - Badel2:ice-index-str, r=estebank 2021-12-03 06:24:14 +01:00
Cargo.toml Forbid hashing HIR outside of indexing. 2021-10-09 18:38:28 +02:00