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

Change return-type-notation to use (..) #127092

Merged
merged 3 commits into from
Jul 4, 2024

Conversation

compiler-errors
Copy link
Member

Aligns the syntax with the current wording of RFC 3654. Also implements rustfmt support (along with making a match exhaustive).

Tracking:

@rustbot
Copy link
Collaborator

rustbot commented Jun 28, 2024

r? @estebank

rustbot has assigned @estebank.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jun 28, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jun 28, 2024

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

@rustbot
Copy link
Collaborator

rustbot commented Jun 28, 2024

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

@@ -1,21 +1,13 @@
//@ edition: 2021
//@ revisions: cfg no

//@ [no] check-pass
// Since we're not adding new syntax, `cfg`'d out RTN must pass.
Copy link
Member Author

Choose a reason for hiding this comment

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

This is no longer true since (..) is syntactically distinct from paren sugar args (e.g. Fn()), so we can deny it pre-expansion too.

Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

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

@bors r+

Comment on lines 13 to 14
fn bar<T: Trait<method() -> (): Send>>() {}
//~^ ERROR return type not allowed with return type notation
Copy link
Contributor

Choose a reason for hiding this comment

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

Why doesn't this complain about missing ..?

Copy link
Member Author

@compiler-errors compiler-errors Jul 3, 2024

Choose a reason for hiding this comment

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

order of error reporting, we first error about ->, and only if that is not present then error about missing ... I could make them report in some other order, but 🤷

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, not worth it unless super trivial to maintain, even after future stabilization.

@estebank
Copy link
Contributor

estebank commented Jul 3, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Jul 3, 2024

📌 Commit 99365a5 has been approved by estebank

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 3, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 3, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#127092 (Change return-type-notation to use `(..)`)
 - rust-lang#127184 (More refactorings to rustc_interface)
 - rust-lang#127190 (Update LLVM submodule)
 - rust-lang#127253 (Fix incorrect suggestion for extra argument with a type error)
 - rust-lang#127280 (Disable rmake test rustdoc-io-error on riscv64gc-gnu)
 - rust-lang#127294 (Less magic number for corountine)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 33e9f25 into rust-lang:master Jul 4, 2024
@rustbot rustbot added this to the 1.81.0 milestone Jul 4, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 4, 2024
Rollup merge of rust-lang#127092 - compiler-errors:rtn-dots-redux, r=estebank

Change return-type-notation to use `(..)`

Aligns the syntax with the current wording of [RFC 3654](rust-lang/rfcs#3654). Also implements rustfmt support (along with making a match exhaustive).

Tracking:
* rust-lang#109417
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants