3 ms·
You can't use field access today, so having a const param `struct Range<T> { start: T, end: T }` isn't yet useful, but you can still get something working, alth
by estebank 5y ago
You can't use field access today, so having a const param `struct Range<T> { start: T, end: T }` isn't yet useful, but you can still get something working, although the error message is terrible:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=c77cd060bcfa4e95c439e9d48996542a https://play.rust-lang.org/?version=nightly&mode=debug&editi...
Edit: I'm honestly surprised at how usable this is already in the current state of nightly:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=f60ab9c71a5c91f709e82c13f9cf851a https://play.rust-lang.org/?version=nightly&mode=debug&editi...
- ww520 5y agoExcellent hack! This demonstrates it actually works. Just need to make it ergonomic for everyday work. That's awesome.