Skip to content

Commit e2816a9

Browse files
bors[bot]matklad
andcommitted
Merge #380
380: no-backtrace r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
2 parents dee7c3b + 0a8d085 commit e2816a9

File tree

4 files changed

+5
-48
lines changed

4 files changed

+5
-48
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ra_db/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ version = "0.1.0"
55
authors = ["Aleksey Kladov <[email protected]>"]
66

77
[dependencies]
8-
backtrace = "0.3.1"
98
relative-path = "0.4.0"
109
salsa = "0.9.0"
1110
rustc-hash = "1.0"

crates/ra_db/src/cancelation.rs

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,17 @@
1515
//! any background processing (this bit is handled by salsa, see
1616
//! `BaseDatabase::check_canceled` method).
1717
18-
use std::{
19-
cmp,
20-
hash::{Hash, Hasher},
21-
sync::Arc,
22-
};
23-
24-
use backtrace::Backtrace;
25-
use parking_lot::Mutex;
26-
2718
/// An "error" signifing that the operation was canceled.
28-
#[derive(Clone)]
19+
#[derive(Clone, PartialEq, Eq, Hash)]
2920
pub struct Canceled {
30-
backtrace: Arc<Mutex<Backtrace>>,
21+
_private: (),
3122
}
3223

3324
pub type Cancelable<T> = Result<T, Canceled>;
3425

3526
impl Canceled {
3627
pub(crate) fn new() -> Canceled {
37-
let bt = Backtrace::new_unresolved();
38-
Canceled {
39-
backtrace: Arc::new(Mutex::new(bt)),
40-
}
28+
Canceled { _private: () }
4129
}
4230
}
4331

@@ -49,37 +37,8 @@ impl std::fmt::Display for Canceled {
4937

5038
impl std::fmt::Debug for Canceled {
5139
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
52-
let mut bt = self.backtrace.lock();
53-
let bt: &mut Backtrace = &mut *bt;
54-
bt.resolve();
55-
write!(fmt, "canceled at:\n{:?}", bt)
40+
write!(fmt, "Canceled")
5641
}
5742
}
5843

5944
impl std::error::Error for Canceled {}
60-
61-
impl PartialEq for Canceled {
62-
fn eq(&self, _: &Canceled) -> bool {
63-
true
64-
}
65-
}
66-
67-
impl Eq for Canceled {}
68-
69-
impl Hash for Canceled {
70-
fn hash<H: Hasher>(&self, hasher: &mut H) {
71-
().hash(hasher)
72-
}
73-
}
74-
75-
impl cmp::Ord for Canceled {
76-
fn cmp(&self, _: &Canceled) -> cmp::Ordering {
77-
cmp::Ordering::Equal
78-
}
79-
}
80-
81-
impl cmp::PartialOrd for Canceled {
82-
fn partial_cmp(&self, other: &Canceled) -> Option<cmp::Ordering> {
83-
Some(self.cmp(other))
84-
}
85-
}

crates/ra_lsp_server/src/main_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ impl<'a> PoolDispatcher<'a> {
432432
RawResponse::err(
433433
id,
434434
ErrorCode::ContentModified as i32,
435-
format!("content modified: {:?}", e),
435+
"content modified".to_string(),
436436
)
437437
} else {
438438
RawResponse::err(

0 commit comments

Comments
 (0)