-
Notifications
You must be signed in to change notification settings - Fork 743
Fix macos expectations #2176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix macos expectations #2176
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4129,7 +4129,7 @@ impl CodeGenerator for ObjCInterface { | |
.collect(); | ||
|
||
quote! { | ||
pub trait #trait_name <#(#template_names),*> : #trait_constraints { | ||
pub trait #trait_name <#(#template_names:'static),*> : #trait_constraints { | ||
#( #impl_items )* | ||
} | ||
} | ||
|
@@ -4145,7 +4145,7 @@ impl CodeGenerator for ObjCInterface { | |
if !self.is_category() && !self.is_protocol() { | ||
let struct_block = quote! { | ||
#[repr(transparent)] | ||
#[derive(Clone)] | ||
#[derive(Debug, Copy, Clone)] | ||
pub struct #class_name(pub id); | ||
impl std::ops::Deref for #class_name { | ||
type Target = objc::runtime::Object; | ||
|
@@ -4159,7 +4159,7 @@ impl CodeGenerator for ObjCInterface { | |
impl #class_name { | ||
pub fn alloc() -> Self { | ||
Self(unsafe { | ||
msg_send!(objc::class!(#class_name), alloc) | ||
msg_send!(class!(#class_name), alloc) | ||
}) | ||
} | ||
} | ||
|
@@ -4381,7 +4381,7 @@ pub mod utils { | |
} | ||
} else { | ||
quote! { | ||
use objc; | ||
use objc::{self, msg_send, sel, sel_impl, class}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we worried about namespace pollution in the generated code with generic names like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will admit that I don't know if Before rust edition 2018 (if I recall the history), things like: #[macro_use] extern crate objc; were required for all external crates and imported all macros from that crate via the One unfortunate part of this is that macros use macros but the macros don't import the macros from the crates they use that I know of and not from the crates they live in (for the objc crate anyway). Anyway, I bring this up because I find the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that deprecation is out of scope for this PR. I am pretty weak on the edition differences and macro scoping rules, but after your explanation I think the namespace collision problem is not worse than it was. Thanks. |
||
} | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ authors = [ | |
"Emilio Cobos Álvarez <[email protected]>", | ||
"The Servo project developers", | ||
] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
objc = "0.2" | ||
|
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I mostly just was putting the "links" section at the end of that unreleased release section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right. Rendered, the markdown would not show anything under Security. My mistake.