File tree Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Expand file tree Collapse file tree 3 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -54,4 +54,14 @@ impl Read for ImplementsDefault {
5454
5555fn issue_9621_dyn_trait() {
5656 let _: Box<dyn Read> = Box::<ImplementsDefault>::default();
57+ issue_10089();
58+ }
59+
60+ fn issue_10089() {
61+ let _closure = || {
62+ #[derive(Default)]
63+ struct WeirdPathed;
64+
65+ let _ = Box::<WeirdPathed>::default();
66+ };
5767}
Original file line number Diff line number Diff line change @@ -54,4 +54,14 @@ impl Read for ImplementsDefault {
5454
5555fn issue_9621_dyn_trait ( ) {
5656 let _: Box < dyn Read > = Box :: new ( ImplementsDefault :: default ( ) ) ;
57+ issue_10089 ( ) ;
58+ }
59+
60+ fn issue_10089 ( ) {
61+ let _closure = || {
62+ #[ derive( Default ) ]
63+ struct WeirdPathed ;
64+
65+ let _ = Box :: new ( WeirdPathed :: default ( ) ) ;
66+ } ;
5767}
Original file line number Diff line number Diff line change @@ -84,5 +84,11 @@ error: `Box::new(_)` of default value
8484LL | let _: Box<dyn Read> = Box::new(ImplementsDefault::default());
8585 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<ImplementsDefault>::default()`
8686
87- error: aborting due to 14 previous errors
87+ error: `Box::new(_)` of default value
88+ --> $DIR/box_default.rs:65:17
89+ |
90+ LL | let _ = Box::new(WeirdPathed::default());
91+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<WeirdPathed>::default()`
92+
93+ error: aborting due to 15 previous errors
8894
You can’t perform that action at this time.
0 commit comments