about summary refs log tree commit diff
path: root/tests/ui/error-codes
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-05-23 11:27:07 +0000
committerMichael Goulet <michael@errs.io>2025-05-23 12:20:35 +0000
commitd0413436d5217de732d37cb3a2e9e816eee7ee25 (patch)
tree08a9f0a2ee7d9f2910155719bc93ded661dd9eae /tests/ui/error-codes
parent52bf0cf795dfecc8b929ebb1c1e2545c3f41d4c9 (diff)
downloadrust-d0413436d5217de732d37cb3a2e9e816eee7ee25.tar.gz
rust-d0413436d5217de732d37cb3a2e9e816eee7ee25.zip
Do not try to confirm non-dyn compatible method
Diffstat (limited to 'tests/ui/error-codes')
-rw-r--r--tests/ui/error-codes/E0038.rs2
-rw-r--r--tests/ui/error-codes/E0038.stderr31
2 files changed, 2 insertions, 31 deletions
diff --git a/tests/ui/error-codes/E0038.rs b/tests/ui/error-codes/E0038.rs
index a467767c3fa..9757e2ab10c 100644
--- a/tests/ui/error-codes/E0038.rs
+++ b/tests/ui/error-codes/E0038.rs
@@ -5,8 +5,6 @@ trait Trait {
 fn call_foo(x: Box<dyn Trait>) {
     //~^ ERROR E0038
     let y = x.foo();
-    //~^ ERROR E0038
-    //~| ERROR E0277
 }
 
 fn main() {
diff --git a/tests/ui/error-codes/E0038.stderr b/tests/ui/error-codes/E0038.stderr
index 63a5249a386..e09aefaa0dd 100644
--- a/tests/ui/error-codes/E0038.stderr
+++ b/tests/ui/error-codes/E0038.stderr
@@ -14,33 +14,6 @@ LL |     fn foo(&self) -> Self;
    |                      ^^^^ ...because method `foo` references the `Self` type in its return type
    = help: consider moving `foo` to another trait
 
-error[E0038]: the trait `Trait` is not dyn compatible
-  --> $DIR/E0038.rs:7:13
-   |
-LL |     let y = x.foo();
-   |             ^^^^^^^ `Trait` is not dyn compatible
-   |
-note: for a trait to be dyn compatible it needs to allow building a vtable
-      for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
-  --> $DIR/E0038.rs:2:22
-   |
-LL | trait Trait {
-   |       ----- this trait is not dyn compatible...
-LL |     fn foo(&self) -> Self;
-   |                      ^^^^ ...because method `foo` references the `Self` type in its return type
-   = help: consider moving `foo` to another trait
-
-error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time
-  --> $DIR/E0038.rs:7:9
-   |
-LL |     let y = x.foo();
-   |         ^ doesn't have a size known at compile-time
-   |
-   = help: the trait `Sized` is not implemented for `dyn Trait`
-   = note: all local variables must have a statically known size
-   = help: unsized locals are gated as an unstable feature
-
-error: aborting due to 3 previous errors
+error: aborting due to 1 previous error
 
-Some errors have detailed explanations: E0038, E0277.
-For more information about an error, try `rustc --explain E0038`.
+For more information about this error, try `rustc --explain E0038`.