]> git.lizzy.rs Git - rust.git/commitdiff
Merge #4057
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>
Mon, 20 Apr 2020 14:38:16 +0000 (14:38 +0000)
committerGitHub <noreply@github.com>
Mon, 20 Apr 2020 14:38:16 +0000 (14:38 +0000)
4057: Fix panic in split_imports assist r=matklad a=matklad

The fix is admittedly quit literally just papering over.

Long-term, I see two more principled approaches:

* we switch to a fully tree-based impl, without parse . to_string
  step; with this approach, there shouldn't be any panics. The results
  might be nonsensical, but so was the original input.

* we preserve the invariant that re-parsing constructed node is an
  identity, and make all the `make_xxx` method return an `Option`.

closes #4044

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>

Trivial merge