File tree Expand file tree Collapse file tree 1 file changed +0
-45
lines changed Expand file tree Collapse file tree 1 file changed +0
-45
lines changed Original file line number Diff line number Diff line change @@ -133,51 +133,6 @@ pub trait Default: Sized {
133133 fn default ( ) -> Self ;
134134}
135135
136- /// Return the default value of a type according to the `Default` trait.
137- ///
138- /// The type to return is inferred from context; this is equivalent to
139- /// `Default::default()` but shorter to type.
140- ///
141- /// For example:
142- /// ```
143- /// #![feature(default_free_fn)]
144- ///
145- /// use std::default::default;
146- ///
147- /// #[derive(Default)]
148- /// struct AppConfig {
149- /// foo: FooConfig,
150- /// bar: BarConfig,
151- /// }
152- ///
153- /// #[derive(Default)]
154- /// struct FooConfig {
155- /// foo: i32,
156- /// }
157- ///
158- /// #[derive(Default)]
159- /// struct BarConfig {
160- /// bar: f32,
161- /// baz: u8,
162- /// }
163- ///
164- /// fn main() {
165- /// let options = AppConfig {
166- /// foo: default(),
167- /// bar: BarConfig {
168- /// bar: 10.1,
169- /// ..default()
170- /// },
171- /// };
172- /// }
173- /// ```
174- #[ unstable( feature = "default_free_fn" , issue = "73014" ) ]
175- #[ must_use]
176- #[ inline]
177- pub fn default < T : Default > ( ) -> T {
178- Default :: default ( )
179- }
180-
181136/// Derive macro generating an impl of the trait `Default`.
182137#[ rustc_builtin_macro( Default , attributes( default ) ) ]
183138#[ stable( feature = "builtin_macro_prelude" , since = "1.38.0" ) ]
You can’t perform that action at this time.
0 commit comments