From cc51c4edd58b93906dc6791616cb6ed36b89d476 Mon Sep 17 00:00:00 2001 From: Jack Huey <31162821+jackh726@users.noreply.github.com> Date: Mon, 7 Feb 2022 14:20:57 -0500 Subject: [PATCH] Change to error for crater --- compiler/rustc_typeck/src/check/wfcheck.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/compiler/rustc_typeck/src/check/wfcheck.rs b/compiler/rustc_typeck/src/check/wfcheck.rs index 36a7b319269f..e6e4ffc92726 100644 --- a/compiler/rustc_typeck/src/check/wfcheck.rs +++ b/compiler/rustc_typeck/src/check/wfcheck.rs @@ -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>> = None; // For every function in this trait... @@ -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!( "{} {}",