Skip to content

Commit

Permalink
intermediate stubs are not sent
Browse files Browse the repository at this point in the history
Summary: those are not required by eqwalizer anymore

Reviewed By: VLanvin

Differential Revision: D60114599

fbshipit-source-id: 0486711c99a73456c5e21dd6f9d0ff4433842999
  • Loading branch information
ilya-klyuchnikov authored and facebook-github-bot committed Jul 23, 2024
1 parent 23417bc commit 5885bbd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 80 deletions.
56 changes: 0 additions & 56 deletions crates/eqwalizer/src/ast/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ pub trait EqwalizerASTDatabase: EqwalizerErlASTStorage + SourceDatabase {
module: ModuleName,
) -> Result<Arc<Vec<u8>>, Error>;
fn converted_stub(&self, project_id: ProjectId, module: ModuleName) -> Result<Arc<AST>, Error>;
fn converted_stub_bytes(
&self,
project_id: ProjectId,
module: ModuleName,
) -> Result<Arc<Vec<u8>>, Error>;

fn type_ids(
&self,
Expand All @@ -71,33 +66,18 @@ pub trait EqwalizerASTDatabase: EqwalizerErlASTStorage + SourceDatabase {
project_id: ProjectId,
module: ModuleName,
) -> Result<Arc<ModuleStub>, Error>;
fn expanded_stub_bytes(
&self,
project_id: ProjectId,
module: ModuleName,
) -> Result<Arc<Vec<u8>>, Error>;

fn contractive_stub(
&self,
project_id: ProjectId,
module: ModuleName,
) -> Result<Arc<ModuleStub>, Error>;
fn contractive_stub_bytes(
&self,
project_id: ProjectId,
module: ModuleName,
) -> Result<Arc<Vec<u8>>, Error>;

fn covariant_stub(
&self,
project_id: ProjectId,
module: ModuleName,
) -> Result<Arc<ModuleStub>, Error>;
fn covariant_stub_bytes(
&self,
project_id: ProjectId,
module: ModuleName,
) -> Result<Arc<Vec<u8>>, Error>;

fn transitive_stub(
&self,
Expand Down Expand Up @@ -162,15 +142,6 @@ fn converted_stub(
}
}

fn converted_stub_bytes(
db: &dyn EqwalizerASTDatabase,
project_id: ProjectId,
module: ModuleName,
) -> Result<Arc<Vec<u8>>, Error> {
db.converted_stub(project_id, module)
.map(|ast| Arc::new(super::to_bytes(&ast)))
}

fn beam_path(
db: &dyn EqwalizerASTDatabase,
project_id: ProjectId,
Expand Down Expand Up @@ -217,15 +188,6 @@ fn expanded_stub(
.map_err(Error::TypeConversionError)
}

fn expanded_stub_bytes(
db: &dyn EqwalizerASTDatabase,
project_id: ProjectId,
module: ModuleName,
) -> Result<Arc<Vec<u8>>, Error> {
db.expanded_stub(project_id, module)
.map(|stub| Arc::new(stub.to_bytes()))
}

fn contractive_stub(
db: &dyn EqwalizerASTDatabase,
project_id: ProjectId,
Expand All @@ -239,15 +201,6 @@ fn contractive_stub(
.map_err(Error::ContractivityError)
}

fn contractive_stub_bytes(
db: &dyn EqwalizerASTDatabase,
project_id: ProjectId,
module: ModuleName,
) -> Result<Arc<Vec<u8>>, Error> {
db.contractive_stub(project_id, module)
.map(|stub| Arc::new(stub.to_bytes()))
}

fn covariant_stub(
db: &dyn EqwalizerASTDatabase,
project_id: ProjectId,
Expand All @@ -261,15 +214,6 @@ fn covariant_stub(
.map_err(Error::VarianceCheckError)
}

fn covariant_stub_bytes(
db: &dyn EqwalizerASTDatabase,
project_id: ProjectId,
module: ModuleName,
) -> Result<Arc<Vec<u8>>, Error> {
db.covariant_stub(project_id, module)
.map(|stub| Arc::new(stub.to_bytes()))
}

fn transitive_stub(
db: &dyn EqwalizerASTDatabase,
project_id: ProjectId,
Expand Down
6 changes: 0 additions & 6 deletions crates/eqwalizer/src/ipc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@ use crate::ast::Pos;

#[derive(Deserialize, Debug)]
pub enum EqWAlizerASTFormat {
RawForms,
ConvertedForms,
RawStub,
ConvertedStub,
ExpandedStub,
ContractiveStub,
CovariantStub,
TransitiveStub,
}

Expand Down
18 changes: 0 additions & 18 deletions crates/eqwalizer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,27 +364,9 @@ fn get_module_diagnostics(
let module_name = ModuleName::new(&module);
let ast = {
match format {
EqWAlizerASTFormat::RawForms => {
db.get_erl_ast_bytes(project_id, module_name)
}
EqWAlizerASTFormat::ConvertedForms => {
db.converted_ast_bytes(project_id, module_name)
}
EqWAlizerASTFormat::RawStub => {
db.get_erl_stub_bytes(project_id, module_name)
}
EqWAlizerASTFormat::ConvertedStub => {
db.converted_stub_bytes(project_id, module_name)
}
EqWAlizerASTFormat::ExpandedStub => {
db.expanded_stub_bytes(project_id, module_name)
}
EqWAlizerASTFormat::ContractiveStub => {
db.contractive_stub_bytes(project_id, module_name)
}
EqWAlizerASTFormat::CovariantStub => {
db.covariant_stub_bytes(project_id, module_name)
}
EqWAlizerASTFormat::TransitiveStub => {
db.transitive_stub_bytes(project_id, module_name)
}
Expand Down

0 comments on commit 5885bbd

Please sign in to comment.