Skip to content

Instantly share code, notes, and snippets.

View dyn-trait-syntax-draft.md
  • Feature Name: dyn-trait-syntax
  • Start Date: 2017-??-??
  • RFC PR: (leave this empty)
  • Rust Issue: (leave this empty)

Summary

Introduce a new dyn Trait syntax for trait objects using a contextual dyn keyword, and deprecate "bare trait" syntax for trait objects. In a future checkpoint, dyn will become a proper keyword and bare trait syntax will be removed.

View gist:c7bdf926c6f9ac1b42d4e298380e5258
C:\faster-sort>rustup run nightly cargo bench
Compiling libc v0.2.17
Compiling rand v0.3.14
Compiling faster-sort v0.1.0 (file:///C:/faster-sort)
warning: unused import: `std::cmp`, #[warn(unused_imports)] on by default
--> src\lib.rs:8:5
|
8 | use std::cmp;
| ^^^^^^^^
You can’t perform that action at this time.