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

Update to nightly-2024-12-15, prepare 0.5.43 #101

Merged
merged 1 commit into from
Dec 17, 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
16 changes: 8 additions & 8 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ exclude = ["ide/src/tests/mock_project"]
resolver = "2"

[workspace.dependencies]
rustc_plugin = "=0.11.0-nightly-2024-12-01"
rustc_utils = {version = "=0.11.0-nightly-2024-12-01", features = ["indexical"]}
rustc_plugin = "=0.12.0-nightly-2024-12-15"
rustc_utils = {version = "=0.12.0-nightly-2024-12-15", features = ["indexical"]}
indexical = {version = "0.3.1", default-features = false, features = ["rustc"]}

[profile.bench]
Expand Down
2 changes: 1 addition & 1 deletion crates/flowistry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "flowistry"
version = "0.5.42"
version = "0.5.43"
edition = "2021"
authors = ["Will Crichton <[email protected]>"]
description = "Modular information flow analysis"
Expand Down
4 changes: 1 addition & 3 deletions crates/flowistry/benches/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let mut callbacks = Callbacks { group };
rustc_driver::catch_fatal_errors(|| {
rustc_driver::RunCompiler::new(&args, &mut callbacks)
.run()
.unwrap()
rustc_driver::RunCompiler::new(&args, &mut callbacks).run();
})
.unwrap();
}
Expand Down
4 changes: 1 addition & 3 deletions crates/flowistry/examples/example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ fn main() {
// Run rustc with the given arguments
let mut callbacks = Callbacks;
rustc_driver::catch_fatal_errors(|| {
rustc_driver::RunCompiler::new(&args, &mut callbacks)
.run()
.unwrap()
rustc_driver::RunCompiler::new(&args, &mut callbacks).run();
})
.unwrap();
}
4 changes: 2 additions & 2 deletions crates/flowistry/src/infoflow/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ impl<'a, 'tcx> Analysis<'tcx> for FlowAnalysis<'a, 'tcx> {
}
}

fn apply_statement_effect(
fn apply_primary_statement_effect(
&mut self,
state: &mut Self::Domain,
statement: &Statement<'tcx>,
Expand All @@ -267,7 +267,7 @@ impl<'a, 'tcx> Analysis<'tcx> for FlowAnalysis<'a, 'tcx> {
.visit_statement(statement, location);
}

fn apply_terminator_effect<'mir>(
fn apply_primary_terminator_effect<'mir>(
&mut self,
state: &mut Self::Domain,
terminator: &'mir Terminator<'tcx>,
Expand Down
12 changes: 10 additions & 2 deletions crates/flowistry/src/mir/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,19 @@ pub fn iterate_to_fixpoint<'tcx, A: Analysis<'tcx>>(
};
let next_locs = match body.stmt_at(location) {
Either::Left(statement) => {
analysis.apply_statement_effect(&mut state[loc_index], statement, location);
analysis.apply_primary_statement_effect(
&mut state[loc_index],
statement,
location,
);
vec![location.successor_within_block()]
}
Either::Right(terminator) => {
analysis.apply_terminator_effect(&mut state[loc_index], terminator, location);
analysis.apply_primary_terminator_effect(
&mut state[loc_index],
terminator,
location,
);
body
.basic_blocks
.successors(location.block)
Expand Down
4 changes: 2 additions & 2 deletions crates/flowistry_ide/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "flowistry_ide"
version = "0.5.42"
version = "0.5.43"
edition = "2021"
authors = ["Will Crichton <[email protected]>"]
description = "Information Flow in the IDE for Rust"
Expand All @@ -14,7 +14,7 @@ rustc_private = true
decompose = ["petgraph", "rayon"]

[dependencies]
flowistry = {version = "0.5.42", path = "../flowistry"}
flowistry = {version = "0.5.43", path = "../flowistry"}
anyhow = "1"
log = "0.4"
fluid-let = "1.0"
Expand Down
38 changes: 21 additions & 17 deletions crates/flowistry_ide/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,11 @@ fn postprocess<T: Serialize>(result: FlowistryResult<T>) -> RustcResult<()> {
let result = match result {
Ok(output) => Ok(output),
Err(e) => match e {
FlowistryError::BuildError(e) => return Err(e),
FlowistryError::BuildError =>
{
#[allow(deprecated)]
return Err(ErrorGuaranteed::unchecked_error_guaranteed())
}
e => Err(e),
},
};
Expand Down Expand Up @@ -248,7 +252,11 @@ pub fn run_with_callbacks(
);

let compiler = rustc_driver::RunCompiler::new(&args, callbacks);
compiler.run().map_err(FlowistryError::BuildError)

rustc_driver::catch_fatal_errors(move || {
compiler.run();
})
.map_err(|_| FlowistryError::BuildError)
}

fn run<A: FlowistryAnalysis, T: ToSpan>(
Expand Down Expand Up @@ -280,7 +288,7 @@ fn run<A: FlowistryAnalysis, T: ToSpan>(
#[derive(Debug, Serialize)]
#[serde(tag = "type")]
pub enum FlowistryError {
BuildError(#[serde(skip_serializing)] ErrorGuaranteed),
BuildError,
AnalysisError { error: String },
FileNotFound,
}
Expand Down Expand Up @@ -321,26 +329,22 @@ impl<A: FlowistryAnalysis, T: ToSpan, F: FnOnce() -> T> rustc_driver::Callbacks
config.override_queries = Some(borrowck_facts::override_queries);
}

fn after_expansion<'tcx>(
fn after_analysis<'tcx>(
&mut self,
_compiler: &rustc_interface::interface::Compiler,
queries: &'tcx rustc_interface::Queries<'tcx>,
tcx: TyCtxt<'tcx>,
) -> rustc_driver::Compilation {
elapsed("rustc", self.rustc_start);
fluid_set!(EVAL_MODE, self.eval_mode.unwrap_or_default());

let start = Instant::now();
queries.global_ctxt().unwrap().enter(|tcx| {
elapsed("global_ctxt", start);
let mut analysis = self.analysis.take().unwrap();
self.output = Some((|| {
let target = (self.compute_target.take().unwrap())().to_span(tcx)?;
debug!("target span: {target:?}");
let mut bodies = find_enclosing_bodies(tcx, target);
let body = bodies.next().context("Selection did not map to a body")?;
analysis.analyze(tcx, body)
})());
});
let mut analysis = self.analysis.take().unwrap();
self.output = Some((|| {
let target = (self.compute_target.take().unwrap())().to_span(tcx)?;
debug!("target span: {target:?}");
let mut bodies = find_enclosing_bodies(tcx, target);
let body = bodies.next().context("Selection did not map to a body")?;
analysis.analyze(tcx, body)
})());

rustc_driver::Compilation::Stop
}
Expand Down
4 changes: 2 additions & 2 deletions crates/flowistry_ifc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "flowistry_ifc"
version = "0.5.42"
version = "0.5.43"
edition = "2021"
publish = false

[package.metadata.rust-analyzer]
rustc_private = true

[dependencies]
flowistry = {version = "0.5.42", path = "../flowistry"}
flowistry = {version = "0.5.43", path = "../flowistry"}
env_logger = "0.9"
termcolor = "1.1"
anyhow = "1"
Expand Down
3 changes: 2 additions & 1 deletion crates/flowistry_ifc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ impl RustcPlugin for IfcPlugin {
compiler_args: Vec<String>,
_plugin_args: Self::Args,
) -> rustc_interface::interface::Result<()> {
rustc_driver::RunCompiler::new(&compiler_args, &mut Callbacks).run()
rustc_driver::RunCompiler::new(&compiler_args, &mut Callbacks).run();
Ok(())
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/flowistry_ifc_traits/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "flowistry_ifc_traits"
version = "0.5.42"
version = "0.5.43"
edition = "2021"
publish = false

Expand Down
4 changes: 2 additions & 2 deletions ide/package-lock.json

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

2 changes: 1 addition & 1 deletion ide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"type": "git"
},
"description": "Information Flow in the IDE for Rust",
"version": "0.5.42",
"version": "0.5.43",
"engines": {
"vscode": "^1.54.0"
},
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2024-12-01"
channel = "nightly-2024-12-15"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
Loading