rust/compiler/rustc_ast/src
bors 7402519c63 Auto merge of #109010 - compiler-errors:rtn, r=eholk
Initial support for return type notation (RTN)

See: https://smallcultfollowing.com/babysteps/blog/2023/02/13/return-type-notation-send-bounds-part-2/

1. Only supports `T: Trait<method(): Send>` style bounds, not `<T as Trait>::method(): Send`. Checking validity and injecting an implicit binder for all of the late-bound method generics is harder to do for the latter.
    * I'd add this in a follow-up.
3. ~Doesn't support RTN in general type position, i.e. no `let x: <T as Trait>::method() = ...`~
    * I don't think we actually want this.
5. Doesn't add syntax for "eliding" the function args -- i.e. for now, we write `method(): Send` instead of `method(..): Send`.
    * May be a hazard if we try to add it in the future. I'll probably add it in a follow-up later, with a structured suggestion to change `method()` to `method(..)` once we add it.
7. ~I'm not in love with the feature gate name 😺~
    * I renamed it to `return_type_notation` ✔️

Follow-up PRs will probably add support for `where T::method(): Send` bounds. I'm not sure if we ever want to support return-type-notation in arbitrary type positions. I may also make the bounds require `..` in the args list later.

r? `@ghost`
2023-03-31 18:04:12 +00:00
..
attr rustc: Remove unused Session argument from some attribute functions 2023-03-22 13:55:55 +04:00
expand Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
util Remove box expressions from HIR 2023-03-14 17:18:26 +00:00
ast_traits.rs Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
ast.rs Auto merge of #109010 - compiler-errors:rtn, r=eholk 2023-03-31 18:04:12 +00:00
entry.rs Fixup missing renames from #[main] to #[rustc_main] 2022-06-22 18:24:09 +02:00
format.rs Flatten nested format_args!() into one. 2023-03-16 11:19:30 +01:00
lib.rs Rollup merge of #107194 - xfix:remove-slice-internals-dependency-in-rustc-ast, r=Nilstrieb 2023-01-28 00:23:12 +09:00
mut_visit.rs Add (..) syntax for RTN 2023-03-28 01:14:28 +00:00
node_id.rs A few small cleanups for newtype_index 2022-12-18 21:47:28 +01:00
ptr.rs compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
token.rs Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
tokenstream.rs Rename Cursor/CursorRef as TokenTreeCursor/RefTokenTreeCursor. 2023-02-03 10:06:52 +11:00
visit.rs Add (..) syntax for RTN 2023-03-28 01:14:28 +00:00