summaryrefslogtreecommitdiff
path: root/cli/lsp
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2022-06-26 00:13:24 +0200
committerGitHub <noreply@github.com>2022-06-26 00:13:24 +0200
commit8d82ba729937baf83011354242cabc3d50c13dc2 (patch)
tree3e8c4d87986338639eeef4a76543e4335020262c /cli/lsp
parent38505db39137f33bfdb942658ea892a617ac0980 (diff)
build: require safety comments on unsafe code (#13870)
Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'cli/lsp')
-rw-r--r--cli/lsp/logging.rs6
-rw-r--r--cli/lsp/parent_process_checker.rs2
2 files changed, 7 insertions, 1 deletions
diff --git a/cli/lsp/logging.rs b/cli/lsp/logging.rs
index b3fc06d89..88392dca2 100644
--- a/cli/lsp/logging.rs
+++ b/cli/lsp/logging.rs
@@ -21,7 +21,11 @@ pub fn set_lsp_log_level(level: log::Level) {
pub fn lsp_log_level() -> log::Level {
let level = LSP_LOG_LEVEL.load(Ordering::SeqCst);
- unsafe { std::mem::transmute(level) }
+ // TODO(bartlomieju):
+ #[allow(clippy::undocumented_unsafe_blocks)]
+ unsafe {
+ std::mem::transmute(level)
+ }
}
/// Use this macro to do "info" logs in the lsp code. This allows
diff --git a/cli/lsp/parent_process_checker.rs b/cli/lsp/parent_process_checker.rs
index f4bf99d3e..e4a359bd9 100644
--- a/cli/lsp/parent_process_checker.rs
+++ b/cli/lsp/parent_process_checker.rs
@@ -20,6 +20,8 @@ pub fn start(parent_process_id: u32) {
#[cfg(unix)]
fn is_process_active(process_id: u32) -> bool {
+ // TODO(bartlomieju):
+ #[allow(clippy::undocumented_unsafe_blocks)]
unsafe {
// signal of 0 checks for the existence of the process id
libc::kill(process_id as i32, 0) == 0