Skip to content

Commit

Permalink
Remove usage of specialization from rustc_borrowck
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Jun 30, 2024
1 parent 5dbbc58 commit bbe9b2d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
28 changes: 26 additions & 2 deletions compiler/rustc_borrowck/src/facts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,32 @@ trait FactCell {
fn to_string(&self, location_table: &LocationTable) -> String;
}

impl<A: Debug> FactCell for A {
default fn to_string(&self, _location_table: &LocationTable) -> String {
impl FactCell for BorrowIndex {
fn to_string(&self, _location_table: &LocationTable) -> String {
format!("{self:?}")
}
}

impl FactCell for Local {
fn to_string(&self, _location_table: &LocationTable) -> String {
format!("{self:?}")
}
}

impl FactCell for MovePathIndex {
fn to_string(&self, _location_table: &LocationTable) -> String {
format!("{self:?}")
}
}

impl FactCell for PoloniusRegionVid {
fn to_string(&self, _location_table: &LocationTable) -> String {
format!("{self:?}")
}
}

impl FactCell for RegionVid {
fn to_string(&self, _location_table: &LocationTable) -> String {
format!("{self:?}")
}
}
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#![feature(box_patterns)]
#![feature(control_flow_enum)]
#![feature(let_chains)]
#![feature(min_specialization)]
#![feature(never_type)]
#![feature(rustc_attrs)]
#![feature(rustdoc_internals)]
Expand Down

0 comments on commit bbe9b2d

Please sign in to comment.