Skip to content

Commit 50fb37b

Browse files
jvansch1meta-codesync[bot]
authored andcommitted
Clean up dead_code warnings.
Summary: Over time some dead code warnings have accumulated throughout the codebase that are no longer valid. Had claude do a search and remove these. Reviewed By: stroxler Differential Revision: D96519259 fbshipit-source-id: 39e5f77e96b96d02a3a4db54f73f90c19d737567
1 parent e9dedf7 commit 50fb37b

File tree

10 files changed

+0
-17
lines changed

10 files changed

+0
-17
lines changed

crates/pyrefly_bundled/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ pub fn bundled_typeshed() -> anyhow::Result<SmallMap<PathBuf, String>> {
118118
extract_pyi_files_from_archive(PathFilter::Stdlib)
119119
}
120120

121-
#[allow(dead_code)]
122121
pub fn bundled_third_party_stubs() -> anyhow::Result<SmallMap<PathBuf, String>> {
123122
extract_pyi_files_from_archive(PathFilter::ThirdPartyTypeshedStubs)
124123
}

crates/pyrefly_python/src/module_name.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ impl ModuleName {
250250
Self::from_str("pydantic.main")
251251
}
252252

253-
#[allow(dead_code)]
254253
pub fn pydantic_settings() -> Self {
255254
Self::from_str("pydantic_settings.main")
256255
}
@@ -259,7 +258,6 @@ impl ModuleName {
259258
Self::from_str("pydantic.root_model")
260259
}
261260

262-
#[allow(dead_code)]
263261
pub fn pydantic_dataclasses() -> Self {
264262
Self::from_str("pydantic.dataclasses")
265263
}

crates/pyrefly_types/src/type_var.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ pub enum Variance {
9797
Covariant,
9898
Contravariant,
9999
Invariant,
100-
#[allow(dead_code)]
101100
Bivariant,
102101
}
103102

pyrefly/lib/alt/answers.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ impl Solutions {
294294
&self.metadata
295295
}
296296

297-
#[allow(dead_code)] // Used in tests.
298297
pub fn get<K: Exported>(&self, key: &K) -> &Arc<<K as Keyed>::Answer>
299298
where
300299
SolutionsTable: TableKeyed<K, Value = SolutionsEntry<K>>,

pyrefly/lib/lsp/non_wasm/server.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ pub struct Connection {
450450
/// without requiring interior mutability — stdin is only ever read from one
451451
/// thread.
452452
pub enum MessageReader {
453-
#[cfg_attr(not(test), allow(dead_code))]
454453
Channel(Receiver<Message>),
455454
Stdio(BufReader<Stdin>),
456455
}

pyrefly/lib/report/pysa/ast_visitor.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ pub enum Scope {
4242
decorated_function: DecoratedFunction,
4343
},
4444
ExportedClass {
45-
#[allow(dead_code)]
4645
class_id: ClassId,
4746
#[allow(dead_code)]
4847
class_name: Name,
@@ -81,22 +80,19 @@ pub enum ExportFunctionDecorators {
8180
InDecoratedFunction,
8281
InParentScope,
8382
InDecoratedTarget,
84-
#[allow(dead_code)]
8583
Ignore,
8684
}
8785

8886
pub enum ExportClassDecorators {
8987
#[allow(dead_code)]
9088
InDecoratedClassTopLevel,
9189
InParentScope,
92-
#[allow(dead_code)]
9390
Ignore,
9491
}
9592

9693
pub enum ExportDefaultArguments {
9794
InFunction,
9895
InParentScope,
99-
#[allow(dead_code)]
10096
Ignore,
10197
}
10298

pyrefly/lib/report/pysa/types.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use crate::types::display::TypeDisplayContext;
2727

2828
/// Modifier that was stripped from a type to extract the underlying class.
2929
#[derive(Debug, Clone, Copy, Serialize, PartialEq, Eq, Hash, PartialOrd, Ord)]
30-
#[allow(dead_code)]
3130
pub enum TypeModifier {
3231
Optional, // Optional[T]
3332
Coroutine, // Coroutine[<...>]

pyrefly/lib/state/subscriber.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,12 @@ impl Subscriber for TestSubscriber {
7575
}
7676

7777
impl TestSubscriber {
78-
#[allow(dead_code)] // Only in test code
7978
pub fn new() -> Self {
8079
Self::default()
8180
}
8281

8382
/// For each handle, return a pair of (the number of times each handle started, the final load state).
8483
/// Panics if any handle was started but not finished.
85-
#[allow(dead_code)] // Only in test code
8684
pub fn finish(self) -> SmallMap<Handle, (usize, Option<Arc<Load>>)> {
8785
mem::take(&mut *self.0.lock())
8886
}

pyrefly/lib/test/lsp/lsp_interaction/object_model.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,6 @@ impl TestClient {
657657
}
658658

659659
/// Send a file deletion event notification
660-
#[allow(dead_code)]
661660
pub fn file_deleted(&self, file: &str) {
662661
let path = self.get_root_or_panic().join(file);
663662
self.send_notification::<DidChangeWatchedFiles>(json!({

pyrefly/lib/tsp/validation.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
//! - Canonical TSP error construction (invalid params, internal, etc.)
1515
//! - Response dispatch (success or error, routed through `TspInterface`)
1616
17-
// Helpers are public API for upcoming message handlers; suppress until first use.
18-
#![allow(dead_code)]
19-
2017
use lsp_server::ErrorCode;
2118
use lsp_server::RequestId;
2219
use lsp_server::ResponseError;

0 commit comments

Comments
 (0)