rust/compiler/rustc_hir/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
..
arena.rs rustc_hir: Change representation of import paths to support multiple resolutions 2022-12-01 18:51:05 +03:00
def_path_hash_map.rs Use on-disk-hash-table format for DefPathHashMap in hir::definitions. 2021-09-14 13:54:41 +02:00
def.rs diagnostics: if AssocFn has self argument, describe as method 2023-02-22 08:40:33 -07:00
definitions.rs Properly skip RPITITs from ModChild and give a name in AssocItem 2023-03-29 11:19:49 -03:00
diagnostic_items.rs Introduce get_diagnostic_name 2021-10-06 08:40:28 -05:00
errors.rs have LangItemError derive everything LangItem does 2022-08-25 11:06:45 -06:00
hir_id.rs Use local key in providers 2023-03-21 15:38:51 +00:00
hir.rs Add (..) syntax for RTN 2023-03-28 01:14:28 +00:00
intravisit.rs Remove box expressions from HIR 2023-03-14 17:18:26 +00:00
lang_items.rs Auto merge of #98112 - saethlin:mir-alignment-checks, r=oli-obk 2023-03-31 08:50:35 +00:00
lib.rs Separate lifetime ident from resolution in HIR. 2022-11-23 19:33:06 +00:00
pat_util.rs compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
stable_hash_impls.rs Only compute the crate hash when necessary. 2023-03-08 09:30:22 +11:00
target.rs Add of_trait to DefKind::Impl. 2023-02-14 19:55:44 +00:00
tests.rs Use Symbol for the crate name instead of String/str 2022-12-07 20:30:02 +00:00
weak_lang_items.rs Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00