{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/2113","repository_url":"https://api.github.com/repos/rust-lang/rfcs","labels_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2113/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2113/comments","events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2113/events","html_url":"https://github.com/rust-lang/rfcs/pull/2113","id":250790909,"number":2113,"title":"`dyn Trait` Syntax for Trait Objects: Take 2","user":{"login":"Ixrec","id":5285357,"avatar_url":"https://avatars2.githubusercontent.com/u/5285357?v=4","gravatar_id":"","url":"https://api.github.com/users/Ixrec","html_url":"https://github.com/Ixrec","followers_url":"https://api.github.com/users/Ixrec/followers","following_url":"https://api.github.com/users/Ixrec/following{/other_user}","gists_url":"https://api.github.com/users/Ixrec/gists{/gist_id}","starred_url":"https://api.github.com/users/Ixrec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ixrec/subscriptions","organizations_url":"https://api.github.com/users/Ixrec/orgs","repos_url":"https://api.github.com/users/Ixrec/repos","events_url":"https://api.github.com/users/Ixrec/events{/privacy}","received_events_url":"https://api.github.com/users/Ixrec/received_events","type":"User","site_admin":false},"labels":[{"id":631618415,"url":"https://api.github.com/repos/rust-lang/rfcs/labels/proposed-final-comment-period","name":"proposed-final-comment-period","color":"d4c5f9","default":false},{"id":211667886,"url":"https://api.github.com/repos/rust-lang/rfcs/labels/T-lang","name":"T-lang","color":"bfd4f2","default":false}],"state":"open","locked":false,"assignee":{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars0.githubusercontent.com/u/155238?v=4","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false},"assignees":[{"login":"nikomatsakis","id":155238,"avatar_url":"https://avatars0.githubusercontent.com/u/155238?v=4","gravatar_id":"","url":"https://api.github.com/users/nikomatsakis","html_url":"https://github.com/nikomatsakis","followers_url":"https://api.github.com/users/nikomatsakis/followers","following_url":"https://api.github.com/users/nikomatsakis/following{/other_user}","gists_url":"https://api.github.com/users/nikomatsakis/gists{/gist_id}","starred_url":"https://api.github.com/users/nikomatsakis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikomatsakis/subscriptions","organizations_url":"https://api.github.com/users/nikomatsakis/orgs","repos_url":"https://api.github.com/users/nikomatsakis/repos","events_url":"https://api.github.com/users/nikomatsakis/events{/privacy}","received_events_url":"https://api.github.com/users/nikomatsakis/received_events","type":"User","site_admin":false}],"milestone":null,"comments":93,"created_at":"2017-08-16T23:41:18Z","updated_at":"2017-08-30T20:40:24Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/2113","html_url":"https://github.com/rust-lang/rfcs/pull/2113","diff_url":"https://github.com/rust-lang/rfcs/pull/2113.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/2113.patch"},"body":"Introduce a new `dyn Trait` syntax for trait objects using a contextual `dyn` keyword, and deprecate \"bare trait\" syntax for trait objects. In a future checkpoint, `dyn` will become a proper keyword and bare trait syntax will be removed.\r\n\r\n[Rendered](https://github.com/Ixrec/rfcs/blob/dyn-trait-syntax/text/0000-dyn-trait-syntax.md)\r\n\r\nThe previous RFC on this topic is: https://github.com/rust-lang/rfcs/pull/1603\r\nThe RFC that describes checkpoints is: https://github.com/rust-lang/rfcs/pull/2052"},"comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/326112390","html_url":"https://github.com/rust-lang/rfcs/pull/2113#issuecomment-326112390","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/2113","id":326112390,"user":{"login":"Ixrec","id":5285357,"avatar_url":"https://avatars2.githubusercontent.com/u/5285357?v=4","gravatar_id":"","url":"https://api.github.com/users/Ixrec","html_url":"https://github.com/Ixrec","followers_url":"https://api.github.com/users/Ixrec/followers","following_url":"https://api.github.com/users/Ixrec/following{/other_user}","gists_url":"https://api.github.com/users/Ixrec/gists{/gist_id}","starred_url":"https://api.github.com/users/Ixrec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ixrec/subscriptions","organizations_url":"https://api.github.com/users/Ixrec/orgs","repos_url":"https://api.github.com/users/Ixrec/repos","events_url":"https://api.github.com/users/Ixrec/events{/privacy}","received_events_url":"https://api.github.com/users/Ixrec/received_events","type":"User","site_admin":false},"created_at":"2017-08-30T20:40:24Z","updated_at":"2017-08-30T20:40:24Z","author_association":"NONE","body":"It sounds like there was a misconception that the motivation for epochally removing bare trait syntax was primarily to repurpose it later for some other feature. Part of the reason I wrote the RFC the way I did was to make it as clear as possible that possibly repurposing the syntax is merely an extra bonus, and **the primary motivation for epochal removal is to prevent the myriad of ways one might confuse oneself by accidentally using bare trait syntax** without even realizing it had anything to do with trait objects. Personally, the only reason I am not only okay with but enthusiastic about the churn is because it lets us delete that huge source of confusion (which is something that I believe is unique to this RFC; almost all of the other in-flight RFCs still achieve their goals even if nothing is ever fully removed). If we don't actually get rid of it, then I'm not sure the churn would be justified, because we'd likely end up with some code using `dyn` and some code not using `dyn`, and instead of preventing confusion we'll merely raise a whole new question about when the keyword \"should\" be used.\r\n\r\n**If there is a way to achieve this goal without making bare Trait syntax a hard error in a future epoch, I'd be happy to do that instead.** But I'm under the impression that's not possible, and from what I've read so far, no one in this thread has suggested a way it might be possible. Though I guess I never actually *asked* if it is, so...I don't know very much about the compiler, but it seems like reacting to `impl Trait1 for Trait2` with a straightforward and useful error like \"expected type, found trait\" and no arcane errors about Sized not being implemented would be very, very hard to do if it's still perfectly legal syntax. I can't think of a way to do it that wouldn't involve either borderline lying in our error messages, compiling the same code multiple times, or introducing a mechanism that for all intents and purposes is isomorphic to epochs except localized to the scope of a single #[allow()] attribute, all of which seem inferior to just \"doing this properly\" and actually deleting bare Trait syntax with a real epoch.\r\n\r\nTo be clear, I'm fine with making this migration very slow and gradual and possibly spanning multiple epochs. But it seems like we _eventually_ have to rip out bare Trait syntax and make it a hard error, and we have to reach some kind of agreement on that point before we can talk about exactly how slow the migration should be.\r\n\r\n-----\r\n\r\nRegarding the syntax bikeshed, I basically agree with everything @aturon just said, but yet another reason I still like `impl` and `dyn` the best is that those keywords seem to make sense for the impl Trait and trait object features in isolation, not just when the two are put side by side. In particular, I've always read impl Trait as \"a type that implements Trait\", which is basically correct for impl Trait in return position and argument position and type alias position, while \"static dispatch\" doesn't seem correct for all or maybe any of those, especially since 1) dyn Trait is a type that implements Trait and therefore could be the concrete type underlying any usage of impl Trait and 2) I don't think \"static dispatch\" is a thing per se, but merely an odd way of referring to the absence of dynamic dispatch; to me a match block seems just as \"statically dispatched\" as an impl Trait. I think @aturon is right that if there was a better option, we probably would've found it by now."}}
{"actor":{"display_login":"Ixrec"}}