Skip to content

Commit cc51c4e

Browse files
committed
Change to error for crater
1 parent c018ead commit cc51c4e

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

compiler/rustc_typeck/src/check/wfcheck.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,6 @@ fn check_gat_where_clauses(
285285
return;
286286
}
287287
let generics: &ty::Generics = tcx.generics_of(trait_item.def_id);
288-
// If the current associated type doesn't have any (own) params, it's not a GAT
289-
// FIXME(jackh726): we can also warn in the more general case
290-
if generics.params.len() == 0 && !tcx.features().generic_associated_types {
291-
return;
292-
}
293288
let associated_items: &ty::AssocItems<'_> = tcx.associated_items(encl_trait_def_id);
294289
let mut clauses: Option<FxHashSet<ty::Predicate<'_>>> = None;
295290
// For every function in this trait...
@@ -466,17 +461,11 @@ fn check_gat_where_clauses(
466461
if !clauses.is_empty() {
467462
let plural = if clauses.len() > 1 { "s" } else { "" };
468463
let severity = if generics.params.len() == 0 { "recommended" } else { "required" };
469-
let mut err = if generics.params.len() == 0 {
470-
tcx.sess.struct_span_warn(
471-
trait_item.span,
472-
&format!("missing {} bound{} on `{}`", severity, plural, trait_item.ident),
473-
)
474-
} else {
464+
let mut err =
475465
tcx.sess.struct_span_err(
476466
trait_item.span,
477467
&format!("missing {} bound{} on `{}`", severity, plural, trait_item.ident),
478-
)
479-
};
468+
);
480469

481470
let suggestion = format!(
482471
"{} {}",

0 commit comments

Comments
 (0)