mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Lint debug prints and disallowed types with clippy
This commit is contained in:
parent
850ba2fb63
commit
9e8a0fae0c
64 changed files with 170 additions and 229 deletions
|
@ -18,6 +18,7 @@ pub struct PanicContext {
|
|||
}
|
||||
|
||||
impl PanicContext {
|
||||
#[allow(clippy::print_stderr)]
|
||||
fn init() {
|
||||
let default_hook = panic::take_hook();
|
||||
let hook = move |panic_info: &panic::PanicInfo<'_>| {
|
||||
|
@ -43,7 +44,7 @@ impl Drop for PanicContext {
|
|||
|
||||
fn with_ctx(f: impl FnOnce(&mut Vec<String>)) {
|
||||
thread_local! {
|
||||
static CTX: RefCell<Vec<String>> = RefCell::new(Vec::new());
|
||||
static CTX: RefCell<Vec<String>> = const { RefCell::new(Vec::new()) };
|
||||
}
|
||||
CTX.with(|ctx| f(&mut ctx.borrow_mut()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue