mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Merge #9961
9961: internal: prep to 2021 edition r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
3004f2ec90
4 changed files with 11 additions and 9 deletions
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
|
@ -12,7 +12,7 @@ env:
|
|||
CARGO_NET_RETRY: 10
|
||||
CI: 1
|
||||
RUST_BACKTRACE: short
|
||||
RUSTFLAGS: "-D warnings -W unreachable-pub"
|
||||
RUSTFLAGS: "-D warnings -W unreachable-pub -W rust-2021-compatibility"
|
||||
RUSTUP_MAX_RETRIES: 10
|
||||
|
||||
jobs:
|
||||
|
|
|
@ -547,10 +547,10 @@ impl InFile<SyntaxToken> {
|
|||
self,
|
||||
db: &dyn db::AstDatabase,
|
||||
) -> impl Iterator<Item = InFile<SyntaxNode>> + '_ {
|
||||
self.value
|
||||
.parent()
|
||||
.into_iter()
|
||||
.flat_map(move |parent| InFile::new(self.file_id, parent).ancestors_with_macros(db))
|
||||
self.value.parent().into_iter().flat_map({
|
||||
let file_id = self.file_id;
|
||||
move |parent| InFile::new(file_id, parent).ancestors_with_macros(db)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,16 +30,18 @@ impl<'a> RequestDispatcher<'a> {
|
|||
Some(it) => it,
|
||||
None => return Ok(self),
|
||||
};
|
||||
let world = panic::AssertUnwindSafe(&mut *self.global_state);
|
||||
let global_state = panic::AssertUnwindSafe(&mut *self.global_state);
|
||||
|
||||
let response = panic::catch_unwind(move || {
|
||||
let _ = &global_state;
|
||||
let panic::AssertUnwindSafe(global_state) = global_state;
|
||||
let _pctx = stdx::panic_context::enter(format!(
|
||||
"\nversion: {}\nrequest: {} {:#?}",
|
||||
env!("REV"),
|
||||
R::METHOD,
|
||||
params
|
||||
));
|
||||
let result = f(world.0, params);
|
||||
let result = f(global_state, params);
|
||||
result_to_response::<R>(id, result)
|
||||
})
|
||||
.map_err(|_err| format!("sync task {:?} panicked", R::METHOD))?;
|
||||
|
|
|
@ -420,12 +420,12 @@ impl GlobalState {
|
|||
self.prime_caches_queue.request_op();
|
||||
if self.prime_caches_queue.should_start_op() {
|
||||
self.task_pool.handle.spawn_with_sender({
|
||||
let snap = self.snapshot();
|
||||
let analysis = self.snapshot().analysis;
|
||||
move |sender| {
|
||||
let cb = |progress| {
|
||||
sender.send(Task::PrimeCaches(progress)).unwrap();
|
||||
};
|
||||
match snap.analysis.prime_caches(cb) {
|
||||
match analysis.prime_caches(cb) {
|
||||
Ok(()) => (),
|
||||
Err(_canceled) => (),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue