Skip to content

Commit e07f6bb

Browse files
authored
The windows crate's "std" feature should enable dependent "std" features (#3666)
1 parent 99208c8 commit e07f6bb

File tree

8 files changed

+45
-6
lines changed

8 files changed

+45
-6
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ jobs:
343343
run: cargo test -p test_win32_arrays --target ${{ matrix.target }}
344344
- name: Test test_window_long
345345
run: cargo test -p test_window_long --target ${{ matrix.target }}
346+
- name: Test test_windows_std
347+
run: cargo test -p test_windows_std --target ${{ matrix.target }}
346348
- name: Test test_winrt
347349
run: cargo test -p test_winrt --target ${{ matrix.target }}
348350
- name: Test tool_bindgen
@@ -363,10 +365,10 @@ jobs:
363365
run: cargo test -p tool_test_all --target ${{ matrix.target }}
364366
- name: Test tool_workspace
365367
run: cargo test -p tool_workspace --target ${{ matrix.target }}
366-
- name: Test tool_yml
367-
run: cargo test -p tool_yml --target ${{ matrix.target }}
368368
- name: Clean
369369
run: cargo clean
370+
- name: Test tool_yml
371+
run: cargo test -p tool_yml --target ${{ matrix.target }}
370372
- name: Test windows
371373
run: cargo test -p windows --target ${{ matrix.target }}
372374
- name: Test windows-bindgen

crates/libs/collections/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ windows-strings = { workspace = true }
1717

1818
[features]
1919
default = ["std"]
20-
std = []
20+
std = ["windows-core/std"]
2121

2222
[lints]
2323
workspace = true

crates/libs/future/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ windows-result = { workspace = true }
1818

1919
[features]
2020
default = ["std"]
21-
std = []
21+
std = ["windows-core/std"]
2222

2323
[lints]
2424
workspace = true

crates/libs/numerics/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ windows-link = { workspace = true }
1414

1515
[features]
1616
default = ["std"]
17-
std = []
17+
std = ["windows-core/std"]
1818

1919
[lints]
2020
workspace = true

crates/libs/windows/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ rustdoc-args = ["--cfg", "docsrs"]
3535
[features]
3636
default = ["std"]
3737
docs = []
38-
std = ["windows-core/std"]
38+
std = ["windows-collections/std", "windows-core/std", "windows-future/std", "windows-numerics/std"]
3939
# generated features
4040
AI = ["Foundation"]
4141
AI_MachineLearning = ["AI"]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[package]
2+
name = "test_windows_std"
3+
version = "0.0.0"
4+
edition = "2021"
5+
publish = false
6+
7+
[lib]
8+
doc = false
9+
doctest = false
10+
11+
[dependencies]
12+
windows = { workspace = true, features = ["std"] }
13+
# the inclusion of "std" in `windows` should enable it for the following dependencies
14+
windows-collections = { workspace = true }
15+
windows-core = { workspace = true }
16+
windows-future = { workspace = true }
17+
windows-numerics = { workspace = true }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#[test]
2+
fn collections() {
3+
_ = windows_collections::IIterable::<i32>::from(vec![1, 2, 3]);
4+
}
5+
6+
#[test]
7+
fn core() {
8+
_ = windows_core::Event::<windows_core::IUnknown>::new();
9+
}
10+
11+
#[test]
12+
fn future() {
13+
windows_future::IAsyncAction::ready(Ok(()));
14+
}
15+
16+
#[test]
17+
fn numerics() {
18+
windows_numerics::Vector2::zero().length();
19+
}

0 commit comments

Comments
 (0)