stabilise ?, attributes on stmts, deprecate Reflect #36995

Merged
merged 4 commits into from Oct 13, 2016

Conversation

@nrc
Member

nrc commented Oct 6, 2016

r? @nikomatsakis

@Manishearth

lgtm, not sure if libs/lang team folks need to sign off. r=me otherwise

- found enum `core::result::Result`) [E0308]
-```
-
-`try!` returns a `Result<T, E>`, and so the function must. But `main()` has

This comment has been minimized.

@Manishearth

Manishearth Oct 6, 2016

Member

doesn't this text apply to ? as well?

@Manishearth

Manishearth Oct 6, 2016

Member

doesn't this text apply to ? as well?

This comment has been minimized.

@est31

est31 Oct 6, 2016

Contributor

Maybe he removed it because its not accurate anymore: #36988

@est31

est31 Oct 6, 2016

Contributor

Maybe he removed it because its not accurate anymore: #36988

This comment has been minimized.

@nrc

nrc Oct 6, 2016

Member

No, annoyingly you get an error message about the Carrier trait

@nrc

nrc Oct 6, 2016

Member

No, annoyingly you get an error message about the Carrier trait

src/libcore/macros.rs
@@ -255,6 +255,9 @@ macro_rules! debug_assert_ne {
/// Helper macro for reducing boilerplate code for matching `Result` together
/// with converting downstream errors.
///
+/// Prefer using `?` syntax to `try!`. `?` is built in to the language and is
+/// more succinct than `try!`, it is the standard method for error propogation.

This comment has been minimized.

@petrochenkov

petrochenkov Oct 6, 2016

Contributor

propogation -> propagation

@petrochenkov

petrochenkov Oct 6, 2016

Contributor

propogation -> propagation

This comment has been minimized.

@frewsxcv

frewsxcv Oct 6, 2016

Member

? is built in to the language and is more succinct than try!, it is the standard method for error propogation.

These are two separate sentences and probably shouldn't be separated by a comma.

@frewsxcv

frewsxcv Oct 6, 2016

Member

? is built in to the language and is more succinct than try!, it is the standard method for error propogation.

These are two separate sentences and probably shouldn't be separated by a comma.

@msjyoo

msjyoo approved these changes Oct 6, 2016

@frewsxcv

This comment has been minimized.

Show comment
Hide comment
@frewsxcv

frewsxcv Oct 6, 2016

Member

For the sake of cross-linking, here's the link to the tracking issue: #31436

Member

frewsxcv commented Oct 6, 2016

For the sake of cross-linking, here's the link to the tracking issue: #31436

@nrc

This comment has been minimized.

Show comment
Hide comment
@nrc

nrc Oct 6, 2016

Member

Also cc #15701, #27749

Member

nrc commented Oct 6, 2016

Also cc #15701, #27749

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Oct 7, 2016

Contributor

☔️ The latest upstream changes (presumably #36945) made this pull request unmergeable. Please resolve the merge conflicts.

Contributor

bors commented Oct 7, 2016

☔️ The latest upstream changes (presumably #36945) made this pull request unmergeable. Please resolve the merge conflicts.

@nikomatsakis

This comment has been minimized.

Show comment
Hide comment
@nikomatsakis

nikomatsakis Oct 11, 2016

Contributor

This looks good to me, though I do think we ought to try and address #36988.

Contributor

nikomatsakis commented Oct 11, 2016

This looks good to me, though I do think we ought to try and address #36988.

@nikomatsakis

This comment has been minimized.

Show comment
Hide comment
Contributor

nikomatsakis commented Oct 11, 2016

@bors r+

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Oct 11, 2016

Contributor

📌 Commit adb4e2f has been approved by nikomatsakis

Contributor

bors commented Oct 11, 2016

📌 Commit adb4e2f has been approved by nikomatsakis

@bluss

This comment has been minimized.

Show comment
Hide comment
@bluss

bluss Oct 11, 2016

Contributor

What's the type inference situation? It used to be that replacing try!(x) with x? would not infer as often.

Has this been cratered to look for such issues?

Contributor

bluss commented Oct 11, 2016

What's the type inference situation? It used to be that replacing try!(x) with x? would not infer as often.

Has this been cratered to look for such issues?

@nrc

This comment has been minimized.

Show comment
Hide comment
@nrc

nrc Oct 11, 2016

Member

@bluss good point, I had mis-remembered this issue. We have indeed done a bunch of Crater runs, but to test whether ? is forwards compatible with the Carrier trait, which requires some backwards incompatibility between try! and ?. I don't think we can ever replace the implementation of try! in a backwards compatible way and that shouldn't be in this PR.

@bors: r-

Member

nrc commented Oct 11, 2016

@bluss good point, I had mis-remembered this issue. We have indeed done a bunch of Crater runs, but to test whether ? is forwards compatible with the Carrier trait, which requires some backwards incompatibility between try! and ?. I don't think we can ever replace the implementation of try! in a backwards compatible way and that shouldn't be in this PR.

@bors: r-

nrc added some commits Oct 5, 2016

Stabilise `?`
cc [`?` tracking issue](#31436)
Stabilise attributes on statements.
Note that attributes on expressions are still unstable and are behind the `stmt_expr_attributes` flag.

cc [Tracking issue](#15701)
Deprecate `Reflect`
[tracking issue](#27749)
@nrc

This comment has been minimized.

Show comment
Hide comment
Member

nrc commented Oct 11, 2016

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors Oct 11, 2016

Contributor

📌 Commit 79b5177 has been approved by @nikomatsakis

Contributor

bors commented Oct 11, 2016

📌 Commit 79b5177 has been approved by @nikomatsakis

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Oct 12, 2016

Rollup merge of #36995 - nrc:stable, r=@nikomatsakis
stabilise ?, attributes on stmts, deprecate Reflect

r? @nikomatsakis

bors added a commit that referenced this pull request Oct 12, 2016

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Oct 12, 2016

Rollup merge of #36995 - nrc:stable, r=@nikomatsakis
stabilise ?, attributes on stmts, deprecate Reflect

r? @nikomatsakis

bors added a commit that referenced this pull request Oct 12, 2016

@nikomatsakis

This comment has been minimized.

Show comment
Hide comment
@nikomatsakis

nikomatsakis Oct 12, 2016

Contributor

@nrc

I don't think we can ever replace the implementation of try! in a backwards compatible way and that shouldn't be in this PR.

argh, I missed that this change was even in the PR! good catch @bluss

Contributor

nikomatsakis commented Oct 12, 2016

@nrc

I don't think we can ever replace the implementation of try! in a backwards compatible way and that shouldn't be in this PR.

argh, I missed that this change was even in the PR! good catch @bluss

@bors bors merged commit 79b5177 into rust-lang:master Oct 13, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@nrc nrc referenced this pull request Oct 18, 2016

Merged

[beta] backports #37239

@brson brson referenced this pull request Oct 19, 2016

Merged

[beta] backports #37266

@brson brson referenced this pull request Nov 7, 2016

Merged

Add changelog for 1.13.0 #37600

dtolnay added a commit to dtolnay/erased-serde that referenced this pull request Dec 24, 2016

Update reason for not using TypeId
Reflect is no longer required as of rust-lang/rust#36995.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment