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

Add first draft of const eval skill tree to this repo #43

Merged
merged 19 commits into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*~
book
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ which sort of is a virtual machine using `MIR` as "bytecode".

## Table of Contents

* [Unstable Feature Skill Tree](skill-tree.md)
* [Const Safety](const_safety.md)
* The three "kinds" of compile-time evaluated data:
* [Statics](static.md) (`static`, `static mut`)
Expand Down
10 changes: 10 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[book]
authors = ["Oliver Scherer"]
language = "en"
multilingual = false
src = "src"
title = "const-eval"
[preprocessor.skill-tree]
command = "mdbook-skill-tree"
[output.html]
additional-js =["viz.js", "full.render.js", "skill-tree.js"]
90 changes: 90 additions & 0 deletions full.render.js

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions skill-tree.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Loads the dot file found at `dot_path` as text and displays it.
function loadSkillTree(dot_path) {
var viz = new Viz();
fetch(dot_path)
.then(response => response.text())
.then(text => {
viz.renderSVGElement(text)
.then(element => { document.body.appendChild(element); })
});
}

function convertDivToSkillTree(divId, dotText) {
new Viz().renderSVGElement(dotText.dot_text).then(element => {
document.getElementById(divId).appendChild(element);
})
}

for (let obj of SKILL_TREES) {
convertDivToSkillTree(obj.id, obj.value);
}
5 changes: 5 additions & 0 deletions skill-tree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Skill Tree

The Skill Tree is a visual representation of the dependencies of feature gates or unimplemented
features that are needed for certain high level features. You can view it by using `mdbook serve`
to host a small local web server rendering the skill tree for you.
3 changes: 3 additions & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Summary

- [Feature Skill Tree](./skill_tree.md)
241 changes: 241 additions & 0 deletions src/skill-tree.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
[[group]]
name = "mut_ref"
label = "mutable references"
href = "https://github.com/rust-lang/rust/issues/57349"
items = []

[[group]]
name = "const_mut_ref"
label = "constants with mutable\nreferences in their final value"
href = "https://github.com/rust-lang/rust/issues/71212"
requires = ["mut_ref"]
items = []

[[group]]
name = "file_output"
label = "write to files\nfrom constants"
href = "https://github.com/rust-lang/const-eval/issues/25"
items = []

[[group]]
name = "final_heap"
label = "heap allocations\nin the final value of constants"
requires = ["heap"]
href = "https://github.com/rust-lang/const-eval/issues/20"
items = []

[[group]]
name = "heap"
label = "heap allocations"
requires = []
items = []
href = "https://github.com/rust-lang/const-eval/issues/20"

[[group]]
name = "iterators"
label = "iterators"
requires = ["mut_ref", "trait_impl"]
items = []

[[group]]
name = "for"
label = "for loops"
requires = ["trait_impl", "mut_ref"]
items = []

[[group]]
name = "slice_eq"
label = "[T]::eq"
requires = ["for", "fuzzy-ptr-comparisons", "trait_impl"]
items = []

[[group]]
name = "box_new"
label = "Box::new"
requires = ["heap", "trait_bound_opt_out", "drop"]
items = []

[[group]]
name = "ptr-is-null"
label = "<*T>::is_null"
requires = ["fuzzy-ptr-comparisons"]
items = []

[[group]]
name = "fuzzy-ptr-comparisons"
label = "guaranteed_eq and\nguaranteed_ne"
href = "https://github.com/rust-lang/rust/issues/53020"
requires = []
items = []

[[group]]
name = "unconst_rules"
label = "Need to come up\nwith a scheme\nfor doing unsafe\nin const fn"
items = [
{ label = "transmute", href = "https://github.com/rust-lang/rust/issues/53605" }
]
href = "https://github.com/rust-lang/const-eval/issues/14"

[[group]]
name = "question_mark"
label = "using ? in const"
requires = ["trait_impl"]
items = []

[[group]]
name = "mutex_new"
label = "Mutex::new"
href = "https://github.com/rust-lang/rust/issues/66806"
items = []
requires = ["final_heap", "parking_lot", "unconst_rules"]

[[group]]
name = "const_fn_in_patterns"
label = "const fn callable in patterns"
href = "https://github.com/rust-lang/rust/issues/57240"
requires = ["rfc:2920"]
items = []

[[group]]
name = "from_str"
label = "FromStr"
href = "https://github.com/rust-lang/rust/issues/59133"
requires = ["trait_impl"]
items = [
{ label = "&lt;int&gt;::from_str", port="int_parse", requires = ["iterators"] },
]

[[group]]
name = "const-float"
label = "floats in const fn"
href = "https://github.com/rust-lang/rust/issues/57241"
items = [
{ label = "from_bits" },
{ label = "to_bits" },
{ label = "general usage of float math,\narguments and return types" },
]

[[group]]
name = "const-assert-eq"
label = "assert_eq!"
requires = ["trait_impl", "panic_fmt"]
href = "https://github.com/rust-lang/rust/issues/74925"
items = []

[[group]]
name = "rfc"
items = [
{ label = "const blocks", port = "2920", href = "https://github.com/rust-lang/rfcs/pull/2920" },
]

[[group]]
label = "panic! with formatting"
name = "panic_fmt"
requires = ["format_args", "panic"]
href = "https://github.com/rust-lang/rust/issues/51999"
items = []

[[group]]
label = "feature gate\nconst_panic"
name = "panic"
href = "https://github.com/rust-lang/rust/issues/51999"
items = [
{ label = "assert!" },
]

[[group]]
label = "feature gate\nconst_discriminant"
name = "discriminant"
href = "https://github.com/rust-lang/rust/pull/69825"
items = []

[[group]]
label = "feature gate\nconst_trait_bound_opt_out"
name = "trait_bound_opt_out"
href = "https://github.com/rust-lang/rust/issues/67794"
items = []

[[group]]
label = "feature gate\nconst_trait_impl"
name = "trait_impl"
href="https://github.com/rust-lang/rust/issues/67792"
items = [
{ label = "?const trait bound opt out", href = "https://github.com/rust-lang/rust/issues/67794"}
]

[[group]]
label = "feature gate\nconst_raw_ptr_deref"
name = "raw_ptr_deref"
href="https://github.com/rust-lang/rust/issues/51911"
items = []
requires = ["unconst_rules"]

[[group]]
label = "feature gate\nconst_raw_ptr_to_usize_cast"
name = "raw_ptr_to_usize_cast"
href="https://github.com/rust-lang/rust/issues/51910"
items = []
requires = ["unconst_rules"]

[[group]]
label = "feature gate\nconst_fn_union"
name = "union"
href = "https://github.com/rust-lang/rust/issues/51909"
items = []
requires = ["unconst_rules"]

[[group]]
label = "feature gate\nconst_extern_fn"
name = "extern_const_fn"
href = "https://github.com/rust-lang/rust/issues/64926"
items = []

[[group]]
label = "const function pointers"
name = "const_fn_ptr"
href = "https://github.com/rust-lang/rust/issues/63997"
items = []
requires = ["trait_impl", "trait_bound_opt_out"]

[[group]]
label = "format!"
name = "format"
items = []
requires = ["string", "format_args"]

[[group]]
label = "format_args!"
name = "format_args"
items = []
requires = ["trait_impl", "fuzzy-ptr-comparisons"]

[[group]]
label = "String operations"
name = "string"
items = []
requires = ["vec"]

[[group]]
label = "Vec operations"
name = "vec"
items = []
requires = ["mut_ref", "heap", "trait_impl", "drop", "raw_ptr_deref"]

[[group]]
label = "Drop"
name = "drop"
items = []
requires = ["mut_ref", "trait_impl"]

[[group]]
label = "ptr::copy_nonoverlapping"
name = "copy_nonoverlapping"
items = []
requires = ["raw_ptr_deref", "mut_ref"]

[[group]]
label = "async functions\nand blocks"
name = "asnyc"
items = []
href = "https://github.com/rust-lang/rust/issues/69431"
requires = ["trait_impl"]