{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/49691","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/49691/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/49691/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/49691/events","html_url":"https://github.com/rust-lang/rust/issues/49691","id":311635515,"number":49691,"title":"revert stabilization of `!` and `TryFrom`","user":{"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},"labels":[{"id":203429200,"url":"https://api.github.com/repos/rust-lang/rust/labels/P-high","name":"P-high","color":"eb6420","default":false},{"id":211668100,"url":"https://api.github.com/repos/rust-lang/rust/labels/T-compiler","name":"T-compiler","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":10,"created_at":"2018-04-05T14:32:00Z","updated_at":"2018-04-13T22:13:33Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Per https://github.com/rust-lang/rust/issues/49593, we need to rollback the stabilization of `!` (and a few dependent things) from 1.26. That's sad, but hopefully only temporary -- we'll bring it back once we can fix the coercion, but we don't want to be tinkering with the core type system in a beta backport. I'm opening this P-high issue *specifically* to track the backport, not the response."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/381273283","html_url":"https://github.com/rust-lang/rust/issues/49691#issuecomment-381273283","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/49691","id":381273283,"user":{"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},"created_at":"2018-04-13T22:13:33Z","updated_at":"2018-04-13T22:13:33Z","author_association":"CONTRIBUTOR","body":"Brainstorming:\r\n\r\n- So, what happens with #49593 is:\r\n  - `Box::new(x)` has an expected type of `Box<dyn Error>` and returns a value of type `Box<?T>`\r\n  - From this, we deduce that `?T = dyn Error` would be helpful\r\n  - This in turn propagates up to the argument, so that we have `x` with a type of `!` being coerced to `dyn Error`\r\n- This \"back propagation\" from return type to argument is very useful for things like `Some(foo)` being coerced into `Option<fn()>` etc\r\n  - However, it backfires in this case\r\n\r\nSome options:\r\n\r\n- We could try and take into account the fact that we know that `?T: Sized`\r\n  - there is no clear mechanism for doing this, and I've historically been reluctant;\r\n  - among other things, we might expect `Box::new` to take unsized values in the future\r\n    - (though it might not be compatible for other reasons?)\r\n- I guess that might look like one of the following:\r\n  - look to see if this \"back propagation\" results in a type variable being unified when there is also a pending `T: Sized` predicate\r\n    - if so, disable it\r\n  - or, look to see if this \"back propagation\" results in a signature where some of the arguments are unsized\r\n    - but this seems pretty clearly forwards incompat\r\n- In general, it seems.. potentially reasonable to be avoid back-propagating `dyn Trait` types, on the premise that a more specific type is better and we can always coerce into the `dyn Trait` later\r\n\r\nI'm not sure what other options there are, but I guess that trying to disable the back-propagation in the event that it generates constraints that violate `T: Sized` seems potentially reasonable, though I don't like the side-effect that making type parameters become `T: ?Sized` would break callers. (This would be true not just for `Box::new`, of course.) The only saving grace is that maybe in the future we will come up with better coercion mechanisms that avoid this downside.\r\n\r\nI'm also a bit unclear: would we check for *any* unifications that violate `T: Sized`? What if the back-propagation is useful *sometimes* but not others?\r\n\r\n(cc @eddyb for thoughts)"}}
{"actor":{"display_login":"nikomatsakis"}}