提交 f7681f92 编写于 作者: B Brian Anderson

Accept Copy, Send, Const, Owned, as kind bounds

上级 e7fe903d
......@@ -2262,6 +2262,30 @@ fn parse_optional_ty_param_bounds() -> @~[ty_param_bound] {
push(bounds, bound_const);
} else if self.eat_keyword(~"owned") {
push(bounds, bound_owned);
} else if is_ident(self.token) {
// XXX: temporary until kinds become traits
let maybe_bound = match self.token {
token::IDENT(sid, _) => {
match *self.id_to_str(sid) {
~"Send" => Some(bound_send),
~"Copy" => Some(bound_copy),
~"Const" => Some(bound_const),
~"Owned" => Some(bound_owned),
_ => None
}
}
_ => fail
};
match maybe_bound {
Some(bound) => {
self.bump();
push(bounds, bound);
}
None => {
push(bounds, bound_trait(self.parse_ty(false)));
}
}
} else {
push(bounds, bound_trait(self.parse_ty(false)));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册