libsyntax: note that let a = (let b = something)
is invalid
in parse_bottom_expr (parser.rs)
This commit is contained in:
parent
6866f1361d
commit
082c03b078
@ -2199,6 +2199,12 @@ impl<'a> Parser<'a> {
|
|||||||
UnsafeBlock(ast::UserProvided),
|
UnsafeBlock(ast::UserProvided),
|
||||||
attrs);
|
attrs);
|
||||||
}
|
}
|
||||||
|
if self.eat_keyword(keywords::Let) {
|
||||||
|
return Err(self.span_fatal(self.span,
|
||||||
|
"`let` is not an expression, so it cannot \
|
||||||
|
be used in this way"))
|
||||||
|
|
||||||
|
}
|
||||||
if self.eat_keyword(keywords::Return) {
|
if self.eat_keyword(keywords::Return) {
|
||||||
if self.token.can_begin_expr() {
|
if self.token.can_begin_expr() {
|
||||||
let e = try!(self.parse_expr());
|
let e = try!(self.parse_expr());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user