rust/compiler/rustc_ast_lowering/src
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
..
asm.rs Add support for specifying multiple clobber_abi in asm! 2021-11-10 01:06:03 -05:00
block.rs Do not preallocate item HirIds. 2021-09-18 13:14:29 +02:00
expr.rs On type mismatch caused by assignment, point at assignee 2021-11-25 18:04:33 +00:00
index.rs Use SortedMap in HIR. 2021-10-21 23:08:57 +02:00
item.rs Do not visit attributes in ItemLowerer. 2021-11-23 22:06:22 +01:00
lib.rs Merge Implicit and ImplicitMissing. 2021-11-30 22:56:47 +01:00
pat.rs ast_lowering: Introduce lower_span for catching all spans entering HIR 2021-08-29 10:49:40 +03:00
path.rs Rollup merge of #91273 - Badel2:ice-index-str, r=estebank 2021-12-03 06:24:14 +01:00