Skip to content

Commit 3ddf30c

Browse files
committed
Allow Sized bounds
There was no reason to only allow `Sized`, rustc will let us know if something is wrong.
1 parent 12362af commit 3ddf30c

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

c-bindings-gen/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,7 @@ fn writeln_trait<'a, 'b, W: std::io::Write>(w: &mut W, t: &'a syn::ItemTrait, ty
534534
writeln!(w, "\ttype {} = crate::{};", t.ident, $type_resolver.resolve_path(&tr.path, Some(&gen_types))).unwrap();
535535
for bound in bounds_iter {
536536
if let syn::TypeParamBound::Trait(t) = bound {
537-
// We only allow for `?Sized` here.
538-
if let syn::TraitBoundModifier::Maybe(_) = t.modifier {} else { panic!(); }
537+
// We only allow for `Sized` here.
539538
assert_eq!(t.path.segments.len(), 1);
540539
assert_eq!(format!("{}", t.path.segments[0].ident), "Sized");
541540
}

c-bindings-gen/src/types.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ impl<'a, 'p: 'a> GenericTypes<'a, 'p> {
354354
for bound in bounds_iter {
355355
if let syn::TypeParamBound::Trait(t) = bound {
356356
// We only allow for `?Sized` here.
357-
if let syn::TraitBoundModifier::Maybe(_) = t.modifier {} else { panic!(); }
358357
assert_eq!(t.path.segments.len(), 1);
359358
assert_eq!(format!("{}", t.path.segments[0].ident), "Sized");
360359
}

0 commit comments

Comments
 (0)