Commit Graph

13 Commits

Author SHA1 Message Date
Chayim Refael Friedman
592844cf88 Warn on unused offset_of!() result 2023-06-21 11:43:14 +03:00
Lukas Markeffsky
b6a3f126c0 change std::marker::Sized to just Sized 2023-06-15 12:01:38 +02:00
est31
1b90f5efaf Support float-like tuple indices in offset_of!()
The tokenizer gives us whole float literal tokens, we have to split them up
in order to be able to create field access from them.
2023-06-08 23:42:58 +02:00
clubby789
d722f27684 Test invalid tuple field identifiers 2023-06-02 01:33:09 +00:00
clubby789
731601ccd1 Check tuple elements are Sized in offset_of 2023-06-02 01:18:59 +00:00
clubby789
6c18d1ecef offset_of: Don't require type to be sized 2023-05-29 21:56:10 +00:00
Lukas Markeffsky
7cdb23b98a don't skip inference for type in offset_of! 2023-05-20 15:20:27 +02:00
est31
30c0e4e72b Add more tests for the offset_of!() macro
* ensuring that offset_of!(Self, ...) works iff inside an impl block
* ensuring that the output type is usize and doesn't coerce. this can be
  changed in the future, but if it is done, it should be a conscious descision
* improving the privacy checking test
* ensuring that generics don't let you escape the unsized check
2023-05-18 13:16:17 +02:00
clubby789
35cf5726e3 Erase regions of type in offset_of! 2023-05-16 21:36:42 +00:00
est31
83b4df4e61 Add feature gate 2023-05-05 21:44:48 +02:00
est31
5eb29c7f49 Migrate offset_of from a macro to builtin # syntax 2023-05-05 21:44:13 +02:00
DrMeepster
a642563d49 major test improvements 2023-04-21 02:45:48 -07:00
DrMeepster
511e457c4b offset_of 2023-04-21 02:14:02 -07:00