From a13d4678feadf03e247ab6aae8279bfab9cdaa6d Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Sun, 24 May 2020 23:07:55 -0400 Subject: Implement associated lang items Fixes #70718 This commit allows making associated items (e.g. associated functions and types) into lang items via the `#[lang]` attribute. This allows such items to be accessed directly, rather than by iterating over the parent item's associated items. I've added `FnOnce::Output` as a lang item, and updated one old usage to use the new lang item. The remaining uses can be updated separately. --- src/libcore/ops/function.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libcore') diff --git a/src/libcore/ops/function.rs b/src/libcore/ops/function.rs index 04c7789fa4f..2cdfee87a35 100644 --- a/src/libcore/ops/function.rs +++ b/src/libcore/ops/function.rs @@ -224,6 +224,7 @@ pub trait FnMut: FnOnce { #[must_use = "closures are lazy and do nothing unless called"] pub trait FnOnce { /// The returned type after the call operator is used. + #[cfg_attr(not(bootstrap), lang = "fn_once_output")] #[stable(feature = "fn_once_output", since = "1.12.0")] type Output; -- cgit 1.4.1-3-g733a5