|
1 | 1 | #![deny(deprecated, unreachable_code)]
|
2 | 2 | use core::ptr;
|
3 | 3 |
|
4 |
| -use crate::declare::IvarEncode; |
5 |
| -use crate::mutability::{Immutable, Mutable}; |
6 |
| -use crate::rc::Id; |
7 |
| -use crate::runtime::NSObject; |
8 |
| -use crate::{declare_class, extern_methods, sel, ClassType}; |
| 4 | +use objc2::declare::IvarEncode; |
| 5 | +use objc2::mutability::{Immutable, Mutable}; |
| 6 | +use objc2::rc::Id; |
| 7 | +use objc2::runtime::NSObject; |
| 8 | +use objc2::{declare_class, extern_methods, sel, ClassType}; |
9 | 9 |
|
10 | 10 | // Test that adding the `deprecated` attribute does not mean that warnings
|
11 | 11 | // when using the method internally are output.
|
@@ -478,52 +478,63 @@ declare_class!(
|
478 | 478 | }
|
479 | 479 | );
|
480 | 480 |
|
481 |
| -#[cfg(all(target_pointer_width = "64", not(feature = "catch-all")))] |
482 |
| -mod out_param { |
483 |
| - use super::*; |
484 |
| - |
485 |
| - extern_methods!( |
486 |
| - unsafe impl OutParam { |
487 |
| - #[method_id(new)] |
488 |
| - fn new() -> Id<Self>; |
489 |
| - |
490 |
| - #[method(unsupported1:)] |
491 |
| - fn unsupported1(_param: &mut Id<Self>); |
| 481 | +extern_methods!( |
| 482 | + unsafe impl OutParam { |
| 483 | + #[method_id(new)] |
| 484 | + fn new() -> Id<Self>; |
492 | 485 |
|
493 |
| - #[method(unsupported2:)] |
494 |
| - fn unsupported2(_param: Option<&mut Id<Self>>); |
| 486 | + #[method(unsupported1:)] |
| 487 | + fn unsupported1(_param: &mut Id<Self>); |
495 | 488 |
|
496 |
| - #[method(unsupported3:)] |
497 |
| - fn unsupported3(_param: &mut Option<Id<Self>>); |
| 489 | + #[method(unsupported2:)] |
| 490 | + fn unsupported2(_param: Option<&mut Id<Self>>); |
498 | 491 |
|
499 |
| - #[method(unsupported4:)] |
500 |
| - fn unsupported4(_param: Option<&mut Option<Id<Self>>>); |
501 |
| - } |
502 |
| - ); |
| 492 | + #[method(unsupported3:)] |
| 493 | + fn unsupported3(_param: &mut Option<Id<Self>>); |
503 | 494 |
|
504 |
| - #[test] |
505 |
| - #[should_panic = "`&mut Id<_>` is not supported in `declare_class!` yet"] |
506 |
| - fn out_param1() { |
507 |
| - let mut param = OutParam::new(); |
508 |
| - OutParam::unsupported1(&mut param); |
| 495 | + #[method(unsupported4:)] |
| 496 | + fn unsupported4(_param: Option<&mut Option<Id<Self>>>); |
509 | 497 | }
|
| 498 | +); |
510 | 499 |
|
511 |
| - #[test] |
512 |
| - #[should_panic = "`Option<&mut Id<_>>` is not supported in `declare_class!` yet"] |
513 |
| - fn out_param2() { |
514 |
| - OutParam::unsupported2(None); |
515 |
| - } |
| 500 | +#[test] |
| 501 | +#[should_panic = "`&mut Id<_>` is not supported in `declare_class!` yet"] |
| 502 | +#[cfg_attr( |
| 503 | + not(all(target_pointer_width = "64", not(feature = "catch-all"))), |
| 504 | + ignore = "unwinds through FFI boundary" |
| 505 | +)] |
| 506 | +fn out_param1() { |
| 507 | + let mut param = OutParam::new(); |
| 508 | + OutParam::unsupported1(&mut param); |
| 509 | +} |
516 | 510 |
|
517 |
| - #[test] |
518 |
| - #[should_panic = "`&mut Option<Id<_>>` is not supported in `declare_class!` yet"] |
519 |
| - fn out_param3() { |
520 |
| - let mut param = Some(OutParam::new()); |
521 |
| - OutParam::unsupported3(&mut param); |
522 |
| - } |
| 511 | +#[test] |
| 512 | +#[should_panic = "`Option<&mut Id<_>>` is not supported in `declare_class!` yet"] |
| 513 | +#[cfg_attr( |
| 514 | + not(all(target_pointer_width = "64", not(feature = "catch-all"))), |
| 515 | + ignore = "unwinds through FFI boundary" |
| 516 | +)] |
| 517 | +fn out_param2() { |
| 518 | + OutParam::unsupported2(None); |
| 519 | +} |
523 | 520 |
|
524 |
| - #[test] |
525 |
| - #[should_panic = "`Option<&mut Option<Id<_>>>` is not supported in `declare_class!` yet"] |
526 |
| - fn out_param4() { |
527 |
| - OutParam::unsupported4(None); |
528 |
| - } |
| 521 | +#[test] |
| 522 | +#[should_panic = "`&mut Option<Id<_>>` is not supported in `declare_class!` yet"] |
| 523 | +#[cfg_attr( |
| 524 | + not(all(target_pointer_width = "64", not(feature = "catch-all"))), |
| 525 | + ignore = "unwinds through FFI boundary" |
| 526 | +)] |
| 527 | +fn out_param3() { |
| 528 | + let mut param = Some(OutParam::new()); |
| 529 | + OutParam::unsupported3(&mut param); |
| 530 | +} |
| 531 | + |
| 532 | +#[test] |
| 533 | +#[should_panic = "`Option<&mut Option<Id<_>>>` is not supported in `declare_class!` yet"] |
| 534 | +#[cfg_attr( |
| 535 | + not(all(target_pointer_width = "64", not(feature = "catch-all"))), |
| 536 | + ignore = "unwinds through FFI boundary" |
| 537 | +)] |
| 538 | +fn out_param4() { |
| 539 | + OutParam::unsupported4(None); |
529 | 540 | }
|
0 commit comments