Skip to content

Commit 6ec68c9

Browse files
authored
Merge pull request #43 from rust-lang/skill-tree
Add first draft of const eval skill tree to this repo
2 parents 9924d2c + ddae98a commit 6ec68c9

File tree

10 files changed

+973
-0
lines changed

10 files changed

+973
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*~
2+
book

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ which sort of is a virtual machine using `MIR` as "bytecode".
2020

2121
## Table of Contents
2222

23+
* [Unstable Feature Skill Tree](skill-tree.md)
2324
* [Const Safety](const_safety.md)
2425
* [Static and dynamic checks](const_checks.md)
2526
* The three "kinds" of compile-time evaluated data:

book.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[book]
2+
authors = ["Oliver Scherer"]
3+
language = "en"
4+
multilingual = false
5+
src = "src"
6+
title = "const-eval"
7+
[preprocessor.skill-tree]
8+
command = "mdbook-skill-tree"
9+
[output.html]
10+
additional-js =["viz.js", "full.render.js", "skill-tree.js"]

full.render.js

Lines changed: 90 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

skill-tree.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Loads the dot file found at `dot_path` as text and displays it.
2+
function loadSkillTree(dot_path) {
3+
var viz = new Viz();
4+
fetch(dot_path)
5+
.then(response => response.text())
6+
.then(text => {
7+
viz.renderSVGElement(text)
8+
.then(element => { document.body.appendChild(element); })
9+
});
10+
}
11+
12+
function convertDivToSkillTree(divId, dotText) {
13+
new Viz().renderSVGElement(dotText.dot_text).then(element => {
14+
document.getElementById(divId).appendChild(element);
15+
})
16+
}
17+
18+
for (let obj of SKILL_TREES) {
19+
convertDivToSkillTree(obj.id, obj.value);
20+
}

skill-tree.md

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

src/SUMMARY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Summary
2+
3+
- [Feature Skill Tree](./skill_tree.md)

src/skill-tree.toml

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
[[group]]
2+
name = "mut_ref"
3+
label = "mutable references"
4+
href = "https://github.com/rust-lang/rust/issues/57349"
5+
items = []
6+
7+
[[group]]
8+
name = "const_mut_ref"
9+
label = "constants with mutable\nreferences in their final value"
10+
href = "https://github.com/rust-lang/rust/issues/71212"
11+
requires = ["mut_ref"]
12+
items = []
13+
14+
[[group]]
15+
name = "file_output"
16+
label = "write to files\nfrom constants"
17+
href = "https://github.com/rust-lang/const-eval/issues/25"
18+
items = []
19+
20+
[[group]]
21+
name = "final_heap"
22+
label = "heap allocations\nin the final value of constants"
23+
requires = ["heap"]
24+
href = "https://github.com/rust-lang/const-eval/issues/20"
25+
items = []
26+
27+
[[group]]
28+
name = "heap"
29+
label = "heap allocations"
30+
requires = []
31+
items = []
32+
href = "https://github.com/rust-lang/const-eval/issues/20"
33+
34+
[[group]]
35+
name = "iterators"
36+
label = "iterators"
37+
requires = ["mut_ref", "trait_impl"]
38+
items = []
39+
40+
[[group]]
41+
name = "for"
42+
label = "for loops"
43+
requires = ["trait_impl", "mut_ref"]
44+
items = []
45+
46+
[[group]]
47+
name = "slice_eq"
48+
label = "[T]::eq"
49+
requires = ["for", "fuzzy-ptr-comparisons", "trait_impl"]
50+
items = []
51+
52+
[[group]]
53+
name = "box_new"
54+
label = "Box::new"
55+
requires = ["heap", "trait_bound_opt_out", "drop"]
56+
items = []
57+
58+
[[group]]
59+
name = "ptr-is-null"
60+
label = "<*T>::is_null"
61+
requires = ["fuzzy-ptr-comparisons"]
62+
items = []
63+
64+
[[group]]
65+
name = "fuzzy-ptr-comparisons"
66+
label = "guaranteed_eq and\nguaranteed_ne"
67+
href = "https://github.com/rust-lang/rust/issues/53020"
68+
requires = []
69+
items = []
70+
71+
[[group]]
72+
name = "unconst_rules"
73+
label = "Need to come up\nwith a scheme\nfor doing unsafe\nin const fn"
74+
items = [
75+
{ label = "transmute", href = "https://github.com/rust-lang/rust/issues/53605" }
76+
]
77+
href = "https://github.com/rust-lang/const-eval/issues/14"
78+
79+
[[group]]
80+
name = "question_mark"
81+
label = "using ? in const"
82+
requires = ["trait_impl"]
83+
items = []
84+
85+
[[group]]
86+
name = "mutex_new"
87+
label = "Mutex::new"
88+
href = "https://github.com/rust-lang/rust/issues/66806"
89+
items = []
90+
requires = ["final_heap", "parking_lot", "unconst_rules"]
91+
92+
[[group]]
93+
name = "const_fn_in_patterns"
94+
label = "const fn callable in patterns"
95+
href = "https://github.com/rust-lang/rust/issues/57240"
96+
requires = ["rfc:2920"]
97+
items = []
98+
99+
[[group]]
100+
name = "from_str"
101+
label = "FromStr"
102+
href = "https://github.com/rust-lang/rust/issues/59133"
103+
requires = ["trait_impl"]
104+
items = [
105+
{ label = "&lt;int&gt;::from_str", port="int_parse", requires = ["iterators"] },
106+
]
107+
108+
[[group]]
109+
name = "const-float"
110+
label = "floats in const fn"
111+
href = "https://github.com/rust-lang/rust/issues/57241"
112+
items = [
113+
{ label = "from_bits" },
114+
{ label = "to_bits" },
115+
{ label = "general usage of float math,\narguments and return types" },
116+
]
117+
118+
[[group]]
119+
name = "const-assert-eq"
120+
label = "assert_eq!"
121+
requires = ["trait_impl", "panic_fmt"]
122+
href = "https://github.com/rust-lang/rust/issues/74925"
123+
items = []
124+
125+
[[group]]
126+
name = "rfc"
127+
items = [
128+
{ label = "const blocks", port = "2920", href = "https://github.com/rust-lang/rfcs/pull/2920" },
129+
]
130+
131+
[[group]]
132+
label = "panic! with formatting"
133+
name = "panic_fmt"
134+
requires = ["format_args", "panic"]
135+
href = "https://github.com/rust-lang/rust/issues/51999"
136+
items = []
137+
138+
[[group]]
139+
label = "feature gate\nconst_panic"
140+
name = "panic"
141+
href = "https://github.com/rust-lang/rust/issues/51999"
142+
items = [
143+
{ label = "assert!" },
144+
]
145+
146+
[[group]]
147+
label = "feature gate\nconst_discriminant"
148+
name = "discriminant"
149+
href = "https://github.com/rust-lang/rust/pull/69825"
150+
items = []
151+
152+
[[group]]
153+
label = "feature gate\nconst_trait_bound_opt_out"
154+
name = "trait_bound_opt_out"
155+
href = "https://github.com/rust-lang/rust/issues/67794"
156+
items = []
157+
158+
[[group]]
159+
label = "feature gate\nconst_trait_impl"
160+
name = "trait_impl"
161+
href="https://github.com/rust-lang/rust/issues/67792"
162+
items = [
163+
{ label = "?const trait bound opt out", href = "https://github.com/rust-lang/rust/issues/67794"}
164+
]
165+
166+
[[group]]
167+
label = "feature gate\nconst_raw_ptr_deref"
168+
name = "raw_ptr_deref"
169+
href="https://github.com/rust-lang/rust/issues/51911"
170+
items = []
171+
requires = ["unconst_rules"]
172+
173+
[[group]]
174+
label = "feature gate\nconst_raw_ptr_to_usize_cast"
175+
name = "raw_ptr_to_usize_cast"
176+
href="https://github.com/rust-lang/rust/issues/51910"
177+
items = []
178+
requires = ["unconst_rules"]
179+
180+
[[group]]
181+
label = "feature gate\nconst_fn_union"
182+
name = "union"
183+
href = "https://github.com/rust-lang/rust/issues/51909"
184+
items = []
185+
requires = ["unconst_rules"]
186+
187+
[[group]]
188+
label = "feature gate\nconst_extern_fn"
189+
name = "extern_const_fn"
190+
href = "https://github.com/rust-lang/rust/issues/64926"
191+
items = []
192+
193+
[[group]]
194+
label = "const function pointers"
195+
name = "const_fn_ptr"
196+
href = "https://github.com/rust-lang/rust/issues/63997"
197+
items = []
198+
requires = ["trait_impl", "trait_bound_opt_out"]
199+
200+
[[group]]
201+
label = "format!"
202+
name = "format"
203+
items = []
204+
requires = ["string", "format_args"]
205+
206+
[[group]]
207+
label = "format_args!"
208+
name = "format_args"
209+
items = []
210+
requires = ["trait_impl", "fuzzy-ptr-comparisons"]
211+
212+
[[group]]
213+
label = "String operations"
214+
name = "string"
215+
items = []
216+
requires = ["vec"]
217+
218+
[[group]]
219+
label = "Vec operations"
220+
name = "vec"
221+
items = []
222+
requires = ["mut_ref", "heap", "trait_impl", "drop", "raw_ptr_deref"]
223+
224+
[[group]]
225+
label = "Drop"
226+
name = "drop"
227+
items = []
228+
requires = ["mut_ref", "trait_impl"]
229+
230+
[[group]]
231+
label = "ptr::copy_nonoverlapping"
232+
name = "copy_nonoverlapping"
233+
items = []
234+
requires = ["raw_ptr_deref", "mut_ref"]
235+
236+
[[group]]
237+
label = "async functions\nand blocks"
238+
name = "asnyc"
239+
items = []
240+
href = "https://github.com/rust-lang/rust/issues/69431"
241+
requires = ["trait_impl"]

0 commit comments

Comments
 (0)