Skip to content

Commit 7ab1321

Browse files
committed
trait_sel: stash {Meta,Pointee}Sized errors
`Sized` errors are currently stashed to improve diagnostics and this must happen with `{Meta,Pointee}Sized` too to maintain diagnostic output.
1 parent c162328 commit 7ab1321

File tree

1 file changed

+4
-1
lines changed
  • compiler/rustc_trait_selection/src/error_reporting/traits

1 file changed

+4
-1
lines changed

compiler/rustc_trait_selection/src/error_reporting/traits/ambiguity.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
199199
// avoid inundating the user with unnecessary errors, but we now
200200
// check upstream for type errors and don't add the obligations to
201201
// begin with in those cases.
202-
if self.tcx.is_lang_item(trait_pred.def_id(), LangItem::Sized) {
202+
if matches!(
203+
self.tcx.as_lang_item(trait_pred.def_id()),
204+
Some(LangItem::Sized | LangItem::MetaSized)
205+
) {
203206
match self.tainted_by_errors() {
204207
None => {
205208
let err = self.emit_inference_failure_err(

0 commit comments

Comments
 (0)