From 70f388cedba89c204131ebc81a202563a8e19437 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Fri, 12 Feb 2021 12:09:54 +0100 Subject: Pin Rust to 1.49.0 on CI --- .github/workflows/ci.yaml | 10 +++++++++- crates/ide/src/references/rename.rs | 6 +++--- crates/parser/src/grammar/params.rs | 11 ++++++----- crates/rust-analyzer/src/main_loop.rs | 2 +- crates/rust-analyzer/src/to_proto.rs | 3 ++- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1850068a3..ec9ef59a8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,11 +53,19 @@ jobs: - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: - toolchain: stable + toolchain: 1.49.0 # FIXME: CI is failing on 1.50 profile: minimal override: true components: rustfmt, rust-src + - name: Install rustfmt + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: false + components: rustfmt + - name: Cache cargo directories uses: actions/cache@v2 with: diff --git a/crates/ide/src/references/rename.rs b/crates/ide/src/references/rename.rs index 99a558532..ebb1ce7dd 100644 --- a/crates/ide/src/references/rename.rs +++ b/crates/ide/src/references/rename.rs @@ -415,9 +415,9 @@ fn rename_reference( ) -> RenameResult { let ident_kind = check_identifier(new_name)?; - let def_is_lbl_or_lt = matches!(def, - Definition::GenericParam(hir::GenericParam::LifetimeParam(_)) - | Definition::Label(_) + let def_is_lbl_or_lt = matches!( + def, + Definition::GenericParam(hir::GenericParam::LifetimeParam(_)) | Definition::Label(_) ); match (ident_kind, def) { (IdentifierKind::ToSelf, _) diff --git a/crates/parser/src/grammar/params.rs b/crates/parser/src/grammar/params.rs index 6a98d7368..e313f6fb7 100644 --- a/crates/parser/src/grammar/params.rs +++ b/crates/parser/src/grammar/params.rs @@ -169,11 +169,12 @@ fn opt_self_param(p: &mut Parser, m: Marker) { let la1 = p.nth(1); let la2 = p.nth(2); let la3 = p.nth(3); - if !matches!((p.current(), la1, la2, la3), - (T![&], T![self], _, _) - | (T![&], T![mut], T![self], _) - | (T![&], LIFETIME_IDENT, T![self], _) - | (T![&], LIFETIME_IDENT, T![mut], T![self]) + if !matches!( + (p.current(), la1, la2, la3), + (T![&], T![self], _, _) + | (T![&], T![mut], T![self], _) + | (T![&], LIFETIME_IDENT, T![self], _) + | (T![&], LIFETIME_IDENT, T![mut], T![self]) ) { return m.abandon(p); } diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index f4fd1ac13..bdffff5ae 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs @@ -398,7 +398,7 @@ impl GlobalState { } let state_changed = self.process_changes(); - let is_ready = matches!(self.status, Status::Ready { .. } ); + let is_ready = matches!(self.status, Status::Ready { .. }); if prev_status == Status::Loading && is_ready { for flycheck in &self.flycheck { flycheck.update(); diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index 5236932e8..be10ac1ae 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs @@ -528,7 +528,8 @@ pub(crate) fn url_from_abs_path(path: &Path) -> lsp_types::Url { assert!(path.is_absolute()); let url = lsp_types::Url::from_file_path(path).unwrap(); match path.components().next() { - Some(path::Component::Prefix(prefix)) if matches!(prefix.kind(), path::Prefix::Disk(_) | path::Prefix::VerbatimDisk(_)) => + Some(path::Component::Prefix(prefix)) + if matches!(prefix.kind(), path::Prefix::Disk(_) | path::Prefix::VerbatimDisk(_)) => { // Need to lowercase driver letter } -- cgit v1.2.3