title: Why does the ? operator report the error "the trait bound NoneError: Error is not satisfied"?
body: <p>The <a href="https://doc.rust-lang.org/edition-guide/rust-2018/error-handling-and-panics/the-question-mark-operator-for-easier-error-handling.html" rel="noreferrer"><code>?</code> operator</a> at line 9 works OK, but if I use the same logic on the same type in line 19, it blows up. </p>
  
  <pre><code>use std::error::Error;
  use walkdir::WalkDir;
  
  fn main() -&gt; Result&lt;(), Box&lt;dyn Error&gt;&gt; {
      let valid_entries = WalkDir::new("/tmp")
          .into_iter()
          .flat_map(|e| e)
          .flat_map(|e| {
              let name = e.file_name().to_str()?; // &lt;-- this works
              if name.contains(".txt") {
                  Some(e)
              } else {
                  None
              }
          });
  
      for entry in valid_entries {
          println!("This file matches: {:?}", entry);
          let name_to_str = entry.file_name().to_str()?; // &lt;-- this blows up
          // ...
      }
      Ok(())
  }
  </code></pre>
  
  <p>The errors are a little cryptic for me to interpret:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0277]: the trait bound `std::option::NoneError: std::error::Error` is not satisfied
    --&gt; src/main.rs:19:53
     |
  26 |         let name_to_str = entry.file_name().to_str()?;
     |                                                     ^ the trait `std::error::Error` is not implemented for `std::option::NoneError`
     |
     = note: required because of the requirements on the impl of `std::convert::From&lt;std::option::NoneError&gt;` for `std::boxed::Box&lt;dyn std::error::Error&gt;`
     = note: required by `std::convert::From::from`
  </code></pre>
  
  <p>Why is the <code>?</code> operator blowing up while iterating <code>valid_entries</code>? </p>