Uh oh!
There was an error while loading. Please reload this page.
(RFC) remove the Times trait in favour of range - #8371
Conversation
graydon
commented
Aug 7, 2013
I don't see how to special case the for loop syntax. It has to decide whether to parse the tokens after "for" as pattern or expr. How should it choose? |
thestinger
commented
Aug 7, 2013
That's true, it's not as simple as I expected due to the need to avoid boundless lookahead. I guess that's the cost of putting the pattern first. Whether or not we can make a short form, I still think we should be using |
bstrie
commented
Aug 7, 2013
I've already registered my arguments against this in the comments on #8326. To reiterate the most important points:
Even before external iterators we'd had the ability to do
To repeat, I'm fine with removing all uses of |
brson
commented
Aug 7, 2013
This is a tough call for me. My gut tells me to not like With If we do keep it, then I think it should stay in the prelude - as a convenience method it's much less convenient to require an import. |
thestinger
commented
Aug 8, 2013
I find it less convenient, because you have no An alternative is |
brson
commented
Aug 8, 2013
I doubt that I've ever tried to break out of or return from |
thestinger
commented
Aug 18, 2013
The Every single function/method/trait/type in the library is a burden, because it makes the language more complex. I don't think |
It's not possible to break from `times` and it results in the restrictions coming from closures. Using `for _ in range(0, n)` from the start is simpler, rather than switching to it after hitting either of these issues.
brson
commented
Aug 18, 2013
I want to solicit other opinions. |
brson
commented
Aug 18, 2013
Can |
thestinger
commented
Aug 19, 2013
If we made a trait for unsigned integers, it could be implemented from that. |
glaebhoerl
commented
Aug 19, 2013
What about dropping the trait and just having |
catamorphism
commented
Sep 12, 2013
Closing due to lack of activity. Feel free to open a new pull request if consensus gets reached on this! |
8371: Don't use HirDisplayWrapper when displaying SourceCode r=matklad a=Veykril The issue was basically that when displaying for `DisplayTarget::SourceCode` some `hir_fmt` functions would create `HirDisplayWrapper`s which would then `fmt` these triggering the Display panic since `fmt::Display` can't fail the same way as `HirDisplay`. Simple fix is to just use `hir_fmt` directly. Should probably write that down somewhere in source, looking for a good spot to put that right now. Fixesrust-lang#8077, Fixesrust-lang#8370 Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
It's not possible to break from
timesand it results in therestrictions coming from closures. Using
for _ in range(0, n)from thestart is simpler, rather than switching to it after hitting either of
these issues.