about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2020-05-24 23:07:55 -0400
committerAaron Hill <aa1ronham@gmail.com>2020-06-24 19:08:11 -0400
commita13d4678feadf03e247ab6aae8279bfab9cdaa6d (patch)
tree638f56f743b932f4748845257841d630b2c044d8 /src/libcore
parentd8ed1b03c202d77248eb0d335062f46026fc29c4 (diff)
downloadrust-a13d4678feadf03e247ab6aae8279bfab9cdaa6d.tar.gz
rust-a13d4678feadf03e247ab6aae8279bfab9cdaa6d.zip
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.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/ops/function.rs1
1 files changed, 1 insertions, 0 deletions
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<Args>: FnOnce<Args> {
 #[must_use = "closures are lazy and do nothing unless called"]
 pub trait FnOnce<Args> {
     /// 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;