Closed
Description
This code is incorrect, since it tries to cast something to an unboxed trait object:
trait MyTrait {}
struct Foo;
impl MyTrait for Foo {}
fn main() {
let foo: Foo = Foo;
let t = foo as MyTrait;
}
But it causes an ICE, when it should simply cause an error.
May be related to #17322
Error:
test.rs:9:10: 9:13 error: internal compiler error: expected object type
test.rs:9 let t = foo as MyTrait;
^~