-
Notifications
You must be signed in to change notification settings - Fork 13.3k
'could not find method while translating' while using macros #14399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for the report! I reduced it to the following (with the assistance of creduce): impl Property for Vec3 {
fn get_property(&self, _: &str) -> PropertyType { Float(0.0) }
}
impl Property for Quat {
fn get_property(&self, _: &str) -> PropertyType { Struct(self.v.clone()) }
}
#[deriving(Clone)]
struct Vec3;
struct Quat {
v: Box<Vec3>,
}
enum PropertyType { Float(f64), Struct(Box<Property>), }
trait Property {
fn get_property(&self, &str) -> PropertyType;
}
fn main() { }
|
Ah! But it works with an explicit cast to the trait object: fn get_property(&self, _: &str) -> PropertyType { Struct(self.v.clone() as Box<Property>) } i.e. it seems to be problem with implicit trait object coercions. cc @luqmana (This has the same error message as #6334 but the causes don't look the same.) |
The reason for this seems to be because in |
Update copyright year changelog: none
Platform:
Archlinux x86_64
rustc 0.11.0-pre (4462687 2014-05-23 16:31:20 -0700)
host: x86_64-unknown-linux-gnu
While using macros, I got this error:
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
task 'rustc' failed at 'could not find method while translating', /home/chris/pkg/rust-git/src/rust/src/libstd/option.rs:167
Here is the code, let me know if you prefer a backtrace:
The text was updated successfully, but these errors were encountered: