]> git.lizzy.rs Git - rust.git/commit
Suggest `Box::new` when appropriate
authorEsteban Küber <esteban@kuber.com.ar>
Tue, 13 Aug 2019 03:22:58 +0000 (20:22 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Tue, 13 Aug 2019 03:24:30 +0000 (20:24 -0700)
commitfb2511c3c581d811d61e6022f863a5c0e7006ae1
tree1881bbf6c5a382162cf825457a220a886e7dea6f
parent1e6f7537629b668eca7a5c2e94205552b7f8f4ad
Suggest `Box::new` when appropriate

When encountering a boxed value as expected and a stack allocated value
that could be boxed to fulfill the expectation, like in the following
snippet, suggest `Box::new` wrapping.
src/librustc/hir/map/mod.rs
src/librustc_typeck/check/demand.rs
src/librustc_typeck/check/mod.rs
src/test/ui/suggestions/suggest-box.fixed [new file with mode: 0644]
src/test/ui/suggestions/suggest-box.rs [new file with mode: 0644]
src/test/ui/suggestions/suggest-box.stderr [new file with mode: 0644]