diff --git a/.github/workflows/deploy_mdbook.yml b/.github/workflows/deploy_mdbook.yml index 709bd8c..0ce8db3 100644 --- a/.github/workflows/deploy_mdbook.yml +++ b/.github/workflows/deploy_mdbook.yml @@ -9,6 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Install mdbook-skill-tree + run: cargo install --git https://github.com/nikomatsakis/skill-tree.git mdbook-skill-tree + continue-on-error: true # we don't care if this is already cached + + - name: Install skill tree files + run: mdbook-skill-tree install - uses: XAMPPRocky/deploy-mdbook@v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/SUMMARY.md b/SUMMARY.md index 4651dce..0f1d0a3 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -4,6 +4,7 @@ - [📜 Charter](./CHARTER.md) - [🔮 The vision](./vision.md) - [🙋‍♀️ Cast of characters](./vision/characters.md) + - [🔀 Skill Tree](./skill-tree.md) - [😱 Status quo](./vision/status_quo.md) - [Array defaults](./vision/status_quo/array_default.md) - [Array split first method](./vision/status_quo/split_first.md) diff --git a/book.toml b/book.toml index 58801e8..5b59269 100644 --- a/book.toml +++ b/book.toml @@ -5,6 +5,11 @@ multilingual = false src = "." title = "Const Generics Project Group" +[preprocessor.skill-tree] +command = "mdbook-skill-tree" + [output.html] -no-section-label=true -git-repository-url="https://github.com/rust-lang/project-const-generics" +no-section-label = true +git-repository-url = "https://github.com/rust-lang/project-const-generics" +additional-js = ["viz.js", "panzoom.min.js", "full.render.js", "skill-tree.js"] +additional-css = ["skill-tree.css", "skill-tree-finetuning.css"] diff --git a/skill-tree-finetuning.css b/skill-tree-finetuning.css new file mode 100644 index 0000000..db3ee40 --- /dev/null +++ b/skill-tree-finetuning.css @@ -0,0 +1,3 @@ +:root { + --content-max-width: 2000px; +} diff --git a/skill-tree.md b/skill-tree.md new file mode 100644 index 0000000..68cdc33 --- /dev/null +++ b/skill-tree.md @@ -0,0 +1,91 @@ +# Skill tree for const generics features + +```skill-tree +[[group]] +name = "min_cg" +label = "MIN CONST GENERICS" +description = ["Minimum subset of const generics only allowing `const N: {integer} | bool | char` and fully concrete constants"] +href = "https://github.com/rust-lang/rust/pull/79135" +items = [] + +[[group]] +name = "valtree" +label = "VALTREES" +description = ["Use valtrees in all type level constants"] +items = [ + { label = "Design of structural equality is worked out" }, + { label = "Valtrees are implemented" }, +] + +[[group]] +name = "min_defaults" +label = "CONCRETE CONST DEFAULTS" +description = ["Permit concrete defaults on traits/adts"] +items = [] +requires = ["min_cg"] + +[[group]] +name = "generic_defaults" +label = "GENERIC CONST DEFAULTS" +description = ["Permit generic defaults on traits/adts"] +items = [ + { label = "Disallow usage of forward declared params via param env" }, + { label = "Decide when a generic default is considered well formed" }, +] +requires = ["min_defaults"] + +[[group]] +name = "param_tys" +label = "MORE CONST PARAM TYPES" +description = ["Permit more types to be as the type of a const generic"] +items = [ + { label = "A `Constable` that that signifies a type is valid to use as a const param type" }, + { label = "Generic const param types i.e. `T: Constable, const N: T`" }, + { label = "Consider `impl<const N: usize> Trait<{ Some(N) }> for ()` to constrain `N`" }, +] +requires = ["valtree", "min_cg"] + +[[group]] +name = "exhaustiveness" +label = "IMPL EXHAUSTIVENESS" +description = ["Allow separate impls to be used to fulfill `for<const N: usize> (): Trait<N>`"] +items = [] +requires = ["param_tys"] + +[[group]] +name = "min_generic_consts" +label = "MIN GENERIC CONSTANTS" +description = ["Allow type level constants to be generic i.e. `N + 1`"] +items = [ + { label = "Add a where clause that requires a given expression to be evaluatable e.g. `where evaluatable { N - 1 }`" }, + { label = "Unused substs make it hard to tell if a const is concrete or generic and breaks unsize coercion in some cases" }, + { label = "Don't eagerly error when evaluating constants during selection" }, +] +requires = ["min_cg"] + +[[group]] +name = "generic_consts" +label = "GENERIC CONSTANTS" +description = ["Allow type level constants but better ✨"] +items = [ + { label = "Allow writing a where clause that requires a condition to hold e.g. `where { N > 2 }`" }, + { label = "Some things can always evaluate and should not need a where clause e.g. `{ N == M }` `{ N / 1 }`" }, + { label = "If possible `where { N > 0 }` should imply `N - 1` is evaluatable" }, +] +requires = ["min_generic_consts"] + +[[group]] +name = "assoc_const_bounds" +label = "ASSOCIATED CONST BOUNDS" +description = ["Permit where `where T: Trait<ASSOC = 10>`"] +items = [] +requires = ["min_generic_consts"] + +[[group]] +name = "arg_infer" +label = "GENERIC ARG CONST INFER" +description = ["Permit using `_` for generic args"] +href = "https://github.com/rust-lang/rust/pull/83484" +items = [] +requires = ["min_cg"] +```