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

libsyntax: Allow + to separate trait bounds from objects. #14827

Closed
wants to merge 1 commit into from

Conversation

pcwalton
Copy link
Contributor

RFC #27; issue #12778.

After a snapshot, the old syntax will be removed.

This can break some code that looked like foo as &Trait:Send. Now you
will need to write foo as (&Trait+Send).

[breaking-change]

r? @alexcrichton

return (None, None);
}

-> (Option<ast::Lifetime>, Option<OwnedSlice<TyParamBound>>) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this method may want to get renamed, and the second value of the tuple should be OwnedSlice instead of Option<OwnedSlice<...>>

@alexcrichton
Copy link
Member

The tests added here seem quite light. Can you add more tests dealing with the precedence of + and as?

@alexcrichton
Copy link
Member

Could you also add Closes #12778 to the commit?

@pcwalton
Copy link
Contributor Author

re-r? @alexcrichton

// Next, parse a colon and bounded type parameters, if applicable.
// Next, parse a plus and bounded type parameters, if applicable.
//
// NOTE(pcwalton): Remove `token::COLON` after a snapshot.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I normally grep for the string stage0 as well, could you put that in the comment?

@alexcrichton
Copy link
Member

r=me with one minor comment

RFC rust-lang#27.

After a snapshot, the old syntax will be removed.

This can break some code that looked like `foo as &Trait:Send`. Now you
will need to write `foo as (&Trait+Send)`.

Closes rust-lang#12778.

[breaking-change]
@alexcrichton
Copy link
Member

I canceled the most recent build because this is contained within the rollup (trying to land that all at once)

lnicola pushed a commit to lnicola/rust that referenced this pull request Jun 19, 2023
…Veykril

autopublish: Offset version number

The workflow is currently failing because it's trying to publish 0.0.16, while the last version published was 0.0.149.
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.

3 participants