about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/messages.ftl
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-07-18 12:24:56 +0200
committerLeón Orell Valerian Liehr <me@fmease.dev>2025-07-18 12:24:56 +0200
commitcdc3d701cb4ff37e9d0c96c1c68b2e8789c19441 (patch)
tree508b765b23ec32b6988c64e88f6f373e86313624 /compiler/rustc_hir_analysis/messages.ftl
parent879f62bb3c23b7a90ac71bb217056fd49ff8dafb (diff)
downloadrust-cdc3d701cb4ff37e9d0c96c1c68b2e8789c19441.tar.gz
rust-cdc3d701cb4ff37e9d0c96c1c68b2e8789c19441.zip
Don't reject *multiple* relaxed bounds, reject *duplicate* ones.
Having multiple relaxed bounds like `?Sized + ?Iterator` is actually *fine*.
We actually want to reject *duplicate* relaxed bounds like `?Sized + ?Sized`
because these most certainly represent a user error.

Note that this doesn't mean that we accept more code because a bound like
`?Iterator` is still invalid as it's not relaxing a *default* trait and
the only way to define / use more default bounds is under the experimental
and internal feature `more_maybe_bounds` plus `lang_items` plus unstable
flag `-Zexperimental-default-bounds` (historical context: for the longest
time, bounds like `?Iterator` were actually allowed and lead to a hard
warning).

Ultimately, this simply *reframes* the diagnostic. The scope of
`more_maybe_bounds` / `-Zexperimental-default-bounds` remains unchanged
as well.
Diffstat (limited to 'compiler/rustc_hir_analysis/messages.ftl')
-rw-r--r--compiler/rustc_hir_analysis/messages.ftl3
1 files changed, 0 insertions, 3 deletions
diff --git a/compiler/rustc_hir_analysis/messages.ftl b/compiler/rustc_hir_analysis/messages.ftl
index a20becbe7e8..90cb1727034 100644
--- a/compiler/rustc_hir_analysis/messages.ftl
+++ b/compiler/rustc_hir_analysis/messages.ftl
@@ -371,9 +371,6 @@ hir_analysis_missing_type_params =
         *[other] parameters
     } must be specified on the object type
 
-hir_analysis_multiple_relaxed_default_bounds =
-    type parameter has more than one relaxed default bound, only one is supported
-
 hir_analysis_must_be_name_of_associated_function = must be a name of an associated function
 
 hir_analysis_must_implement_not_function = not a function