about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/coherence/mod.rs
diff options
context:
space:
mode:
authorTaylor Cramer <cramertj@google.com>2024-11-20 14:19:36 -0800
committerTaylor Cramer <cramertj@google.com>2025-01-22 09:20:57 -0800
commitd00d4dfe0daba29036aab1f2b35a8c6ccb023f3e (patch)
treed2aa54a8a05297e887429b0d984f626c1b94d4ac /compiler/rustc_hir_analysis/src/coherence/mod.rs
parentb2728d5426bab1d8c39709768c7e22b7f66dde5d (diff)
downloadrust-d00d4dfe0daba29036aab1f2b35a8c6ccb023f3e.tar.gz
rust-d00d4dfe0daba29036aab1f2b35a8c6ccb023f3e.zip
Refactor dyn-compatibility error and suggestions
This CL makes a number of small changes to dyn compatibility errors:
- "object safety" has been renamed to "dyn-compatibility" throughout
- "Convert to enum" suggestions are no longer generated when there
  exists a type-generic impl of the trait or an impl for `dyn OtherTrait`
- Several error messages are reorganized for user readability

Additionally, the dyn compatibility error creation code has been
split out into functions.

cc #132713
cc #133267
Diffstat (limited to 'compiler/rustc_hir_analysis/src/coherence/mod.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/coherence/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/coherence/mod.rs b/compiler/rustc_hir_analysis/src/coherence/mod.rs
index 951e8f1da4c..4e5f0a3186a 100644
--- a/compiler/rustc_hir_analysis/src/coherence/mod.rs
+++ b/compiler/rustc_hir_analysis/src/coherence/mod.rs
@@ -185,7 +185,7 @@ fn check_object_overlap<'tcx>(
     // check for overlap with the automatic `impl Trait for dyn Trait`
     if let ty::Dynamic(data, ..) = trait_ref.self_ty().kind() {
         // This is something like `impl Trait1 for Trait2`. Illegal if
-        // Trait1 is a supertrait of Trait2 or Trait2 is not dyn-compatible.
+        // Trait1 is a supertrait of Trait2 or Trait2 is not dyn compatible.
 
         let component_def_ids = data.iter().flat_map(|predicate| {
             match predicate.skip_binder() {