Skip to content

serde: enable no-std support#296

Merged
KodrAus merged 2 commits intobitflags:mainfrom
nim65s:main
Jan 31, 2023
Merged

serde: enable no-std support#296
KodrAus merged 2 commits intobitflags:mainfrom
nim65s:main

Conversation

@nim65s
Copy link
Copy Markdown
Contributor

@nim65s nim65s commented Jan 26, 2023

Hi,

This PR enable no-std support on serde, ref. https://serde.rs/no-std.html

Otherwise, trying to compile a project with bitflags 2.0.0-rc.1 -F serde on --target=thumbv7m-none-eabi currently hangs with a huge number of eg.

error[E0432]: unresolved imports `self::core::cmp`, `self::core::iter`, `self::core::mem`, `self::core::num`, `self::core::ptr`, `self::core::slice`, `self::core::str`
   --> /home/nim/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.152/src/lib.rs:167:26

Copy link
Copy Markdown
Member

@KodrAus KodrAus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nim65s! I don't think we need the derive feature here since we only derive serde traits in tests.

Co-authored-by: Ashley Mannix <kodraus@hey.com>
Copy link
Copy Markdown
Member

@KodrAus KodrAus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nim65s! This is a great catch 👍

@KodrAus KodrAus merged commit 3cd7a61 into bitflags:main Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants