summaryrefslogtreecommitdiffstats
path: root/library/core/src/default.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /library/core/src/default.rs
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/core/src/default.rs')
-rw-r--r--library/core/src/default.rs45
1 files changed, 0 insertions, 45 deletions
diff --git a/library/core/src/default.rs b/library/core/src/default.rs
index 1f7be85d3..5242e97eb 100644
--- a/library/core/src/default.rs
+++ b/library/core/src/default.rs
@@ -133,51 +133,6 @@ pub trait Default: Sized {
fn default() -> Self;
}
-/// Return the default value of a type according to the `Default` trait.
-///
-/// The type to return is inferred from context; this is equivalent to
-/// `Default::default()` but shorter to type.
-///
-/// For example:
-/// ```
-/// #![feature(default_free_fn)]
-///
-/// use std::default::default;
-///
-/// #[derive(Default)]
-/// struct AppConfig {
-/// foo: FooConfig,
-/// bar: BarConfig,
-/// }
-///
-/// #[derive(Default)]
-/// struct FooConfig {
-/// foo: i32,
-/// }
-///
-/// #[derive(Default)]
-/// struct BarConfig {
-/// bar: f32,
-/// baz: u8,
-/// }
-///
-/// fn main() {
-/// let options = AppConfig {
-/// foo: default(),
-/// bar: BarConfig {
-/// bar: 10.1,
-/// ..default()
-/// },
-/// };
-/// }
-/// ```
-#[unstable(feature = "default_free_fn", issue = "73014")]
-#[must_use]
-#[inline]
-pub fn default<T: Default>() -> T {
- Default::default()
-}
-
/// Derive macro generating an impl of the trait `Default`.
#[rustc_builtin_macro(Default, attributes(default))]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]