diff --git a/glib/tests/derive.rs b/glib/tests/derive.rs index 80a7a8901404..19292921da20 100644 --- a/glib/tests/derive.rs +++ b/glib/tests/derive.rs @@ -5,15 +5,18 @@ use glib::{Downgrade, Object}; #[test] fn derive_downgrade() { #[derive(Downgrade)] + #[allow(dead_code)] pub struct NewType(Object); #[derive(Downgrade)] + #[allow(dead_code)] pub struct Struct { o1: Object, o2: std::rc::Rc, } #[derive(Downgrade)] + #[allow(dead_code)] pub enum Enum { None, Pair { x: Object, y: Object }, @@ -23,9 +26,11 @@ fn derive_downgrade() { } #[derive(Downgrade)] + #[allow(dead_code)] pub struct TypedWrapper(Object, PhantomData); #[derive(Downgrade)] + #[allow(dead_code)] pub enum TypedEnum { This(Object, PhantomData), That(Object, PhantomData), diff --git a/glib/tests/regex_compiletest/05-variance.stderr b/glib/tests/regex_compiletest/05-variance.stderr index 3ee3887a2e82..d78a48956f76 100644 --- a/glib/tests/regex_compiletest/05-variance.stderr +++ b/glib/tests/regex_compiletest/05-variance.stderr @@ -1,7 +1,7 @@ error: lifetime may not live long enough - --> tests/regex_compiletest/05-variance.rs:10:5 - | -9 | fn contravariance_check<'short>(input: MatchInfo<'short>) -> MatchInfo<'static> { + --> tests/regex_compiletest/05-variance.rs:10:5 + | + 9 | fn contravariance_check<'short>(input: MatchInfo<'short>) -> MatchInfo<'static> { | ------ lifetime `'short` defined here 10 | input | ^^^^^ returning this value requires that `'short` must outlive `'static` diff --git a/glib/tests/subclass_compiletest/02-no-auto-send-sync.stderr b/glib/tests/subclass_compiletest/02-no-auto-send-sync.stderr index e6a61a6eec32..e5a45159da44 100644 --- a/glib/tests/subclass_compiletest/02-no-auto-send-sync.stderr +++ b/glib/tests/subclass_compiletest/02-no-auto-send-sync.stderr @@ -11,7 +11,7 @@ error[E0277]: `RefCell` cannot be shared between threads sa note: required because it appears within the type `imp::TestObject` --> tests/subclass_compiletest/02-no-auto-send-sync.rs:6:16 | -6 | pub struct TestObject { + 6 | pub struct TestObject { | ^^^^^^^^^^ = note: required for `TypedObjectRef` to implement `Send` note: required because it appears within the type `TestObject` diff --git a/glib/tests/subclass_compiletest/03-object-no-auto-send-sync.stderr b/glib/tests/subclass_compiletest/03-object-no-auto-send-sync.stderr index 4fc7bdc3967f..1fbd9ff9124e 100644 --- a/glib/tests/subclass_compiletest/03-object-no-auto-send-sync.stderr +++ b/glib/tests/subclass_compiletest/03-object-no-auto-send-sync.stderr @@ -1,41 +1,41 @@ error[E0277]: `*mut c_void` cannot be sent between threads safely --> tests/subclass_compiletest/03-object-no-auto-send-sync.rs:5:11 | -5 | check(&obj); - | ----- ^^^^ `*mut c_void` cannot be sent between threads safely - | | - | required by a bound introduced by this call - | - = help: the trait `Send` is not implemented for `*mut c_void` - = note: required for `TypedObjectRef<*mut c_void, ()>` to implement `Send` + 5 | check(&obj); + | ----- ^^^^ `*mut c_void` cannot be sent between threads safely + | | + | required by a bound introduced by this call + | + = help: the trait `Send` is not implemented for `*mut c_void` + = note: required for `TypedObjectRef<*mut c_void, ()>` to implement `Send` note: required because it appears within the type `Object` - --> src/object.rs - | - | pub Object, *mut std::os::raw::c_void, (), gobject_ffi::GObject, @ffi_class gobject_ffi::GObjectClass, @type_ gobject_ffi::g_object_g... - | ^^^^^^ + --> src/object.rs + | + | pub Object, *mut std::os::raw::c_void, (), gobject_ffi::GObject, @ffi_class gobject_ffi::GObjectClass, @type_ gobject_ffi::g_object_g... + | ^^^^^^ note: required by a bound in `main::check` - --> tests/subclass_compiletest/03-object-no-auto-send-sync.rs:2:17 - | -2 | fn check(_obj: &T) {} - | ^^^^ required by this bound in `check` + --> tests/subclass_compiletest/03-object-no-auto-send-sync.rs:2:17 + | + 2 | fn check(_obj: &T) {} + | ^^^^ required by this bound in `check` error[E0277]: `*mut c_void` cannot be shared between threads safely --> tests/subclass_compiletest/03-object-no-auto-send-sync.rs:5:11 | -5 | check(&obj); - | ----- ^^^^ `*mut c_void` cannot be shared between threads safely - | | - | required by a bound introduced by this call - | - = help: the trait `Sync` is not implemented for `*mut c_void` - = note: required for `TypedObjectRef<*mut c_void, ()>` to implement `Send` + 5 | check(&obj); + | ----- ^^^^ `*mut c_void` cannot be shared between threads safely + | | + | required by a bound introduced by this call + | + = help: the trait `Sync` is not implemented for `*mut c_void` + = note: required for `TypedObjectRef<*mut c_void, ()>` to implement `Send` note: required because it appears within the type `Object` - --> src/object.rs - | - | pub Object, *mut std::os::raw::c_void, (), gobject_ffi::GObject, @ffi_class gobject_ffi::GObjectClass, @type_ gobject_ffi::g_object_g... - | ^^^^^^ + --> src/object.rs + | + | pub Object, *mut std::os::raw::c_void, (), gobject_ffi::GObject, @ffi_class gobject_ffi::GObjectClass, @type_ gobject_ffi::g_object_g... + | ^^^^^^ note: required by a bound in `main::check` - --> tests/subclass_compiletest/03-object-no-auto-send-sync.rs:2:17 - | -2 | fn check(_obj: &T) {} - | ^^^^ required by this bound in `check` + --> tests/subclass_compiletest/03-object-no-auto-send-sync.rs:2:17 + | + 2 | fn check(_obj: &T) {} + | ^^^^ required by this bound in `check` diff --git a/glib/tests/subclass_compiletest/05-no-auto-send-sync-with-non-send-sync-parent.stderr b/glib/tests/subclass_compiletest/05-no-auto-send-sync-with-non-send-sync-parent.stderr index c6939eaa9552..c5814388604b 100644 --- a/glib/tests/subclass_compiletest/05-no-auto-send-sync-with-non-send-sync-parent.stderr +++ b/glib/tests/subclass_compiletest/05-no-auto-send-sync-with-non-send-sync-parent.stderr @@ -11,7 +11,7 @@ error[E0277]: `RefCell` cannot be shared between threads sa note: required because it appears within the type `imp_parent::TestParent` --> tests/subclass_compiletest/05-no-auto-send-sync-with-non-send-sync-parent.rs:6:16 | -6 | pub struct TestParent { + 6 | pub struct TestParent { | ^^^^^^^^^^ = note: required for `TypedObjectRef` to implement `Send` note: required because it appears within the type `TestParent` diff --git a/glib/tests/subclass_compiletest/06-no-auto-send-sync-with-non-send-sync-ffi-parent.stderr b/glib/tests/subclass_compiletest/06-no-auto-send-sync-with-non-send-sync-ffi-parent.stderr index 0bb1b5bb969a..5cce9e7bed50 100644 --- a/glib/tests/subclass_compiletest/06-no-auto-send-sync-with-non-send-sync-ffi-parent.stderr +++ b/glib/tests/subclass_compiletest/06-no-auto-send-sync-with-non-send-sync-ffi-parent.stderr @@ -11,7 +11,7 @@ error[E0277]: `*mut c_void` cannot be sent between threads safely note: required because it appears within the type `InitiallyUnowned` --> tests/subclass_compiletest/06-no-auto-send-sync-with-non-send-sync-ffi-parent.rs:3:16 | -3 | pub struct InitiallyUnowned(Object); + 3 | pub struct InitiallyUnowned(Object); | ^^^^^^^^^^^^^^^^ = note: required for `TypedObjectRef` to implement `Send` note: required because it appears within the type `TestObject` @@ -38,7 +38,7 @@ error[E0277]: `*mut c_void` cannot be shared between threads safely note: required because it appears within the type `InitiallyUnowned` --> tests/subclass_compiletest/06-no-auto-send-sync-with-non-send-sync-ffi-parent.rs:3:16 | -3 | pub struct InitiallyUnowned(Object); + 3 | pub struct InitiallyUnowned(Object); | ^^^^^^^^^^^^^^^^ = note: required for `TypedObjectRef` to implement `Send` note: required because it appears within the type `TestObject` diff --git a/pango/src/functions.rs b/pango/src/functions.rs index 4e2f231b8241..939a352b1105 100644 --- a/pango/src/functions.rs +++ b/pango/src/functions.rs @@ -109,7 +109,7 @@ pub fn itemize( "start_index is out of range" ); assert!( - length >= 0 && start_index.checked_add(length).unwrap() < total_length, + length >= 0 && start_index.checked_add(length).unwrap() <= total_length, "start_index + length is out of range" ); unsafe { @@ -140,7 +140,7 @@ pub fn itemize_with_base_dir( "start_index is out of range" ); assert!( - length >= 0 && start_index.checked_add(length).unwrap() < total_length, + length >= 0 && start_index.checked_add(length).unwrap() <= total_length, "start_index + length is out of range" ); unsafe {