Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/gen/src/types/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Function {
let mut link = self.0.impl_map().expect("Function").scope().name();

// TODO: workaround for https://github.com/microsoft/windows-rs/issues/463
if link.contains("-ms-win-") || link == "D3DCOMPILER_47" {
if link.contains("-ms-win-") || link == "D3DCOMPILER_47" || link == "SspiCli" {
link = "onecoreuap";
}

Expand Down
6 changes: 3 additions & 3 deletions crates/macros/src/build_limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ fn use_tree_to_namespace_types(use_tree: &syn::UseTree) -> syn::parse::Result<Na
recurse(reader, &*p.tree, current)
}
syn::UseTree::Glob(g) => {
let namespace = find_namespace(reader, &current.clone(), g.span())?;
let namespace = find_namespace(reader, &current, g.span())?;
Ok(NamespaceTypes {
namespace,
limit: TypeLimit::All,
})
}
syn::UseTree::Group(g) => {
let namespace = find_namespace(reader, &current.clone(), g.span())?;
let namespace = find_namespace(reader, &current, g.span())?;

let mut types = Vec::with_capacity(g.items.len());
for tree in &g.items {
Expand All @@ -136,7 +136,7 @@ fn use_tree_to_namespace_types(use_tree: &syn::UseTree) -> syn::parse::Result<Na
})
}
syn::UseTree::Name(n) => {
let namespace = find_namespace(reader, &current.clone(), n.span())?;
let namespace = find_namespace(reader, &current, n.span())?;
let name = n.ident.to_string();
Ok(NamespaceTypes {
namespace,
Expand Down
12 changes: 8 additions & 4 deletions crates/macros/src/implement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ use squote::{format_ident, quote, Literal, TokenStream};
struct Implements(Vec<gen::ElementType>);

impl syn::parse::Parse for Implements {
fn parse(inner_type: syn::parse::ParseStream) -> syn::parse::Result<Self> {
fn parse(input: syn::parse::ParseStream) -> syn::parse::Result<Self> {
let mut types = Vec::new();
let reader = gen::TypeReader::get();

loop {
use_tree_to_types(reader, &inner_type.parse::<ImplementTree>()?, &mut types)?;

if inner_type.parse::<syn::Token!(,)>().is_err() {
if input.is_empty() {
break;
}

use_tree_to_types(reader, &input.parse::<ImplementTree>()?, &mut types)?;

if !input.is_empty() {
input.parse::<syn::Token![,]>()?;
}
}

Ok(Self(types))
Expand Down
3 changes: 1 addition & 2 deletions crates/macros/src/implement_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ pub enum ImplementTree {

pub struct ImplementPath {
pub ident: Ident,
pub colon2_token: Token![::],
pub tree: Box<ImplementTree>,
}

Expand All @@ -32,9 +31,9 @@ impl Parse for ImplementTree {
if lookahead.peek(Ident) {
let ident = input.call(Ident::parse_any)?;
if input.peek(Token![::]) {
input.parse::<syn::Token![::]>()?;
Ok(ImplementTree::Path(ImplementPath {
ident,
colon2_token: input.parse()?,
tree: Box::new(input.parse()?),
}))
} else {
Expand Down