We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
trait A { fn foo(&self, _x: &Self); } impl A for () { fn foo(&self, _x: &Self) {} } fn main() { let _x: &A; }
This code passes, while the codes like let x = &() as &A; cause compile error because the trait A is not object-safe. 0255-object-safety
let x = &() as &A;
A
Is there any reason for type &A to exist? If not, the declaration of variables of type &A should be invalid.
&A
The text was updated successfully, but these errors were encountered:
This is now rejected (presumably fixed in the meantime), so closing, yay!
Sorry, something went wrong.
No branches or pull requests
This code passes, while the codes like
let x = &() as &A;
cause compile error because the traitA
is not object-safe. 0255-object-safetyIs there any reason for type
&A
to exist? If not, the declaration of variables of type&A
should be invalid.The text was updated successfully, but these errors were encountered: