Gilnaa / memoffset

offsetof for Rust
MIT License
224 stars 29 forks source link

Add tests for README file #8

Closed GuillaumeGomez closed 5 years ago

GuillaumeGomez commented 5 years ago

It allows to test code examples in the README.md file.

GuillaumeGomez commented 5 years ago

ICE on 1.19, interesting!

Gilnaa commented 5 years ago

Yeah. Who would've guessed ¯_(ツ)_/¯.

Can you somehow avoid compiling the doctests on 1.19.0?

Otherwise, I guess it's fine to bump the minimal version to 1.20.0 if it solves the ICE; this version is old enough not to matter.

GuillaumeGomez commented 5 years ago

Well, I already make a check to handle the new macro import stuff, but I'd prefer avoid making another one to avoid an ICE haha. So as you prefer.

RalfJung commented 5 years ago

@GuillaumeGomez I tried updating this PR because the example in the README actually fails these days... but even if I break that code to not be valid Rust, it doesn't complain. Do I have to do anything other than cargo test to run the README doctests?

EDIT: Ah, it's the cfg(test).

GuillaumeGomez commented 5 years ago

Yes, now it's supposed to use @cfg(doctest).