Skip to content

Commit 51096d3

Browse files
committed
Remove deprecated function aliases
1 parent e429f0a commit 51096d3

File tree

5 files changed

+18
-47
lines changed

5 files changed

+18
-47
lines changed

crates/header-translator/src/global_analysis.rs

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::collections::{BTreeMap, BTreeSet, HashMap};
66
use std::mem;
77

88
use crate::availability::Availability;
9-
use crate::documentation::Documentation;
109
use crate::expr::Expr;
1110
use crate::id::ItemTree;
1211
use crate::method::Method;
@@ -82,8 +81,6 @@ fn update_module(
8281
ident_mapping: &HashMap<String, Expr>,
8382
expected_bridged_types: &mut BTreeMap<&str, &ItemIdentifier>,
8483
) {
85-
let mut deprecated_fns = vec![];
86-
8784
// Fix location for GetTypeId functions
8885
for stmt in module.stmts.iter_mut() {
8986
if let Stmt::FnDecl {
@@ -95,7 +92,7 @@ fn update_module(
9592
first_arg_is_self,
9693
result_type,
9794
body,
98-
safe,
95+
safe: _,
9996
must_use,
10097
abi,
10198
returns_retained,
@@ -139,35 +136,6 @@ fn update_module(
139136
)
140137
};
141138

142-
// TODO(breaking): Remove in next version
143-
if body.is_none()
144-
&& id.library_name() != "Dispatch"
145-
&& !link_name.contains("GetTypeID")
146-
{
147-
deprecated_fns.push(Stmt::FnDecl {
148-
// Emit with the actual, non-renamed name.
149-
id: id.clone().map_name(|_| c_name.clone()),
150-
c_name: c_name.clone(),
151-
link_name: link_name.clone(),
152-
availability: Availability::new_deprecated(format!(
153-
"renamed to `{}::{}`",
154-
cf_item.id().name,
155-
name,
156-
)),
157-
arguments: arguments.clone(),
158-
result_type: result_type.clone(),
159-
first_arg_is_self: *first_arg_is_self,
160-
body: *body,
161-
safe: *safe,
162-
must_use: *must_use,
163-
abi: abi.clone(),
164-
returns_retained: *returns_retained,
165-
documentation: Documentation::empty(),
166-
no_implementor: false,
167-
custom_implementor: None,
168-
});
169-
}
170-
171139
*id = id.clone().map_name(|_| name.clone());
172140

173141
if is_instance_method {
@@ -215,8 +183,6 @@ fn update_module(
215183
}
216184
}
217185

218-
module.stmts.extend(deprecated_fns);
219-
220186
// Propagate availability information of `init` to `new`.
221187
// NOTE: this only works within single files.
222188
let init_availability: BTreeMap<String, Availability> = module

crates/objc2/src/topics/FRAMEWORKS_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
3030
* Changed the value of `kUSBHostPortPropertyPortNumber`.
3131

3232
### Removed
33+
* **BREAKING**: Removed a lot of deprecated function aliases. Use the methods instead.
3334
* **BREAKING**: Removed `UIButtonConfiguration::tintedGlassButtonConfiguration`.
3435
* **BREAKING**: Removed `UIDocumentBrowserAction::imageOnlyForContextMenu` and
3536
`UIDocumentBrowserAction::setImageOnlyForContextMenu`.

framework-crates/objc2-core-foundation/src/url.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,13 @@ impl CFURL {
204204
/// Construct and inspect a `CFURL`.
205205
///
206206
/// ```
207-
/// use objc2_core_foundation::{
208-
/// CFString, CFURL, CFURLCopyHostName, CFURLCopyScheme, CFURLCopyPath,
209-
/// };
207+
/// use objc2_core_foundation::{CFString, CFURL};
210208
///
211209
/// let url = CFURL::from_string(None, &CFString::from_str("http://example.com/foo"), None).unwrap();
212210
/// assert_eq!(url.string().to_string(), "http://example.com/foo");
213-
/// assert_eq!(CFURLCopyScheme(&url).unwrap().to_string(), "http");
214-
/// assert_eq!(CFURLCopyHostName(&url).unwrap().to_string(), "example.com");
215-
/// assert_eq!(CFURLCopyPath(&url).unwrap().to_string(), "/foo");
211+
/// assert_eq!(url.scheme().unwrap().to_string(), "http");
212+
/// assert_eq!(url.host_name().unwrap().to_string(), "example.com");
213+
/// assert_eq!(url.path().unwrap().to_string(), "/foo");
216214
/// ```
217215
///
218216
/// Fail parsing certain strings.

framework-crates/objc2-core-graphics/tests/invalid.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
#![cfg(feature = "CGPDFContext")]
88
#![cfg(feature = "CGBitmapContext")]
99
#![cfg(feature = "CGImage")]
10-
#![allow(deprecated)]
1110

1211
use objc2_core_graphics::{
13-
CGBitmapContextCreate, CGBitmapInfo, CGColorConversionInfoCreate, CGColorSpace, CGContext,
14-
CGImageAlphaInfo, CGPDFContextClose,
12+
CGBitmapContextCreate, CGBitmapInfo, CGColorConversionInfo, CGColorSpace, CGContext,
13+
CGImageAlphaInfo, CGImageByteOrderInfo, CGImageComponentInfo, CGImagePixelFormatInfo,
14+
CGPDFContextClose,
1515
};
1616

1717
#[test]
@@ -21,7 +21,7 @@ fn null_context() {
2121

2222
#[test]
2323
fn null_colorspace() {
24-
assert_eq!(CGColorConversionInfoCreate(None, None), None);
24+
assert_eq!(CGColorConversionInfo::new(None, None), None);
2525
}
2626

2727
#[test]
@@ -35,7 +35,13 @@ fn non_pdf_context() {
3535
8,
3636
0,
3737
Some(&color_space),
38-
CGBitmapInfo::ByteOrder32Little.0 | CGImageAlphaInfo::NoneSkipFirst.0,
38+
CGBitmapInfo::new(
39+
CGImageAlphaInfo::NoneSkipFirst,
40+
CGImageComponentInfo::Integer,
41+
CGImageByteOrderInfo::Order32Little,
42+
CGImagePixelFormatInfo::Packed,
43+
)
44+
.0,
3945
)
4046
.unwrap()
4147
};

generated

Submodule generated updated 291 files

0 commit comments

Comments
 (0)