Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions glib/tests/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u32>,
}

#[derive(Downgrade)]
#[allow(dead_code)]
pub enum Enum {
None,
Pair { x: Object, y: Object },
Expand All @@ -23,9 +26,11 @@ fn derive_downgrade() {
}

#[derive(Downgrade)]
#[allow(dead_code)]
pub struct TypedWrapper<T>(Object, PhantomData<T>);

#[derive(Downgrade)]
#[allow(dead_code)]
pub enum TypedEnum<T> {
This(Object, PhantomData<T>),
That(Object, PhantomData<T>),
Expand Down
6 changes: 3 additions & 3 deletions glib/tests/regex_compiletest/05-variance.stderr
Original file line number Diff line number Diff line change
@@ -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`
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ error[E0277]: `RefCell<std::string::String>` 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<imp::TestObject, ()>` to implement `Send`
note: required because it appears within the type `TestObject`
Expand Down
60 changes: 30 additions & 30 deletions glib/tests/subclass_compiletest/03-object-no-auto-send-sync.stderr
Original file line number Diff line number Diff line change
@@ -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<T: Send + Sync>(_obj: &T) {}
| ^^^^ required by this bound in `check`
--> tests/subclass_compiletest/03-object-no-auto-send-sync.rs:2:17
|
2 | fn check<T: Send + Sync>(_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<T: Send + Sync>(_obj: &T) {}
| ^^^^ required by this bound in `check`
--> tests/subclass_compiletest/03-object-no-auto-send-sync.rs:2:17
|
2 | fn check<T: Send + Sync>(_obj: &T) {}
| ^^^^ required by this bound in `check`
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ error[E0277]: `RefCell<std::string::String>` 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<imp_parent::TestParent, ()>` to implement `Send`
note: required because it appears within the type `TestParent`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<glib::gobject_ffi::GInitiallyUnowned, glib::gobject_ffi::GInitiallyUnownedClass>);
3 | pub struct InitiallyUnowned(Object<glib::gobject_ffi::GInitiallyUnowned, glib::gobject_ffi::GInitiallyUnownedClass>);
| ^^^^^^^^^^^^^^^^
= note: required for `TypedObjectRef<imp_object::TestObject, InitiallyUnowned>` to implement `Send`
note: required because it appears within the type `TestObject`
Expand All @@ -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<glib::gobject_ffi::GInitiallyUnowned, glib::gobject_ffi::GInitiallyUnownedClass>);
3 | pub struct InitiallyUnowned(Object<glib::gobject_ffi::GInitiallyUnowned, glib::gobject_ffi::GInitiallyUnownedClass>);
| ^^^^^^^^^^^^^^^^
= note: required for `TypedObjectRef<imp_object::TestObject, InitiallyUnowned>` to implement `Send`
note: required because it appears within the type `TestObject`
Expand Down
4 changes: 2 additions & 2 deletions pango/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
Loading