Skip to content

修正示例#376

Merged
wayslog merged 2 commits intorustcc:masterfrom
lucklove:master
May 13, 2016
Merged

修正示例#376
wayslog merged 2 commits intorustcc:masterfrom
lucklove:master

Conversation

@lucklove
Copy link
Contributor

原文

enum Option<T> {
     Some(T),
     None,
}

let x: Option<i32> = Some(5);
let y: Option<f64> = Some(5.0f64);

中关于Option的定义意在说明标准库中Option的结构,可改成

// enum Option<T> {
//     Some(T),
//     None,
// }

let x: Option<i32> = Some(5);
let y: Option<f64> = Some(5.0f64);

否则此处的Option和标准库的Option会冲突,无法编译

@wayslog
Copy link
Member

wayslog commented May 13, 2016

本段意在说明标准库的用法,本来就不是来给你编译的~~

@wayslog wayslog closed this May 13, 2016
@lucklove
Copy link
Contributor Author

这段不是用来编译的, yes
这段是在说标准库的用法,有些牵强 (这段的标题是泛型和多态)
另外是不是用来编译的好像没有什么明确的界限啊

@wayslog
Copy link
Member

wayslog commented May 13, 2016

嗯哼……提了个例子表明标准库的用法来说明泛型和多态~~
不过嘛……你这里注释了也会让人一头雾水啊~~
尤其在第四章。
这样吧,我reopen这个pr,你把这段说的再详细一点~~直接注释太粗暴了……

@wayslog wayslog reopened this May 13, 2016
@wayslog wayslog added the bug label May 13, 2016
@wayslog wayslog added this to the v1.2.0-release milestone May 13, 2016
@wayslog wayslog merged commit 439948f into rustcc:master May 13, 2016
@wayslog
Copy link
Member

wayslog commented May 13, 2016

fuck nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants