Skip to content

Commit 1850849

Browse files
committed
internal: prep to 2021 edition
1 parent 2fbe1c9 commit 1850849

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ env:
1212
CARGO_NET_RETRY: 10
1313
CI: 1
1414
RUST_BACKTRACE: short
15-
RUSTFLAGS: "-D warnings -W unreachable-pub"
15+
RUSTFLAGS: "-D warnings -W unreachable-pub -W rust-2021-compatibility"
1616
RUSTUP_MAX_RETRIES: 10
1717

1818
jobs:

crates/hir_expand/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,10 +547,10 @@ impl InFile<SyntaxToken> {
547547
self,
548548
db: &dyn db::AstDatabase,
549549
) -> impl Iterator<Item = InFile<SyntaxNode>> + '_ {
550-
self.value
551-
.parent()
552-
.into_iter()
553-
.flat_map(move |parent| InFile::new(self.file_id, parent).ancestors_with_macros(db))
550+
self.value.parent().into_iter().flat_map({
551+
let file_id = self.file_id;
552+
move |parent| InFile::new(file_id, parent).ancestors_with_macros(db)
553+
})
554554
}
555555
}
556556

crates/rust-analyzer/src/dispatch.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,18 @@ impl<'a> RequestDispatcher<'a> {
3030
Some(it) => it,
3131
None => return Ok(self),
3232
};
33-
let world = panic::AssertUnwindSafe(&mut *self.global_state);
33+
let global_state = panic::AssertUnwindSafe(&mut *self.global_state);
3434

3535
let response = panic::catch_unwind(move || {
36+
let _ = &global_state;
37+
let panic::AssertUnwindSafe(global_state) = global_state;
3638
let _pctx = stdx::panic_context::enter(format!(
3739
"\nversion: {}\nrequest: {} {:#?}",
3840
env!("REV"),
3941
R::METHOD,
4042
params
4143
));
42-
let result = f(world.0, params);
44+
let result = f(global_state, params);
4345
result_to_response::<R>(id, result)
4446
})
4547
.map_err(|_err| format!("sync task {:?} panicked", R::METHOD))?;

crates/rust-analyzer/src/main_loop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,12 @@ impl GlobalState {
420420
self.prime_caches_queue.request_op();
421421
if self.prime_caches_queue.should_start_op() {
422422
self.task_pool.handle.spawn_with_sender({
423-
let snap = self.snapshot();
423+
let analysis = self.snapshot().analysis;
424424
move |sender| {
425425
let cb = |progress| {
426426
sender.send(Task::PrimeCaches(progress)).unwrap();
427427
};
428-
match snap.analysis.prime_caches(cb) {
428+
match analysis.prime_caches(cb) {
429429
Ok(()) => (),
430430
Err(_canceled) => (),
431431
}

0 commit comments

Comments
 (0)