]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #91443 - compiler-errors:bad_collect_into_slice, r=wesleywiser
authorMatthias Krüger <matthias.krueger@famsik.de>
Wed, 9 Feb 2022 22:29:55 +0000 (23:29 +0100)
committerGitHub <noreply@github.com>
Wed, 9 Feb 2022 22:29:55 +0000 (23:29 +0100)
Better suggestions when user tries to collect into an unsized `[_]`

1. Extend the predicate on `rustc_on_unimplemented` to support substitutions like note, label, etc (i.e. treat it as a `OnUnimplementedFormatString`) so we can have slightly more general `rustc_on_unimplemented` special-cases.
2. Add a `rustc_on_unimplemented` if we fail on `FromIterator<A> for [A]` which happens when we don't explicitly collect into a `vec<A>`, but then pass the return from a `.collect` call into something that takes a slice.

Fixes #91423


Trivial merge