Skip to content
Permalink
Browse files

correct coercion comments

  • Loading branch information...
nikomatsakis committed Oct 2, 2019
1 parent dce20bf commit 3ae4abbaa312dce8086732fd8a4fb7f741e5e325
@@ -11,7 +11,7 @@ use std::fmt::Debug;

const TMP: u32 = 22;

// Coerce from `Box<"asdf">` to `Box<dyn Debug>`.
// Coerce from `&u32` to `*const u32`
fn raw_pointer_coercion() {
fn sync_example() -> *const u32 {
&TMP
@@ -9,7 +9,7 @@

use std::fmt::Debug;

// Coerce from `Box<"asdf">` to `Box<dyn Debug>`.
// Unsizing coercion from `Box<&'static str>` to `Box<dyn Debug>`.
fn unsize_trait_coercion() {
fn sync_example() -> Box<dyn Debug> {
Box::new("asdf")
@@ -20,7 +20,7 @@ fn unsize_trait_coercion() {
}
}

// Coerce from `Box<[u32; N]>` to `Box<[32]>`.
// Unsizing coercion from `Box<[u32; N]>` to `Box<[32]>`.
fn unsize_slice_coercion() {
fn sync_example() -> Box<[u32]> {
Box::new([0])

0 comments on commit 3ae4abb

Please sign in to comment.
You can’t perform that action at this time.