mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
Rollup merge of #155610 - Omnikar:trait-alias-docs-fix, r=mejrs
Add missing `dyn` keyword to `trait_alias` page of the Unstable Book There seemed to be a small typo in the Rust Unstable Book page for the `trait_alias` feature, where a variable is declared as `&Bar` for a trait `Bar`, rather than `&dyn Bar`.
This commit is contained in:
@@ -26,7 +26,7 @@ pub fn main() {
|
||||
foo(&1);
|
||||
|
||||
// Use trait alias for trait objects.
|
||||
let a: &Bar = &123;
|
||||
let a: &dyn Bar = &123;
|
||||
println!("{:?}", a);
|
||||
let b = Box::new(456) as Box<dyn Foo>;
|
||||
println!("{:?}", b);
|
||||
|
||||
Reference in New Issue
Block a user