Skip to content

Commit 0621ce0

Browse files
committed
Rename "nadri" ruleset
1 parent 95690fc commit 0621ce0

13 files changed

+16
-16
lines changed

src/analyses/compare.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,13 @@ fn compare() {
273273
let a = &Arenas::default();
274274
let compare: &[(&str, RuleSet, TestSettings, RuleSet)] = &[
275275
(
276-
"nadri",
276+
"stateless_no_temporaries",
277277
TypeBased(RuleOptions {
278278
// `ergo-formality` doesn't support the `Keep` option.
279279
mut_binding_on_inherited: MutBindingOnInheritedBehavior::Error,
280280
// `ergo-formality` doesn't support any option.
281281
ref_binding_on_inherited: RefBindingOnInheritedBehavior::ResetBindingMode,
282-
..RuleOptions::NADRI
282+
..RuleOptions::STATELESS_NO_TEMPORARIES
283283
}),
284284
Somewhat.expect(Equal).shallower(),
285285
BindingModeBased({

src/cli.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl CliState {
6060
pub fn new() -> Self {
6161
Self {
6262
history: Vec::new(),
63-
options: RuleOptions::NADRI,
63+
options: RuleOptions::STATELESS_NO_TEMPORARIES,
6464
predicate_style: PredicateStyle::from_name("SequentUserVisible").unwrap(),
6565
saved: None,
6666
}

src/rulesets/ty_based.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ impl RuleOptions {
426426
};
427427

428428
/// The default setting for the solver. A reasonable proposal.
429-
pub const NADRI: Self = RuleOptions {
429+
pub const STATELESS_NO_TEMPORARIES: Self = RuleOptions {
430430
ref_binding_on_inherited: RefBindingOnInheritedBehavior::Error,
431431
..Self::STATELESS
432432
};
@@ -515,8 +515,8 @@ pub static KNOWN_TY_BASED_BUNDLES: &[BundleDoc<RuleOptions>] = &[
515515
doc: "A proposal that tracks no hidden state; purely type-based",
516516
},
517517
BundleDoc {
518-
name: "nadri",
519-
ruleset: RuleOptions::NADRI,
518+
name: "stateless_no_temporaries",
519+
ruleset: RuleOptions::STATELESS_NO_TEMPORARIES,
520520
doc: "A reasonable proposal; like `stateless` but \
521521
forbids `ref` bindings that create temporaries",
522522
},

tests/generate_design_doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use typing_rust_patterns::*;
55
#[test]
66
fn generate_design_doc() -> anyhow::Result<()> {
77
colored::control::set_override(false);
8-
let options = RuleOptions::NADRI;
8+
let options = RuleOptions::STATELESS_NO_TEMPORARIES;
99

1010
let examples = [
1111
("[&x]: &[&T]", "`x: &T`"),

tests/snapshots/[email protected] tests/snapshots/bundle_rules@stateless_no_temporaries-Let.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
source: src/analyses/compute_rules.rs
33
info:
4-
bundle_name: nadri
4+
bundle_name: stateless_no_temporaries
55
options:
66
match_constructor_through_ref: true
77
eat_inherited_ref_alone: true

tests/snapshots/[email protected] tests/snapshots/bundle_rules@stateless_no_temporaries-SequentInMemory.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
source: src/analyses/compute_rules.rs
33
info:
4-
bundle_name: nadri
4+
bundle_name: stateless_no_temporaries
55
options:
66
match_constructor_through_ref: true
77
eat_inherited_ref_alone: true

tests/snapshots/[email protected] tests/snapshots/bundle_rules@stateless_no_temporaries-SequentUserVisible.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
source: src/analyses/compute_rules.rs
33
info:
4-
bundle_name: nadri
4+
bundle_name: stateless_no_temporaries
55
options:
66
match_constructor_through_ref: true
77
eat_inherited_ref_alone: true

tests/snapshots/[email protected] tests/snapshots/compare@stateless_no_temporaries.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
source: src/analyses/compare.rs
3-
info: nadri
3+
info: stateless_no_temporaries
44
---
55
Difference on `[&x]: &mut [&CT]`:
66
left returned: Success(x: &CT)

tests/snapshots/[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Options are:
3131
There also exist some predefined option-bundles. Activate one with `set <bundle>`
3232
- stable_rust: The behavior of current stable rust
3333
- stateless: A proposal that tracks no hidden state; purely type-based
34-
- nadri: A reasonable proposal; like `stateless` but forbids `ref` bindings that create temporaries
34+
- stateless_no_temporaries: A reasonable proposal; like `stateless` but forbids `ref` bindings that create temporaries
3535
- stateless_2021: The currently-planned version of the `stateless` ruleset for edition 2021. Not actually stateless.
3636
- eat_outer_2021: A backwards-compatible proposal by @dianne that behaves close to the 2024 stateless proposal.
3737
- rfc3627: The accepted RFC3627 behavior

tests/snapshots/[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Options are:
3131
There also exist some predefined option-bundles. Activate one with `set <bundle>`
3232
- stable_rust: The behavior of current stable rust
3333
- stateless: A proposal that tracks no hidden state; purely type-based
34-
- nadri: A reasonable proposal; like `stateless` but forbids `ref` bindings that create temporaries
34+
- stateless_no_temporaries: A reasonable proposal; like `stateless` but forbids `ref` bindings that create temporaries
3535
- stateless_2021: The currently-planned version of the `stateless` ruleset for edition 2021. Not actually stateless.
3636
- eat_outer_2021: A backwards-compatible proposal by @dianne that behaves close to the 2024 stateless proposal.
3737
- rfc3627: The accepted RFC3627 behavior

tests/snapshots/[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Options are:
3131
There also exist some predefined option-bundles. Activate one with `set <bundle>`
3232
- stable_rust: The behavior of current stable rust
3333
- stateless: A proposal that tracks no hidden state; purely type-based
34-
- nadri: A reasonable proposal; like `stateless` but forbids `ref` bindings that create temporaries
34+
- stateless_no_temporaries: A reasonable proposal; like `stateless` but forbids `ref` bindings that create temporaries
3535
- stateless_2021: The currently-planned version of the `stateless` ruleset for edition 2021. Not actually stateless.
3636
- eat_outer_2021: A backwards-compatible proposal by @dianne that behaves close to the 2024 stateless proposal.
3737
- rfc3627: The accepted RFC3627 behavior

tests/snapshots/[email protected]

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Options are:
3232
There also exist some predefined option-bundles. Activate one with `set <bundle>`
3333
- stable_rust: The behavior of current stable rust
3434
- stateless: A proposal that tracks no hidden state; purely type-based
35-
- nadri: A reasonable proposal; like `stateless` but forbids `ref` bindings that create temporaries
35+
- stateless_no_temporaries: A reasonable proposal; like `stateless` but forbids `ref` bindings that create temporaries
3636
- stateless_2021: The currently-planned version of the `stateless` ruleset for edition 2021. Not actually stateless.
3737
- eat_outer_2021: A backwards-compatible proposal by @dianne that behaves close to the 2024 stateless proposal.
3838
- rfc3627: The accepted RFC3627 behavior

web/src/components/Solver.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ export default function Solver() {
410410
const [searchParams, setSearchParams] = useSearchParams();
411411
const sp = {searchParams, setSearchParams};
412412
const [compare, setCompare] = useStateInParams(sp, 'compare', false, (x) => x == 'true');
413-
const [optionsLeft, setOptionsLeft] = useStateInParams(sp, 'opts1', RuleSetJs.from_bundle_name('nadri', 'stable'), RuleSetJs.decode, (o) => o.encode());
413+
const [optionsLeft, setOptionsLeft] = useStateInParams(sp, 'opts1', RuleSetJs.from_bundle_name('stateless_no_temporaries', 'stable'), RuleSetJs.decode, (o) => o.encode());
414414
const [optionsRight, setOptionsRight] = useStateInParams(sp, 'opts2', RuleSetJs.from_bundle_name('rfc3627', 'rfc3627'), RuleSetJs.decode, (o) => o.encode());
415415
const [inputQuery, setInputQuery] = useStateInParams(sp, 'q', "[&x]: &mut [&T]");
416416
const [mode, setMode] = useStateInParams(sp, 'mode', 'typechecker', validateIn(['typechecker', 'rules', 'compare']));

0 commit comments

Comments
 (0)