diff options
| author | Taylor Cramer <cramertj@google.com> | 2024-11-20 14:19:36 -0800 |
|---|---|---|
| committer | Taylor Cramer <cramertj@google.com> | 2025-01-22 09:20:57 -0800 |
| commit | d00d4dfe0daba29036aab1f2b35a8c6ccb023f3e (patch) | |
| tree | d2aa54a8a05297e887429b0d984f626c1b94d4ac /tests/ui/const-generics/generic_const_exprs/dyn-compatibility-err-ret.rs | |
| parent | b2728d5426bab1d8c39709768c7e22b7f66dde5d (diff) | |
| download | rust-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 'tests/ui/const-generics/generic_const_exprs/dyn-compatibility-err-ret.rs')
| -rw-r--r-- | tests/ui/const-generics/generic_const_exprs/dyn-compatibility-err-ret.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ui/const-generics/generic_const_exprs/dyn-compatibility-err-ret.rs b/tests/ui/const-generics/generic_const_exprs/dyn-compatibility-err-ret.rs index 1620e257667..9ab715d01f7 100644 --- a/tests/ui/const-generics/generic_const_exprs/dyn-compatibility-err-ret.rs +++ b/tests/ui/const-generics/generic_const_exprs/dyn-compatibility-err-ret.rs @@ -14,8 +14,8 @@ impl Foo for () { } } -fn use_dyn(v: &dyn Foo) { //~ERROR the trait `Foo` cannot be made into an object - v.test(); //~ERROR the trait `Foo` cannot be made into an object +fn use_dyn(v: &dyn Foo) { //~ERROR the trait `Foo` is not dyn compatible + v.test(); //~ERROR the trait `Foo` is not dyn compatible } fn main() {} |
