Skip to content

Commit

Permalink
Merge pull request #436 from madsmtm/update-nightly
Browse files Browse the repository at this point in the history
Update dependencies and nightly CI version
  • Loading branch information
madsmtm authored Apr 14, 2023
2 parents 0365ef4 + 40614ac commit 72288fb
Show file tree
Hide file tree
Showing 68 changed files with 663 additions and 711 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ env:
--package=objc2-encode
--package=objc2-proc-macros
# The current nightly Rust version that our CI uses
CURRENT_NIGHTLY: nightly-2023-02-07
CURRENT_NIGHTLY: nightly-2023-04-12
# Various features that we'd usually want to test with
#
# Note: The `exception` feature is not enabled here, since it requires
Expand Down
108 changes: 50 additions & 58 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions crates/header-translator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ license = "Zlib OR Apache-2.0 OR MIT"
[dependencies]
clang = { version = "2.0", features = ["runtime", "clang_10_0"] }
clang-sys = { version = "1.4.0" }
toml = "0.5.9"
basic-toml = "0.1.2"
serde = { version = "1.0.144", features = ["derive"] }
apple-sdk = { version = "0.4.0", default-features = false }
tracing = { version = "0.1.37", default-features = false, features = ["std"] }
tracing-subscriber = { version = "0.3.16", features = ["fmt"] }
tracing-tree = { git = "https://github.com/madsmtm/tracing-tree.git" }
proc-macro2 = "1.0.49"
syn = { version = "1.0", features = ["parsing"] }
syn = { version = "2.0", features = ["parsing"] }
heck = "0.4"
semver = { version = "1.0", features = ["serde"] }
2 changes: 1 addition & 1 deletion crates/header-translator/src/bin/check_icrate_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let crates_dir = manifest_dir.parent().unwrap();
let cargo_toml = fs::read_to_string(crates_dir.join("icrate").join("Cargo.toml"))?;

let CargoToml { features } = toml::from_str(&cargo_toml)?;
let CargoToml { features } = basic_toml::from_str(&cargo_toml)?;

println!("Testing all Foundation features in `icrate`");

Expand Down
6 changes: 3 additions & 3 deletions crates/header-translator/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::{HashMap, HashSet};
use std::error::Error;
use std::fs;
use std::io::Result;
use std::path::Path;

use serde::Deserialize;
Expand Down Expand Up @@ -206,10 +206,10 @@ impl Default for MethodData {
}

impl Config {
pub fn from_file(file: &Path) -> Result<Self> {
pub fn from_file(file: &Path) -> Result<Self, Box<dyn Error>> {
let s = fs::read_to_string(file)?;

let mut this = toml::from_str(&s)?;
let mut this = basic_toml::from_str(&s)?;

data::apply_tweaks(&mut this);

Expand Down
8 changes: 3 additions & 5 deletions crates/header-translator/src/rust_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,9 @@ enum Inner {
}

impl Inner {
fn parse(ty: Type<'_>, mut lifetime: Lifetime, context: &Context<'_>) -> Self {
let _span = debug_span!("ty", ?ty, ?lifetime).entered();
fn parse(attributed_ty: Type<'_>, mut lifetime: Lifetime, context: &Context<'_>) -> Self {
let _span = debug_span!("ty", ?attributed_ty, ?lifetime).entered();

let attributed_ty = ty;
let mut ty = attributed_ty;
while let TypeKind::Attributed = ty.get_kind() {
ty = ty
Expand Down Expand Up @@ -729,9 +728,8 @@ impl Inner {
drop(parser);

let pointer_name = ty.get_display_name();
let ty = ty.get_pointee_type().expect("pointer type to have pointee");
let attributed_ty = ty.get_pointee_type().expect("pointer type to have pointee");

let attributed_ty = ty;
let mut ty = attributed_ty;
while let TypeKind::Attributed = ty.get_kind() {
ty = ty
Expand Down
3 changes: 2 additions & 1 deletion crates/icrate/src/Foundation/additions/enumerator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ impl<'a, C: NSFastEnumeration2 + ?Sized> Iterator for NSFastEnumerator2<'a, C> {
None
} else {
unsafe {
let obj = *self.ptr;
// TODO
let obj = self.ptr.read_unaligned();
self.ptr = self.ptr.offset(1);
Some(obj.as_ref().unwrap_unchecked())
}
Expand Down
Loading

0 comments on commit 72288fb

Please sign in to comment.