Skip to content

Commit

Permalink
Cleanup some TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Sep 15, 2024
1 parent 9cd325f commit 32ae171
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 42 deletions.
8 changes: 1 addition & 7 deletions src/analyses/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl<'a> ComparisonState<'a> {
while let Continue(pred) = state {
*state = match ruleset {
RuleSet::BindingModeBased(conf) => {
match analyze_with_formality(a, conf, current_req) {
match typecheck_with_formality(a, conf, current_req) {
TypingResult::TypeError(TypeError::OverlyGeneral(deepening)) => {
return Some(deepening)
}
Expand Down Expand Up @@ -316,12 +316,6 @@ fn compare() {
c
}),
),
(
"rpjohnst",
TypeBased(RuleOptions::RPJOHNST),
Somewhat.expect(Equal).shallower().shallower(),
BindingModeBased(Conf::rpjohnst_2024()),
),
(
"ergo2024_nonbreaking_transition_bm_based",
BindingModeBased(Conf::rfc_3627_2024_min()),
Expand Down
1 change: 0 additions & 1 deletion src/analyses/compute_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ impl<'a> TypingRule<'a> {
cstrs
}

// TODO: deprecate `BindingMode` style
fn make_renderable(
&'a self,
a: &'a Arenas<'a>,
Expand Down
7 changes: 0 additions & 7 deletions src/rulesets/ty_based.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ pub struct RuleOptions {
/// What happens with a `mut x` binding and an inherited reference.
pub mut_binding_on_inherited: MutBindingOnInheritedBehavior,
pub always_inspect_bm: bool,
// TODO: double_ref: Last | Min
}

impl RuleOptions {
Expand Down Expand Up @@ -414,12 +413,6 @@ impl RuleOptions {
..Self::ERGO2024
};

pub const RPJOHNST: Self = RuleOptions {
// TODO: double_ref: Last | Min
allow_ref_pat_on_ref_mut: false,
..Self::STATELESS
};

pub fn get_bundle_name(self) -> Option<&'static str> {
RuleSet::TypeBased(self).get_bundle_name()
}
Expand Down
2 changes: 1 addition & 1 deletion src/solvers/bm_based.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub fn trace_with_formality<'a>(conf: Conf, req: &TypingRequest<'a>) -> String {
out
}

pub fn analyze_with_formality<'a>(
pub fn typecheck_with_formality<'a>(
a: &'a Arenas<'a>,
conf: Conf,
req: &TypingRequest<'a>,
Expand Down
6 changes: 3 additions & 3 deletions src/solvers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ pub enum TypingResult<'a> {
}

impl RuleSet {
pub fn analyze<'a>(&self, a: &'a Arenas<'a>, req: &TypingRequest<'a>) -> TypingResult<'a> {
pub fn typecheck<'a>(&self, a: &'a Arenas<'a>, req: &TypingRequest<'a>) -> TypingResult<'a> {
match *self {
RuleSet::TypeBased(options) => analyze_with_this_crate(a, options, req),
RuleSet::BindingModeBased(conf) => analyze_with_formality(a, conf, req),
RuleSet::TypeBased(options) => typecheck_with_this_crate(a, options, req),
RuleSet::BindingModeBased(conf) => typecheck_with_formality(a, conf, req),
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/solvers/ty_based.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ pub fn trace_solver<'a>(
trace
}

// TODO: rename, "analyze" isn't clear
pub fn analyze_with_this_crate<'a>(
pub fn typecheck_with_this_crate<'a>(
a: &'a Arenas<'a>,
options: RuleOptions,
req: &TypingRequest<'a>,
Expand Down
19 changes: 0 additions & 19 deletions tests/snapshots/[email protected]

This file was deleted.

2 changes: 0 additions & 2 deletions web/src/components/Solver.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,6 @@ export function CompareDisplay({optionsLeft, optionsRight}) {
</Stack>
}

// TODO: tab the options container to support bm-based Solver
// TODO: add offcanvas with predicate and rules explanations
export default function Solver() {
// Decoding function that simply checks that the value is in the given array.
function validateIn(allowed) {
Expand Down

0 comments on commit 32ae171

Please sign in to comment.