From f9b6718308921de62c7fcb7f22b2cd618cffb899 Mon Sep 17 00:00:00 2001 From: Vastargazing Date: Sat, 11 Apr 2026 08:25:49 +0300 Subject: [PATCH] add regression test for OpenOptionsExt downstream compat --- tests/ui/std/open-options-ext-compat.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/ui/std/open-options-ext-compat.rs diff --git a/tests/ui/std/open-options-ext-compat.rs b/tests/ui/std/open-options-ext-compat.rs new file mode 100644 index 0000000000000..783b1e0961cbb --- /dev/null +++ b/tests/ui/std/open-options-ext-compat.rs @@ -0,0 +1,20 @@ +//@ only-windows +//@ check-pass + +// Regression test for https://github.com/rust-lang/rust/issues/153486 +// Ensures that `OpenOptionsExt` remains implementable by downstream crates +// without requiring changes when new methods are added to the standard library. + +use std::os::windows::fs::OpenOptionsExt; + +struct MockOptions; + +impl OpenOptionsExt for MockOptions { + fn access_mode(&mut self, _: u32) -> &mut Self { self } + fn share_mode(&mut self, _: u32) -> &mut Self { self } + fn custom_flags(&mut self, _: u32) -> &mut Self { self } + fn attributes(&mut self, _: u32) -> &mut Self { self } + fn security_qos_flags(&mut self, _: u32) -> &mut Self { self } +} + +fn main() {}