Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save/load extern specs in metadata #763

Merged
merged 4 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ flux-syntax = { path = "./crates/flux-syntax", version = "0.1.0" }
tests = { path = "./tests", version = "0.1.0" }

dashmap = { version = "5.5.3", features = ["raw-api"] }
derive-where = "1.2.7"
home = "0.5.9"
itertools = "0.13.0"
serde = { version = "1.0", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions crates/flux-driver/src/callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl FluxCallbacks {
let arena = fhir::Arena::new();
GlobalEnv::enter(tcx, &sess, Box::new(cstore), &arena, providers, |genv| {
if check_crate(genv).is_ok() {
save_metadata(&genv);
save_metadata(genv);
}
});
sess.finish_diagnostics();
Expand Down Expand Up @@ -113,7 +113,7 @@ fn collect_specs(genv: GlobalEnv) -> Specs {
}
}

fn save_metadata(genv: &GlobalEnv) {
fn save_metadata(genv: GlobalEnv) {
let tcx = genv.tcx();
if tcx
.sess
Expand Down
5 changes: 3 additions & 2 deletions crates/flux-fixpoint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ edition.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
derive-where = "1.2.7"
flux-common.workspace = true
flux-config.workspace = true

derive-where.workspace = true
itertools.workspace = true
serde = { version = "1.0", features = ["derive"] }
serde.workspace = true
serde_json = "1.0"

[package.metadata.rust-analyzer]
Expand Down
2 changes: 2 additions & 0 deletions crates/flux-metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ flux-common.workspace = true
flux-errors.workspace = true
flux-macros.workspace = true
flux-middle.workspace = true

derive-where.workspace = true
itertools.workspace = true

[package.metadata.rust-analyzer]
Expand Down
2 changes: 2 additions & 0 deletions crates/flux-metadata/locales/en-US.ftl
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
metadata_decode_file_error = "error when decoding flux metadata file {$path}: {$err}"

metadata_duplicate_spec = "duplicate spec for {$def_name}"
2 changes: 1 addition & 1 deletion crates/flux-metadata/src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct EncodeContext<'a, 'tcx> {
symbol_table: FxHashMap<Symbol, usize>, // interpret_allocs: FxIndexSet<interpret::AllocId>,
}

pub fn encode_metadata(genv: &GlobalEnv, path: &std::path::Path) {
pub fn encode_metadata(genv: GlobalEnv, path: &std::path::Path) {
let mut encoder = opaque::FileEncoder::new(path).unwrap_or_else(|err| {
genv.tcx()
.sess
Expand Down
Loading
Loading