-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Conversation
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 |
src/tools/rust-analyzer/crates/parser/src/grammar/generic_args.rs
Outdated
Show resolved
Hide resolved
55eb7b7
to
99365a5
Compare
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bors r+
fn bar<T: Trait<method() -> (): Send>>() {} | ||
//~^ ERROR return type not allowed with return type notation |
There was a problem hiding this comment.
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 ..
?
There was a problem hiding this comment.
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 🤷
There was a problem hiding this comment.
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.
@bors r+ |
…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
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
Aligns the syntax with the current wording of RFC 3654. Also implements rustfmt support (along with making a match exhaustive).
Tracking: