Auto merge of #142997 - workingjubilee:rollup-6lxec87, r=workingjubilee
Rollup of 15 pull requests Successful merges: - rust-lang/rust#135731 (Implement parsing of pinned borrows) - rust-lang/rust#138780 (Add `#[loop_match]` for improved DFA codegen) - rust-lang/rust#142453 (Windows: make `read_dir` stop iterating after the first error is encountered) - rust-lang/rust#142633 (Error on invalid signatures for interrupt ABIs) - rust-lang/rust#142768 (Avoid a bitcast FFI call in transmuting) - rust-lang/rust#142825 (Port `#[track_caller]` to the new attribute system) - rust-lang/rust#142844 (Enable short-ice for Windows) - rust-lang/rust#142934 (Tweak `-Zmacro-stats` measurement.) - rust-lang/rust#142955 (Couple of test suite fixes for cg_clif) - rust-lang/rust#142977 (rustdoc: Don't mark `#[target_feature]` functions as ⚠) - rust-lang/rust#142980 (Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect) - rust-lang/rust#142982 (Corrected spelling mistake in c_str.rs) - rust-lang/rust#142983 (Taint body on invalid call ABI) - rust-lang/rust#142988 (Update wasm-component-ld to 0.5.14) - rust-lang/rust#142993 (Update cargo) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
@@ -847,7 +847,7 @@ impl<'a> Parser<'a> {
|
||||
self.dcx().emit_err(errors::LifetimeInBorrowExpression { span, lifetime_span: lt_span });
|
||||
}
|
||||
|
||||
/// Parse `mut?` or `raw [ const | mut ]`.
|
||||
/// Parse `mut?` or `[ raw | pin ] [ const | mut ]`.
|
||||
fn parse_borrow_modifiers(&mut self) -> (ast::BorrowKind, ast::Mutability) {
|
||||
if self.check_keyword(exp!(Raw)) && self.look_ahead(1, Token::is_mutability) {
|
||||
// `raw [ const | mut ]`.
|
||||
@@ -855,6 +855,11 @@ impl<'a> Parser<'a> {
|
||||
assert!(found_raw);
|
||||
let mutability = self.parse_const_or_mut().unwrap();
|
||||
(ast::BorrowKind::Raw, mutability)
|
||||
} else if let Some((ast::Pinnedness::Pinned, mutbl)) = self.parse_pin_and_mut() {
|
||||
// `pin [ const | mut ]`.
|
||||
// `pin` has been gated in `self.parse_pin_and_mut()` so we don't
|
||||
// need to gate it here.
|
||||
(ast::BorrowKind::Pin, mutbl)
|
||||
} else {
|
||||
// `mut?`
|
||||
(ast::BorrowKind::Ref, self.parse_mutability())
|
||||
|
||||
@@ -301,6 +301,7 @@ fn emit_malformed_attribute(
|
||||
| sym::naked
|
||||
| sym::no_mangle
|
||||
| sym::must_use
|
||||
| sym::track_caller
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user