Skip to content
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

「第三章」代码清单3-40第6行注释修改 #51

Closed
ZhangHanDong opened this issue Jan 10, 2019 · 2 comments
Closed

「第三章」代码清单3-40第6行注释修改 #51

ZhangHanDong opened this issue Jan 10, 2019 · 2 comments
Labels
已修订 已经修订并提交给出版社 第三章 第三章 表意问题 语言表达有问题,有歧义或难理解

Comments

@ZhangHanDong
Copy link
Owner

页码与行数

  • 第74页

将:

// 对象安全的trait,将不安全的方法拆分出去

改为:

// 对象安全的trait,将对象不安全的方法拆分出去
@ZhangHanDong ZhangHanDong added the 表意问题 语言表达有问题,有歧义或难理解 label Jan 10, 2019
@ZhangHanDong ZhangHanDong added this to the 第三次印刷 milestone Jan 10, 2019
@ZhangHanDong ZhangHanDong changed the title 代码清单3-40第6行注释修改 「第三章」代码清单3-40第6行注释修改 Jan 10, 2019
@ZhangHanDong ZhangHanDong added the 第三章 第三章 label Jan 14, 2019
@ZhangHanDong ZhangHanDong added the 已修订 已经修订并提交给出版社 label Jan 21, 2019
@eZioPan
Copy link

eZioPan commented Mar 25, 2019

代码清单 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.

每个关联函数 必须具有 where Self: Sized 限定,或者 不具有任何类型参数 且不在方法接收者之外的地方使用 Self 类型

@ZhangHanDong
Copy link
Owner Author

@eZioPan 感谢反馈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
已修订 已经修订并提交给出版社 第三章 第三章 表意问题 语言表达有问题,有歧义或难理解
Projects
None yet
Development

No branches or pull requests

2 participants