Skip to content

Commit

Permalink
update some compile-fail tests
Browse files Browse the repository at this point in the history
Some errors, about trait objects not implementing their own trait when
they aren’t object-safe, aren’t being reported. Here is the error
missing from compile-fail/trait-test-2.rs:

```
error[E0277]: the trait bound `dyn bar: bar` is not satisfied
  --> src/test/compile-fail/trait-test-2.rs:20:26
   |
20 |     (box 10 as Box<bar>).dup();
   |                          ^^^ the trait `bar` is not implemented
for `dyn bar`
```

My best guess is it has to do with how object-safety checks now include
trait-solving. It doesn’t look like a very useful error, so I’m not too
worried.
  • Loading branch information
mikeyhew committed Sep 4, 2018
1 parent b31b0f9 commit 3e8c5bc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/test/ui/traits/trait-item-privacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ fn check_assoc_const() {
// A, B, C are resolved as inherent items, their traits don't need to be in scope
C::A; //~ ERROR associated constant `A` is private
//~^ ERROR the trait `assoc_const::C` cannot be made into an object
//~| ERROR the trait bound `dyn assoc_const::C: assoc_const::A` is not satisfied
C::B; // ERROR the trait `assoc_const::C` cannot be made into an object
//~^ ERROR the trait bound `dyn assoc_const::C: assoc_const::B` is not satisfied
C::C; // OK
}

Expand Down
1 change: 0 additions & 1 deletion src/test/ui/traits/trait-test-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ fn main() {
(box 10 as Box<bar>).dup();
//~^ ERROR E0038
//~| ERROR E0038
//~| ERROR E0277
}

0 comments on commit 3e8c5bc

Please sign in to comment.