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

Introduce more fine-grained borrowed locals analysis for generators #112050

Closed
wants to merge 20 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -3760,6 +3760,7 @@ dependencies = [
name = "rustc_mir_dataflow"
version = "0.0.0"
dependencies = [
"either",
"polonius-engine",
"regex",
"rustc_ast",
Expand Down
13 changes: 12 additions & 1 deletion compiler/rustc_data_structures/src/graph/implementation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

use crate::snapshot_vec::{SnapshotVec, SnapshotVecDelegate};
use rustc_index::bit_set::BitSet;
use rustc_index::Idx;
use std::fmt::Debug;

#[cfg(test)]
Expand Down Expand Up @@ -59,9 +60,19 @@ impl<N> SnapshotVecDelegate for Edge<N> {
fn reverse(_: &mut Vec<Edge<N>>, _: ()) {}
}

#[derive(Copy, Clone, PartialEq, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, Ord, PartialOrd)]
pub struct NodeIndex(pub usize);

impl Idx for NodeIndex {
fn new(idx: usize) -> Self {
NodeIndex(idx)
}

fn index(self) -> usize {
self.0
}
}

#[derive(Copy, Clone, PartialEq, Debug)]
pub struct EdgeIndex(pub usize);

Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_mir_dataflow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ rustc_middle = { path = "../rustc_middle" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_target = { path = "../rustc_target" }
rustc_span = { path = "../rustc_span" }
either = "1"
1 change: 0 additions & 1 deletion compiler/rustc_mir_dataflow/src/framework/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ where
}

/// Allows inspection of unreachable basic blocks even with `debug_assertions` enabled.
#[cfg(test)]
pub(crate) fn allow_unreachable(&mut self) {
#[cfg(debug_assertions)]
self.reachable_blocks.insert_all()
Expand Down
Loading