Skip to content

Commit

Permalink
Change to error for crater
Browse files Browse the repository at this point in the history
  • Loading branch information
jackh726 committed Feb 7, 2022
1 parent c018ead commit cc51c4e
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions compiler/rustc_typeck/src/check/wfcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,6 @@ fn check_gat_where_clauses(
return;
}
let generics: &ty::Generics = tcx.generics_of(trait_item.def_id);
// If the current associated type doesn't have any (own) params, it's not a GAT
// FIXME(jackh726): we can also warn in the more general case
if generics.params.len() == 0 && !tcx.features().generic_associated_types {
return;
}
let associated_items: &ty::AssocItems<'_> = tcx.associated_items(encl_trait_def_id);
let mut clauses: Option<FxHashSet<ty::Predicate<'_>>> = None;
// For every function in this trait...
Expand Down Expand Up @@ -466,17 +461,11 @@ fn check_gat_where_clauses(
if !clauses.is_empty() {
let plural = if clauses.len() > 1 { "s" } else { "" };
let severity = if generics.params.len() == 0 { "recommended" } else { "required" };
let mut err = if generics.params.len() == 0 {
tcx.sess.struct_span_warn(
trait_item.span,
&format!("missing {} bound{} on `{}`", severity, plural, trait_item.ident),
)
} else {
let mut err =
tcx.sess.struct_span_err(
trait_item.span,
&format!("missing {} bound{} on `{}`", severity, plural, trait_item.ident),
)
};
);

let suggestion = format!(
"{} {}",
Expand Down

0 comments on commit cc51c4e

Please sign in to comment.