]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #91416 - compiler-errors:infinite-ty-option-box, r=estebank
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Thu, 31 Mar 2022 15:29:52 +0000 (17:29 +0200)
committerGitHub <noreply@github.com>
Thu, 31 Mar 2022 15:29:52 +0000 (17:29 +0200)
Specialize infinite-type "insert some indirection" suggestion for Option

Suggest `Option<Box<_>>` instead of `Box<Option<_>>` for infinitely-recursive members of a struct.

Not sure if I can get the span of the generic subty of the Option so I can make this a `+++`-style suggestion. The current output is a tiny bit less fancy looking than the original suggestion.

Should I limit the specialization to just `Option<Box<TheOuterStruct>>`? Because right now it applies to all `Option` members in the struct that are returned by `Representability::SelfRecursive`.

Fixes #91402

r? `@estebank`
(since you wrote the original suggestion and are definitely most familiar with it!)


Trivial merge