Главная
Study mode:
on
1
Intro
2
Why const eval?
3
Grading constant evaluators
4
Why restrict ourselves?
5
What restrictions do we want?
6
What unnecessary restrictions do we have?
7
Open RFC
8
Details, details, details ...
9
Heap allocations...
10
Heap problems
11
Example with String
12
impl Send for &Sync
13
Unsafe in constants
14
compile time undefined behavior
15
Not UB
16
Much stricter rules at compile-time
17
Less stricter rules at compile-time
18
Summary
19
Don't try this at home
20
Const assertions on stable rust
21
Fibonacci at compile-time
22
Spot the fib
Description:
Explore the intricacies of constant evaluation in Rust with this RustConf 2019 talk by Oliver Schneider. Delve into the new theoretically unrestricted constant evaluator in rustc, nicknamed Miri (MIR interpreter), and discover its potential for complex static initializations, microcontroller programming, and runtime code reduction. Learn about the grading of constant evaluators, necessary and unnecessary restrictions, and the challenges of heap allocations. Examine practical examples, including String implementations and unsafe operations in constants, while understanding the stricter rules applied at compile-time. Gain insights into compile-time undefined behavior, const assertions on stable Rust, and even witness a Fibonacci sequence calculated at compile-time. Perfect for Rust developers seeking to push the boundaries of constant evaluation and optimize their code.

Taking Constant Evaluation to the Limit - RustConf 2019

Rust
Add to list
0:00 / 0:00