File tree 3 files changed +6
-107
lines changed
src/doc/unstable-book/src/library-features
3 files changed +6
-107
lines changed Original file line number Diff line number Diff line change @@ -133,51 +133,6 @@ pub trait Default: Sized {
133
133
fn default ( ) -> Self ;
134
134
}
135
135
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
-
181
136
/// Derive macro generating an impl of the trait `Default`.
182
137
#[ rustc_builtin_macro( Default , attributes( default ) ) ]
183
138
#[ stable( feature = "builtin_macro_prelude" , since = "1.38.0" ) ]
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- error[E0425]: cannot find function `default` in this scope
2
- --> $DIR/issue-2356.rs:31:5
3
- |
4
- LL | default();
5
- | ^^^^^^^
6
- |
7
- help: you might have meant to call the associated function
8
- |
9
- LL | Self::default();
10
- | ~~~~~~~~~~~~~
11
- help: consider importing this function
12
- |
13
- LL + use std::default::default;
14
- |
15
-
16
1
error[E0425]: cannot find value `whiskers` in this scope
17
2
--> $DIR/issue-2356.rs:39:5
18
3
|
@@ -64,6 +49,12 @@ error[E0425]: cannot find function `clone` in this scope
64
49
LL | clone();
65
50
| ^^^^^ help: you might have meant to call the method: `self.clone`
66
51
52
+ error[E0425]: cannot find function `default` in this scope
53
+ --> $DIR/issue-2356.rs:31:5
54
+ |
55
+ LL | default();
56
+ | ^^^^^^^ help: you might have meant to call the associated function: `Self::default`
57
+
67
58
error[E0425]: cannot find function `shave` in this scope
68
59
--> $DIR/issue-2356.rs:41:5
69
60
|
You can’t perform that action at this time.
0 commit comments