tests: ip*_properties: avoid parsing the IP over and over again#156357
tests: ip*_properties: avoid parsing the IP over and over again#156357RalfJung wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| ($s:expr) => { | ||
| Ipv6Addr::from_str($s).unwrap() | ||
| }; | ||
| } |
There was a problem hiding this comment.
For some reason someone even added a macro instead of just let-binding the result of this function call...?!?
There was a problem hiding this comment.
This was in fact let-bound before c34bcc6, when for some reason it got turned into macros that repeat the function call again and again. That commit is part of #60145. That PR says the macros make it easier to add more tests and will give better errors on panics, which might be true for the check! macro but is definitely not true for the ip! macro.
This test somehow takes 12s to execute in Miri (on CI, i.e. on a slow machine), despite not having any loop. I suspect it's caused by us for some reason re-parsing the same string again and again. Let's just not do that.