Skip to content

Commit b4ba990

Browse files
Rollup merge of rust-lang#155140 - Vastargazing:open-options-ext-test, r=jdonszelmann,kivooeo
add regression test for OpenOptionsExt downstream compat Following up on rust-lang#153491, which added a warning comment there, but no automated guardrail to prevent another breaking change like rust-lang#149718 This adds a simple windows-only ui test that manually implements `OpenOptionsExt`. That way, if someone accidentally adds another required method to the trait, we catch it before it reaches stable and breaks downstream crates like Tokio again. Closes rust-lang#153486
2 parents 5e3d872 + f9b6718 commit b4ba990

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//@ only-windows
2+
//@ check-pass
3+
4+
// Regression test for https://github.com/rust-lang/rust/issues/153486
5+
// Ensures that `OpenOptionsExt` remains implementable by downstream crates
6+
// without requiring changes when new methods are added to the standard library.
7+
8+
use std::os::windows::fs::OpenOptionsExt;
9+
10+
struct MockOptions;
11+
12+
impl OpenOptionsExt for MockOptions {
13+
fn access_mode(&mut self, _: u32) -> &mut Self { self }
14+
fn share_mode(&mut self, _: u32) -> &mut Self { self }
15+
fn custom_flags(&mut self, _: u32) -> &mut Self { self }
16+
fn attributes(&mut self, _: u32) -> &mut Self { self }
17+
fn security_qos_flags(&mut self, _: u32) -> &mut Self { self }
18+
}
19+
20+
fn main() {}

0 commit comments

Comments
 (0)