Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct parsing of the precedence of + #19298

Conversation

nikomatsakis
Copy link
Contributor

Implements RFC 438.

Fixes #19092.

This is a [breaking-change]: change types like &Foo+Send or &'a mut Foo+'a to &(Foo+Send) and &'a mut (Foo+'a), respectively.

r? @brson

@nikomatsakis nikomatsakis force-pushed the unboxed-closure-parse-the-plus branch from 19507fd to b219bd5 Compare November 26, 2014 19:15
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Nov 27, 2014
…he-plus

Implements RFC 438.

Fixes rust-lang#19092.

This is a [breaking-change]: change types like `&Foo+Send` or `&'a mut Foo+'a` to `&(Foo+Send)` and `&'a mut (Foo+'a)`, respectively.

r? @brson
@alexcrichton
Copy link
Member

Rolled into #19298

@alexcrichton
Copy link
Member

Er sorry, #19342

TeXitoi added a commit to TeXitoi/rust-protobuf that referenced this pull request Nov 27, 2014
stepancheg pushed a commit to stepancheg/rust-protobuf that referenced this pull request Nov 28, 2014
bors added a commit that referenced this pull request Mar 22, 2017
Refactor parsing of trait object types

Bugs are fixed and code is cleaned up.

User visible changes:
- `ty` matcher in macros accepts trait object types like `Write + Send` (#39080)
- Buggy priority of `+` in trait object types starting with `for` is fixed (#39317). `&for<'a> Trait<'a> + Send` is now parsed as `(&for<'a> Trait<'a>) + Send` and requires parens `&(for<'a> Trait<'a> + Send)`. For comparison, `&Send + for<'a> Trait<'a>` was parsed like this since [Nov 27, 2014](#19298).
- Trailing `+`s are supported in trait objects, like in other bounds.
- Better error reporting for trait objects starting with `?Sized`.

Fixes #39080
Fixes #39317 [breaking-change]
Closes #39298
cc #39085 (fixed, then reverted #40043 (comment))
cc #39318 (fixed, then reverted #40043 (comment))

r? @nikomatsakis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking RFC 438 - precedence of + in type grammar
3 participants