From 52ff3d8acc0ba6ba078a1c5db0a9d30f0927fdd1 Mon Sep 17 00:00:00 2001 From: Will Crichton Date: Mon, 16 Dec 2024 14:52:27 -0800 Subject: [PATCH] Update to nightly-2024-12-15, prepare 0.5.43 --- Cargo.lock | 16 +++++----- Cargo.toml | 4 +-- crates/flowistry/Cargo.toml | 2 +- crates/flowistry/benches/main.rs | 4 +-- crates/flowistry/examples/example.rs | 4 +-- crates/flowistry/src/infoflow/analysis.rs | 4 +-- crates/flowistry/src/mir/engine.rs | 12 +++++-- crates/flowistry_ide/Cargo.toml | 4 +-- crates/flowistry_ide/src/plugin.rs | 38 +++++++++++++---------- crates/flowistry_ifc/Cargo.toml | 4 +-- crates/flowistry_ifc/src/lib.rs | 3 +- crates/flowistry_ifc_traits/Cargo.toml | 2 +- ide/package-lock.json | 4 +-- ide/package.json | 2 +- rust-toolchain.toml | 2 +- 15 files changed, 57 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b111c21377..849a6a6124 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "flowistry" -version = "0.5.42" +version = "0.5.43" dependencies = [ "anyhow", "bench_utils", @@ -346,7 +346,7 @@ dependencies = [ [[package]] name = "flowistry_ide" -version = "0.5.42" +version = "0.5.43" dependencies = [ "anyhow", "base64", @@ -369,7 +369,7 @@ dependencies = [ [[package]] name = "flowistry_ifc" -version = "0.5.42" +version = "0.5.43" dependencies = [ "anyhow", "env_logger", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "flowistry_ifc_traits" -version = "0.5.42" +version = "0.5.43" [[package]] name = "fluid-let" @@ -700,9 +700,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rustc_plugin" -version = "0.11.0-nightly-2024-12-01" +version = "0.12.0-nightly-2024-12-15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "665358b6619ffa05c3fce0900fb6ae0bc661df03cbb959acdc1a59139631c477" +checksum = "351d0edb6bb7f15aa21d83c29604cdc3bdcec506e12233868b369ee6d3328da3" dependencies = [ "cargo_metadata", "log", @@ -720,9 +720,9 @@ checksum = "b3c5a95edfa0c893236ae4778bb7c4752760e4c0d245e19b5eff33c5aa5eb9dc" [[package]] name = "rustc_utils" -version = "0.11.0-nightly-2024-12-01" +version = "0.12.0-nightly-2024-12-15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81511bc57827cf136f4e008b57b77e2dac1e6e058c2f275901d87cc729631847" +checksum = "8a82a375e5df4530b4c5e94ab8251c754c92c3e593efaf8214e572ea422bf3a0" dependencies = [ "anyhow", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index 8dafe9a459..8416295e62 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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] diff --git a/crates/flowistry/Cargo.toml b/crates/flowistry/Cargo.toml index bdec9255bd..c8940dafea 100644 --- a/crates/flowistry/Cargo.toml +++ b/crates/flowistry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flowistry" -version = "0.5.42" +version = "0.5.43" edition = "2021" authors = ["Will Crichton "] description = "Modular information flow analysis" diff --git a/crates/flowistry/benches/main.rs b/crates/flowistry/benches/main.rs index 0618837b9e..e261a7dfa1 100644 --- a/crates/flowistry/benches/main.rs +++ b/crates/flowistry/benches/main.rs @@ -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(); } diff --git a/crates/flowistry/examples/example.rs b/crates/flowistry/examples/example.rs index 11e9201a45..32c6b1dbe9 100644 --- a/crates/flowistry/examples/example.rs +++ b/crates/flowistry/examples/example.rs @@ -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(); } diff --git a/crates/flowistry/src/infoflow/analysis.rs b/crates/flowistry/src/infoflow/analysis.rs index 5e1cb02de1..15912e8a27 100644 --- a/crates/flowistry/src/infoflow/analysis.rs +++ b/crates/flowistry/src/infoflow/analysis.rs @@ -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>, @@ -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>, diff --git a/crates/flowistry/src/mir/engine.rs b/crates/flowistry/src/mir/engine.rs index 07e34ad2f4..97db58f1b8 100644 --- a/crates/flowistry/src/mir/engine.rs +++ b/crates/flowistry/src/mir/engine.rs @@ -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) diff --git a/crates/flowistry_ide/Cargo.toml b/crates/flowistry_ide/Cargo.toml index c0690ae23b..349cfaf9d1 100644 --- a/crates/flowistry_ide/Cargo.toml +++ b/crates/flowistry_ide/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flowistry_ide" -version = "0.5.42" +version = "0.5.43" edition = "2021" authors = ["Will Crichton "] description = "Information Flow in the IDE for Rust" @@ -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" diff --git a/crates/flowistry_ide/src/plugin.rs b/crates/flowistry_ide/src/plugin.rs index 0ebc7c2385..bd4b584144 100644 --- a/crates/flowistry_ide/src/plugin.rs +++ b/crates/flowistry_ide/src/plugin.rs @@ -219,7 +219,11 @@ fn postprocess(result: FlowistryResult) -> 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), }, }; @@ -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( @@ -280,7 +288,7 @@ fn run( #[derive(Debug, Serialize)] #[serde(tag = "type")] pub enum FlowistryError { - BuildError(#[serde(skip_serializing)] ErrorGuaranteed), + BuildError, AnalysisError { error: String }, FileNotFound, } @@ -321,26 +329,22 @@ impl 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 } diff --git a/crates/flowistry_ifc/Cargo.toml b/crates/flowistry_ifc/Cargo.toml index 70248d02f0..669258fc0f 100644 --- a/crates/flowistry_ifc/Cargo.toml +++ b/crates/flowistry_ifc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flowistry_ifc" -version = "0.5.42" +version = "0.5.43" edition = "2021" publish = false @@ -8,7 +8,7 @@ publish = false 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" diff --git a/crates/flowistry_ifc/src/lib.rs b/crates/flowistry_ifc/src/lib.rs index d602c29d6d..6e10143a93 100644 --- a/crates/flowistry_ifc/src/lib.rs +++ b/crates/flowistry_ifc/src/lib.rs @@ -50,7 +50,8 @@ impl RustcPlugin for IfcPlugin { compiler_args: Vec, _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(()) } } diff --git a/crates/flowistry_ifc_traits/Cargo.toml b/crates/flowistry_ifc_traits/Cargo.toml index 699322abcc..83be216dd3 100644 --- a/crates/flowistry_ifc_traits/Cargo.toml +++ b/crates/flowistry_ifc_traits/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flowistry_ifc_traits" -version = "0.5.42" +version = "0.5.43" edition = "2021" publish = false diff --git a/ide/package-lock.json b/ide/package-lock.json index 1ab3075c1c..3c631d21d2 100644 --- a/ide/package-lock.json +++ b/ide/package-lock.json @@ -1,12 +1,12 @@ { "name": "flowistry", - "version": "0.5.42", + "version": "0.5.43", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "flowistry", - "version": "0.5.42", + "version": "0.5.43", "license": "MIT", "dependencies": { "@types/ws": "^8.5.4", diff --git a/ide/package.json b/ide/package.json index 7ef052cd4f..35b19be22d 100644 --- a/ide/package.json +++ b/ide/package.json @@ -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" }, diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 02579191fb..7fc6fe8b55 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-12-01" +channel = "nightly-2024-12-15" components = ["rust-src", "rustc-dev", "llvm-tools-preview"] \ No newline at end of file