Implement the notion of a "generated unsafe block"
This way syntax extensions can generate unsafe blocks without worrying about them generating unnecessary unsafe warnings. Perhaps a special keyword could be added to be used in macros, but I don't think that's the best solution.
This commit is contained in:
parent
ba9fa89bfb
commit
19a6fabad8
6 changed files with 11 additions and 7 deletions
|
@ -1792,7 +1792,7 @@ impl Parser {
|
|||
} else if self.eat_keyword(keywords::Match) {
|
||||
return self.parse_match_expr();
|
||||
} else if self.eat_keyword(keywords::Unsafe) {
|
||||
return self.parse_block_expr(lo, UnsafeBlock);
|
||||
return self.parse_block_expr(lo, UnsafeBlock(false));
|
||||
} else if *self.token == token::LBRACKET {
|
||||
self.bump();
|
||||
let mutbl = self.parse_mutability();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue