about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/expr.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-19 06:23:49 +0000
committerbors <bors@rust-lang.org>2024-08-19 06:23:49 +0000
commite3f909b2bbd0b10db6f164d466db237c582d3045 (patch)
tree35f38ab5390b874a6baf8282ad9d22f5f2c33cf7 /compiler/rustc_parse/src/parser/expr.rs
parent804be74e3c4ec3646b448dfdb7a0fc31237a5818 (diff)
parent8a513f1720926799f4507c0bb8fb8d1b164ed459 (diff)
downloadrust-e3f909b2bbd0b10db6f164d466db237c582d3045.tar.gz
rust-e3f909b2bbd0b10db6f164d466db237c582d3045.zip
Auto merge of #129261 - tgross35:rollup-xjbvqx7, r=tgross35
Rollup of 7 pull requests

Successful merges:

 - #127679 (Stabilize `raw_ref_op` (RFC 2582))
 - #128084 (Suggest adding Result return type for associated method in E0277.)
 - #128628 (When deduplicating unreachable blocks, erase the source information.)
 - #128902 (doc: std::env::var: Returns None for names with '=' or NUL byte)
 - #129048 (Update `crosstool-ng` for loongarch64)
 - #129116 (Include a copy of `compiler-rt` source in the `download-ci-llvm` tarball)
 - #129208 (Fix order of normalization and recursion in const folding.)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index e0917ba43e4..422206ebbce 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -851,7 +851,7 @@ impl<'a> Parser<'a> {
         self.expect_and()?;
         let has_lifetime = self.token.is_lifetime() && self.look_ahead(1, |t| t != &token::Colon);
         let lifetime = has_lifetime.then(|| self.expect_lifetime()); // For recovery, see below.
-        let (borrow_kind, mutbl) = self.parse_borrow_modifiers(lo);
+        let (borrow_kind, mutbl) = self.parse_borrow_modifiers();
         let attrs = self.parse_outer_attributes()?;
         let expr = if self.token.is_range_separator() {
             self.parse_expr_prefix_range(attrs)
@@ -871,13 +871,12 @@ impl<'a> Parser<'a> {
     }
 
     /// Parse `mut?` or `raw [ const | mut ]`.
-    fn parse_borrow_modifiers(&mut self, lo: Span) -> (ast::BorrowKind, ast::Mutability) {
+    fn parse_borrow_modifiers(&mut self) -> (ast::BorrowKind, ast::Mutability) {
         if self.check_keyword(kw::Raw) && self.look_ahead(1, Token::is_mutability) {
             // `raw [ const | mut ]`.
             let found_raw = self.eat_keyword(kw::Raw);
             assert!(found_raw);
             let mutability = self.parse_const_or_mut().unwrap();
-            self.psess.gated_spans.gate(sym::raw_ref_op, lo.to(self.prev_token.span));
             (ast::BorrowKind::Raw, mutability)
         } else {
             // `mut?`