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? 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
将:
// 对象安全的trait,将不安全的方法拆分出去
改为:
// 对象安全的trait,将对象不安全的方法拆分出去
The text was updated successfully, but these errors were encountered:
代码清单 3-40
6 - 9 行 / 13 - 17 行
trait Foo { fn bad<T>(&self, x: T); }
依旧是不安全的 trait
根据 Object Safety
All associated functions must either have a where Self: Sized bound, or Not have any type parameters (although lifetime parameters are allowed), and Be a method that does not use Self except in the type of the receiver.
All associated functions must either have a where Self: Sized bound, or
where Self: Sized
每个关联函数 必须具有 where Self: Sized 限定,或者 不具有任何类型参数 且不在方法接收者之外的地方使用 Self 类型
Self
Sorry, something went wrong.
@eZioPan 感谢反馈
No branches or pull requests
页码与行数
将:
// 对象安全的trait,将不安全的方法拆分出去
改为:
// 对象安全的trait,将对象不安全的方法拆分出去
The text was updated successfully, but these errors were encountered: