Skip to content

dd: Fix "warning: trait objects without an explicit `dyn` are deprecated"

Alex DeLorenzo requested to merge alexdelorenzo/coreutils:patch-1 into master

When building coreutils, the following warnings will be emitted:

warning: trait objects without an explicit `dyn` are deprecated                                                              
  --> src/bin/dd.rs:85:24                                                                                                    
   |                                                                                                                         
85 |     let mut input: Box<Read> = match parser.found("if") {                                                               
   |                        ^^^^ help: use `dyn`: `dyn Read`                                                                 
   |                                                                                                                         
   = note: `#[warn(bare_trait_objects)]` on by default                                                                       
                                                                                                                             
warning: trait objects without an explicit `dyn` are deprecated                                                              
  --> src/bin/dd.rs:97:25                                                                                                    
   |                                                                                                                         
97 |     let mut output: Box<Write> = match parser.found("of") {                                                             
   |                         ^^^^^ help: use `dyn`: `dyn Write`                                                              
                                                                                                                             
warning: 2 warnings emitted

This PR adds explicit dyn keywords before trait objects.

Merge request reports