I'm happy that this works https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=42d893e4d8b401d160ed8f94c55228e1 … but I'm still convinced that the implicit 'static when dealing with traits was an ergonomic mistake.
-
-
Replying to @ekuber
Yes I 100% agree. I'm also pretty sure it's not really documented anywhere. I learned about it from some friends on the lang team
1 reply 0 retweets 1 like -
Replying to @sgrif
The or linked earlier (and it's predecessors) aim at documenting it, as well as teaching that 'static can mean "owned", but that later point still needs a bit of work.
1 reply 0 retweets 0 likes -
I just checked and this is going to be the new outputpic.twitter.com/4gD1oeHIRc
1 reply 0 retweets 2 likes -
Replying to @ekuber
Certainly better. Now if it can just recommend a suggestion that isn't nonsense ;)
1 reply 0 retweets 0 likes -
Replying to @sgrif
Working on it. Trying things out but it'll be always a guess, because by the time we have the lifetimes we cannot tie those back to the exact part of the type.
1 reply 0 retweets 1 like -
You can get quite far with reconstructing it and infer things from context (like suggesting '_ on all dyn/impl traits) but for more complex cases we'll still have something slightly incorrect, I fear. Until we refactor the lifetime analysis to hold on to more type data for errors
1 reply 0 retweets 1 like -
Replying to @ekuber
Once the error is suggesting + '_ +'_ we should just send them to discord lol
1 reply 0 retweets 1 like -
-
\o/ It's a shame we can't disambiguate whether it needs to go on `dyn Trait` or `impl Trait` at the point where we have to render the help, but TBH since one of the suggestions is so obviously nonsense it's fine
-
-
Replying to @sgrif
I can probably still break it, but I'm happy with it:pic.twitter.com/JhtKmW5kCZ
1 reply 0 retweets 2 likes -
- 6 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.