Skip to content

Commit

Permalink
Consolidate code generation (#2544)
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr authored Jun 20, 2023
1 parent 4c88d90 commit 3267a0a
Show file tree
Hide file tree
Showing 166 changed files with 5,048 additions and 5,335 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
*.png -text
*.jpg -text
*.winmd -text
*.dll -text
*.lib -text
*.a -text
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ body:
options:
- "windows"
- "windows-sys"
- "windows-bindgen"
- "windows-metadata"
- "windows-core"
- "windows-targets"
- "other (please share in the comments)"
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,12 @@ jobs:
cargo clippy -p tool_windows &&
cargo clippy -p tool_yml &&
cargo clippy -p windows &&
cargo clippy -p windows-bindgen &&
cargo clippy -p windows-core &&
cargo clippy -p windows-implement &&
cargo clippy -p windows-interface &&
cargo clippy -p windows-metadata &&
cargo clippy -p windows-sys &&
cargo clippy -p windows-targets &&
cargo clippy -p windows-tokens &&
cargo clippy -p windows_aarch64_gnullvm &&
cargo clippy -p windows_aarch64_msvc &&
cargo clippy -p windows_i686_gnu &&
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ jobs:
cargo test -p test_enums &&
cargo test -p test_error &&
cargo test -p test_event &&
cargo test -p test_extensions &&
cargo clean &&
cargo test -p test_extensions &&
cargo test -p test_handles &&
cargo test -p test_helpers &&
cargo test -p test_implement &&
Expand Down Expand Up @@ -141,14 +141,12 @@ jobs:
cargo test -p tool_windows &&
cargo test -p tool_yml &&
cargo test -p windows &&
cargo test -p windows-bindgen &&
cargo test -p windows-core &&
cargo test -p windows-implement &&
cargo test -p windows-interface &&
cargo test -p windows-metadata &&
cargo test -p windows-sys &&
cargo test -p windows-targets &&
cargo test -p windows-tokens &&
cargo test -p windows_aarch64_gnullvm &&
cargo test -p windows_aarch64_msvc &&
cargo test -p windows_i686_gnu &&
Expand Down
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
.vscode
.vs
.windows
target
packages
obj
bin
temp
*.lock
*.user
*.filters
*.bin
*.winmd
17 changes: 0 additions & 17 deletions crates/libs/bindgen/Cargo.toml

This file was deleted.

201 changes: 0 additions & 201 deletions crates/libs/bindgen/license-apache-2.0

This file was deleted.

21 changes: 0 additions & 21 deletions crates/libs/bindgen/license-mit

This file was deleted.

2 changes: 1 addition & 1 deletion crates/libs/core/src/imp/bindings.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Bindings generated by `windows-bindgen` 0.49.0
// Bindings generated by `riddle` 0.0.1

#![allow(non_snake_case, non_upper_case_globals, non_camel_case_types, dead_code, clippy::all)]
::windows_targets::link!("kernel32.dll" "system" fn CloseHandle(hobject : HANDLE) -> BOOL);
Expand Down
2 changes: 1 addition & 1 deletion crates/libs/core/src/imp/com_bindings.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Bindings generated by `windows-bindgen` 0.49.0
// Bindings generated by `riddle` 0.0.1

#![allow(non_snake_case, non_upper_case_globals, non_camel_case_types, dead_code, clippy::all)]
#[inline]
Expand Down
1 change: 0 additions & 1 deletion crates/libs/core/src/runtime_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use super::*;

#[doc(hidden)]
pub trait RuntimeType: Type<Self> {
// TODO: hidden?
const SIGNATURE: crate::imp::ConstBuffer;
}

Expand Down
20 changes: 0 additions & 20 deletions crates/libs/core/src/type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ pub trait Type<T: TypeKind, C = <T as TypeKind>::TypeKind>: TypeKind + Sized {
/// # Safety
unsafe fn from_abi(abi: Self::Abi) -> Result<Self>;
fn from_default(default: &Self::Default) -> Result<Self>;

// TODO: this only used by ManuallyDrop
/// # Safety
unsafe fn from_abi_ref(abi: &Self::Abi) -> Option<&Self>;
}

impl<T> Type<T, ReferenceType> for T
Expand All @@ -47,14 +43,6 @@ where
}
}

unsafe fn from_abi_ref(abi: &Self::Abi) -> Option<&Self> {
if !abi.is_null() {
Some(std::mem::transmute(abi))
} else {
None
}
}

fn from_default(default: &Self::Default) -> Result<Self> {
default.as_ref().cloned().ok_or(Error::OK)
}
Expand All @@ -71,10 +59,6 @@ where
Ok(abi.assume_init())
}

unsafe fn from_abi_ref(abi: &Self::Abi) -> Option<&Self> {
Some(std::mem::transmute(abi))
}

fn from_default(default: &Self::Default) -> Result<Self> {
Ok(default.clone())
}
Expand All @@ -91,10 +75,6 @@ where
Ok(abi)
}

unsafe fn from_abi_ref(abi: &Self::Abi) -> Option<&Self> {
Some(abi)
}

fn from_default(default: &Self) -> Result<Self> {
Ok(default.clone())
}
Expand Down
13 changes: 0 additions & 13 deletions crates/libs/metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,3 @@ repository = "https://github.com/microsoft/windows-rs"
[package.metadata.docs.rs]
default-target = "x86_64-pc-windows-msvc"
targets = []

[dependencies.tokens]
package = "windows-tokens"
path = "../tokens"
version = "0.48.0"

[dependencies.syn]
version = "2.0"
features = ["full", "extra-traits"]

[dependencies.proc-macro2]
version = "1.0"
features = ["span-locations"]
Loading

0 comments on commit 3267a0a

Please sign in to comment.