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;
^~
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
jakerr commentedon Sep 18, 2014
I had a similar crash with slightly different repro, though I think it's the same bug so will add it here:
yuryshulaev commentedon Sep 25, 2014
Same here:
bkoropoff commentedon Oct 6, 2014
Dupe of #17441 (or rather, that bug was a dupe of this). This can be closed.
alexcrichton commentedon Oct 6, 2014
Thanks @bkoropoff!