Open YohDeadfall opened 3 years ago
Looking at the following code:
The simplest solution might be to actually .collect()
suggestions
before it is used at
but looking closer, it seems to me that we could change get_conversion_methods
to sort()
and dedup()
before returning, which should fix every instance of this bug.
Let me try to fix it.
@rustbot claim
@estebank Could you please help provide some minimal reproduction? I tried but couldn't reproduce it minimally. Thanks!
@hi-rustin My attempt at making a repro case didn't manage to cause the duplicated suggestion. I'm guessing there might be something in the if_chain
macro that triggers this, but don't know what it might be.
@estebank I tried to combine it with if_chain and reproduce it, but it still didn't reproduce.
Crated a minimal reproduction: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=ce21df627aef988eb4d4e67e2ac7ef81
It seems that for some reason having a use
item with two identical components (foo::foo
or in the original code if_chain::if_chain
) causes this behavior.
This may be system dependent, see my comment on the PR opened to try and reproduce and fix this. comment
I'm going to see if I can reproduce locally. If I can, I could hopefully fix it. I might also fiddle around with docker and see if that allows me to generate a reproduction.
Not only can I not reproduce locally, but I can't reproduce even trying to replicate the rust playground setup through docker. sighs
It feels like rustc
is gaslighting us, doesn't it? 😩
Not exactly how I'd say it, but once you put it that way... yeah, it really does.
The fact that I tried docker shouldn't dissuade anyone else who would otherwise try it, for a few reasons. First, this is just weird enough that it might occur with docker on your computer but not on mine. Second, I'm not experienced enough to be confident I did everything right.
I'm going to yank the E-easy label. This may be easy to fix, but it's so hard to reproduce that you wouldn't even know whether you'd successfully fixed it.
I tried this code:
The code above contains an error which is correctly reported by the compiler, but it suggests the same fix twice:
Meta
rustc --version --verbose
: