Auto merge of #10181 - llogiq:test-box-default-10089, r=flip1995
add a test against #10089 This was just an oversight while doing the box default path trimming PR, so I'm adding it rather late than never. --- changelog: none
This commit is contained in:
commit
46981dca36
@ -54,4 +54,14 @@ impl Read for ImplementsDefault {
|
||||
|
||||
fn issue_9621_dyn_trait() {
|
||||
let _: Box<dyn Read> = Box::<ImplementsDefault>::default();
|
||||
issue_10089();
|
||||
}
|
||||
|
||||
fn issue_10089() {
|
||||
let _closure = || {
|
||||
#[derive(Default)]
|
||||
struct WeirdPathed;
|
||||
|
||||
let _ = Box::<WeirdPathed>::default();
|
||||
};
|
||||
}
|
||||
|
@ -54,4 +54,14 @@ impl Read for ImplementsDefault {
|
||||
|
||||
fn issue_9621_dyn_trait() {
|
||||
let _: Box<dyn Read> = Box::new(ImplementsDefault::default());
|
||||
issue_10089();
|
||||
}
|
||||
|
||||
fn issue_10089() {
|
||||
let _closure = || {
|
||||
#[derive(Default)]
|
||||
struct WeirdPathed;
|
||||
|
||||
let _ = Box::new(WeirdPathed::default());
|
||||
};
|
||||
}
|
||||
|
@ -84,5 +84,11 @@ error: `Box::new(_)` of default value
|
||||
LL | let _: Box<dyn Read> = Box::new(ImplementsDefault::default());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<ImplementsDefault>::default()`
|
||||
|
||||
error: aborting due to 14 previous errors
|
||||
error: `Box::new(_)` of default value
|
||||
--> $DIR/box_default.rs:65:17
|
||||
|
|
||||
LL | let _ = Box::new(WeirdPathed::default());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<WeirdPathed>::default()`
|
||||
|
||||
error: aborting due to 15 previous errors
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user