Skip to content

Commit

Permalink
Update nightly rustc
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Jan 16, 2024
1 parent c7cda21 commit 61cb2f7
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ env:
--package=objc2-encode
--package=objc2-proc-macros
# The current nightly Rust version. Keep this synced with `rust-toolchain.toml`
CURRENT_NIGHTLY: nightly-2023-11-22
CURRENT_NIGHTLY: nightly-2024-01-15
# Various features that we'd usually want to test with
#
# Note: The `exception` feature is not enabled here, since it requires
Expand Down
6 changes: 1 addition & 5 deletions crates/header-translator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,7 @@ fn main() -> Result<(), BoxError> {
&str = "# This section has been automatically generated by `objc2`'s `header-translator`.\n# DO NOT EDIT\n";
let mut cargo_toml = {
let path = crate_src.parent().unwrap().join("Cargo.toml");
fs::OpenOptions::new()
.read(true)
.write(true)
.append(true)
.open(path)?
fs::OpenOptions::new().read(true).append(true).open(path)?
};
// find the features section
if let Some(pos) = {
Expand Down
1 change: 1 addition & 0 deletions crates/objc2/src/__macro_helpers/declare_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use crate::mutability;
#[doc(hidden)]
#[repr(transparent)]
#[derive(Debug)]
#[allow(dead_code)]
pub struct IdReturnValue(pub(crate) *mut AnyObject);

// SAFETY: `IdReturnValue` is `#[repr(transparent)]`
Expand Down
2 changes: 1 addition & 1 deletion crates/objc2/src/rc/autorelease.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub struct AutoreleasePool<'pool> {
thread_local! {
/// We track the thread's pools to verify that object lifetimes are only
/// taken from the innermost pool.
static POOLS: RefCell<Vec<*mut c_void>> = RefCell::new(Vec::new());
static POOLS: RefCell<Vec<*mut c_void>> = const { RefCell::new(Vec::new()) };
}

impl<'pool> AutoreleasePool<'pool> {
Expand Down
1 change: 1 addition & 0 deletions crates/objc2/src/rc/id_forwarding_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use std::io;
use super::Id;
use crate::mutability::IsMutable;

#[allow(clippy::unconditional_recursion)]
impl<T: PartialEq + ?Sized> PartialEq for Id<T> {
#[inline]
fn eq(&self, other: &Self) -> bool {
Expand Down
18 changes: 12 additions & 6 deletions crates/objc2/src/rc/id_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ mod tests {
}
}

struct Iter<'a>(&'a Collection);
struct Iter<'a> {
_inner: &'a Collection,
}

impl<'a> Iterator for Iter<'a> {
type Item = &'a NSObject;
Expand All @@ -165,11 +167,13 @@ mod tests {
type IntoIter = Iter<'a>;

fn into_iter(self) -> Self::IntoIter {
Iter(self)
Iter { _inner: self }
}
}

struct IterMut<'a>(&'a mut Collection);
struct IterMut<'a> {
_inner: &'a mut Collection,
}

impl<'a> Iterator for IterMut<'a> {
type Item = &'a mut NSObject;
Expand All @@ -184,11 +188,13 @@ mod tests {
type IntoIter = IterMut<'a>;

fn into_iter(self) -> Self::IntoIter {
IterMut(self)
IterMut { _inner: self }
}
}

struct IntoIter(Id<Collection>);
struct IntoIter {
_inner: Id<Collection>,
}

impl Iterator for IntoIter {
type Item = Id<NSObject>;
Expand All @@ -202,7 +208,7 @@ mod tests {
type IntoIter = IntoIter;

fn id_into_iter(this: Id<Self>) -> Self::IntoIter {
IntoIter(this)
IntoIter { _inner: this }
}
}

Expand Down
4 changes: 3 additions & 1 deletion crates/objc2/src/runtime/declare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,9 @@ mod tests {
)]
fn test_ivar_sizing() {
#[repr(align(16))]
struct U128align16([u64; 2]);
struct U128align16 {
_inner: [u64; 2],
}

unsafe impl Encode for U128align16 {
const ENCODING: Encoding = <[u64; 2]>::ENCODING;
Expand Down
6 changes: 4 additions & 2 deletions crates/objc2/tests/macros_mainthreadmarker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ unsafe impl NSObjectProtocol for Cls {}
// `icrate::Foundation::MainThreadMarker` to ensure soundness, they will not
// do this!
#[derive(Clone, Copy)]
struct MainThreadMarker(bool);
struct MainThreadMarker {
_some_field: u32,
}

extern_methods!(
unsafe impl Cls {
Expand All @@ -68,7 +70,7 @@ extern_methods!(

#[test]
fn call() {
let mtm = MainThreadMarker(true);
let mtm = MainThreadMarker { _some_field: 0 };
let obj1 = Cls::new(mtm);

let res = Cls::method(mtm, 2, mtm);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 61cb2f7

Please sign in to comment.