Skip to content

Regression in nightly-2020-09-23: "missing as_flags in implementation" of OpenOptionsExt #77089

Description

@dtolnay

The following code compiles fine with nightly-2020-09-22 (and stable rustc since 1.10.0) but not nightly-2020-09-23.

use std::os::unix::fs::OpenOptionsExt;

struct MyOpenOptions;

impl OpenOptionsExt for MyOpenOptions {
    fn mode(&mut self, _mode: u32) -> &mut Self {
        unimplemented!()
    }

    fn custom_flags(&mut self, _flags: i32) -> &mut Self {
        unimplemented!()
    }
}
error[E0046]: not all trait items implemented, missing: `as_flags`
 --> src/lib.rs:5:1
  |
5 | impl OpenOptionsExt for MyOpenOptions {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `as_flags` in implementation
  |
  = help: implement the missing item: `fn as_flags(&self) -> std::result::Result<i32, std::io::Error> { todo!() }`

This is minimized from https://github.com/async-rs/async-std/blob/e8126633a89aafea23259eb9faddb70b89f94423/src/fs/open_options.rs#L303-L313.

Mentioning #76110, #76801, @FedericoPonzi, @joshtriplett.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions