Skip to content

Commit 4b49378

Browse files
authored
Merge pull request #153 from Havvy/deunstabilize
Remove unstable and 'in the future' things.
2 parents 3e0f35e + 337c28b commit 4b49378

File tree

6 files changed

+19
-112
lines changed

6 files changed

+19
-112
lines changed

src/attributes.md

+6-95
Original file line numberDiff line numberDiff line change
@@ -59,28 +59,17 @@ mod bar {
5959
type int8_t = i8;
6060
```
6161

62-
> **Note:** At some point in the future, the compiler will distinguish between
63-
> language-reserved and user-available attributes. Until then, there is
64-
> effectively no difference between an attribute handled by a loadable syntax
65-
> extension and the compiler.
66-
6762
## Crate-only attributes
6863

6964
- `crate_name` - specify the crate's crate name.
7065
- `crate_type` - see [linkage](linkage.html).
71-
- `feature` - see [compiler features](#compiler-features).
7266
- `no_builtins` - disable optimizing certain code patterns to invocations of
7367
library functions that are assumed to exist
7468
- `no_main` - disable emitting the `main` symbol. Useful when some other
7569
object being linked to defines `main`.
7670
- `no_start` - disable linking to the `native` crate, which specifies the
7771
"start" language item.
7872
- `no_std` - disable linking to the `std` crate.
79-
- `plugin` - load a list of named crates as compiler plugins, e.g.
80-
`#![plugin(foo, bar)]`. Optional arguments for each plugin,
81-
i.e. `#![plugin(foo(... args ...))]`, are provided to the plugin's
82-
registrar function. The `plugin` feature gate is required to use
83-
this attribute.
8473
- `recursion_limit` - Sets the maximum depth for potentially
8574
infinitely-recursive compile-time operations like
8675
auto-dereference or macro expansion. The default is
@@ -107,25 +96,12 @@ type int8_t = i8;
10796

10897
- `main` - indicates that this function should be passed to the entry point,
10998
rather than the function in the crate root named `main`.
110-
- `plugin_registrar` - mark this function as the registration point for
111-
[compiler plugins][plugin], such as loadable syntax extensions.
112-
- `start` - indicates that this function should be used as the entry point,
113-
overriding the "start" language item. See the "start" [language
114-
item](#language-items) for more details.
11599
- `test` - indicates that this function is a test function, to only be compiled
116100
in case of `--test`.
117101
- `ignore` - indicates that this test function is disabled.
118102
- `should_panic` - indicates that this test function should panic, inverting the success condition.
119103
- `cold` - The function is unlikely to be executed, so optimize it (and calls
120104
to it) differently.
121-
- `naked` - The function utilizes a custom ABI or custom inline ASM that requires
122-
epilogue and prologue to be skipped.
123-
124-
## Static-only attributes
125-
126-
- `thread_local` - on a `static mut`, this signals that the value of this
127-
static may change depending on the current thread. The exact consequences of
128-
this are implementation-defined.
129105

130106
## FFI attributes
131107

@@ -171,6 +147,10 @@ On `struct`s:
171147
remove any padding between fields (note that this is very fragile and may
172148
break platforms which require aligned access).
173149

150+
On `union`s:
151+
152+
- `repr` - Same as per `struct`.
153+
174154
## Macro-related attributes
175155

176156
- `macro_use` on a `mod` — macros defined in this module will be visible in the
@@ -204,33 +184,7 @@ macro scope.
204184
object file that this item's contents will be placed into.
205185
- `no_mangle` - on any item, do not apply the standard name mangling. Set the
206186
symbol for this item to its identifier.
207-
- `simd` - on certain tuple structs, derive the arithmetic operators, which
208-
lower to the target's SIMD instructions, if any; the `simd` feature gate
209-
is necessary to use this attribute.
210-
- `unsafe_destructor_blind_to_params` - on `Drop::drop` method, asserts that the
211-
destructor code (and all potential specializations of that code) will
212-
never attempt to read from nor write to any references with lifetimes
213-
that come in via generic parameters. This is a constraint we cannot
214-
currently express via the type system, and therefore we rely on the
215-
programmer to assert that it holds. Adding this to a Drop impl causes
216-
the associated destructor to be considered "uninteresting" by the
217-
Drop-Check rule, and thus it can help sidestep data ordering
218-
constraints that would otherwise be introduced by the Drop-Check
219-
rule. Such sidestepping of the constraints, if done incorrectly, can
220-
lead to undefined behavior (in the form of reading or writing to data
221-
outside of its dynamic extent), and thus this attribute has the word
222-
"unsafe" in its name. To use this, the
223-
`unsafe_destructor_blind_to_params` feature gate must be enabled.
224187
- `doc` - Doc comments such as `/// foo` are equivalent to `#[doc = "foo"]`.
225-
- `rustc_on_unimplemented` - Write a custom note to be shown along with the error
226-
when the trait is found to be unimplemented on a type.
227-
You may use format arguments like `{T}`, `{A}` to correspond to the
228-
types at the point of use corresponding to the type parameters of the
229-
trait of the same name. `{Self}` will be replaced with the type that is supposed
230-
to implement the trait but doesn't. You can also use the trait's name which will
231-
be replaced with the full path for the trait, for example for the trait `Foo` in
232-
module `Bar`, `{Foo}` can be used and will show up as `Bar::Foo`.
233-
To use this, the `on_unimplemented` feature gate must be enabled.
234188
- `must_use` - on structs and enums, will warn if a value of this type isn't used or
235189
assigned to a variable. You may also include an optional message by using
236190
`#[must_use = "message"]` which will be given alongside the warning.
@@ -403,15 +357,6 @@ pub mod m3 {
403357
}
404358
```
405359

406-
### Language items
407-
408-
Some primitive Rust operations are defined in Rust code, rather than being
409-
implemented directly in C or assembly language. The definitions of these
410-
operations have to be easy for the compiler to find. The `lang` attribute
411-
makes it possible to declare these operations.
412-
The set of language items is currently considered unstable. A complete
413-
list of the built-in language items will be added in the future.
414-
415360
### Inline attributes
416361

417362
The inline attribute suggests that the compiler should place a copy of
@@ -461,40 +406,6 @@ impl<T: PartialEq> PartialEq for Foo<T> {
461406
}
462407
```
463408

464-
You can implement `derive` for your own type through [procedural
465-
macros](procedural-macros.html).
466-
467-
### Compiler Features
468-
469-
Certain aspects of Rust may be implemented in the compiler, but they're not
470-
necessarily ready for every-day use. These features are often of "prototype
471-
quality" or "almost production ready", but may not be stable enough to be
472-
considered a full-fledged language feature.
473-
474-
For this reason, Rust recognizes a special crate-level attribute of the form:
475-
476-
```rust,ignore
477-
#![feature(feature1, feature2, feature3)]
478-
```
479-
480-
This directive informs the compiler that the feature list: `feature1`,
481-
`feature2`, and `feature3` should all be enabled. This is only recognized at a
482-
crate-level, not at a module-level. Without this directive, all features are
483-
considered off, and using the features will result in a compiler error.
484-
485-
The currently implemented features of the reference compiler are documented in
486-
[The Unstable Book].
487-
488-
If a feature is promoted to a language feature, then all existing programs will
489-
start to receive compilation warnings about `#![feature]` directives which enabled
490-
the new feature (because the directive is no longer necessary). However, if a
491-
feature is decided to be removed from the language, errors will be issued (if
492-
there isn't a parser error first). The directive in this case is no longer
493-
necessary, and it's likely that existing code will break if the feature isn't
494-
removed.
495-
496-
If an unknown feature is found in a directive, it results in a compiler error.
497-
An unknown feature is one which has never been recognized by the compiler.
409+
You can implement `derive` for your own type through [procedural macros].
498410

499-
[The Unstable Book]: https://doc.rust-lang.org/nightly/unstable-book/
500-
[unstable book plugin]: ../unstable-book/language-features/plugin.html#lint-plugins
411+
[procedural macros]: procedural-macros.html

src/identifiers.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
> &nbsp;&nbsp; &nbsp;&nbsp; [`a`-`z` `A`-`Z`]&nbsp;[`a`-`z` `A`-`Z` `0`-`9` `_`]<sup>\*</sup>
66
> &nbsp;&nbsp; | `_` [`a`-`z` `A`-`Z` `0`-`9` `_`]<sup>+</sup>
77
8-
An identifier is any nonempty ASCII[^non_ascii_idents] string of the following form:
8+
An identifier is any nonempty ASCII string of the following form:
99

1010
Either
1111

@@ -17,5 +17,3 @@ Or
1717
* The first character is `_`
1818
* The identifier is more than one character, `_` alone is not an identifier
1919
* The remaining characters are alphanumeric or `_`
20-
21-
[^non_ascii_idents] Non-ASCII characters in identifiers are currently feature-gated. See [issue #28979](https://github.com/rust-lang/rust/issues/28979).

src/macros.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@ A number of minor features of Rust are not central enough to have their own
44
syntax, and yet are not implementable as functions. Instead, they are given
55
names, and invoked through a consistent syntax: `some_extension!(...)`.
66

7-
Users of `rustc` can define new macros in two ways:
7+
Thre are two ways to define new macros:
88

9-
* [Macros by Example] define new syntax in a higher-level,
10-
declarative way.
9+
* [Macros by Example] define new syntax in a higher-level, declarative way.
1110
* [Procedural Macros] can be used to implement custom derive.
1211

13-
And one unstable way: [compiler plugins].
14-
1512
[Macros by Example]: macros-by-example.html
1613
[Procedural Macros]: procedural-macros.html
1714
[compiler plugins]: ../unstable-book/language-features/plugin.html

src/procedural-macros.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
## Procedural Macros
22

3-
"Procedural macros" are the second way to implement a macro. For now, the only
4-
thing they can be used for is to implement derive on your own types. See
5-
[the book][procedural macros] for a tutorial.
6-
7-
[procedural macros]: ../book/procedural-macros.html
3+
*Procedural macros* allow creating syntax extensions as execution of a function.
4+
Procedural macros can be used for is to implement custom [derive] on your own
5+
types. See [the book][procedural macros] for a tutorial.
86

97
Procedural macros involve a few different parts of the language and its
108
standard libraries. First is the `proc_macro` crate, included with Rust,
@@ -21,3 +19,6 @@ pub fn hello_world(input: TokenStream) -> TokenStream
2119

2220
Finally, procedural macros must be in their own crate, with the `proc-macro`
2321
crate type.
22+
23+
[derive]: attributes.html#derive
24+
[procedural macros]: ../book/first-edition/procedural-macros.html

src/type-coercions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ Coercion is allowed between the following types:
142142
- coerce_inner(`T`) = `U` where `T` is a concrete type which implements the
143143
trait `U`.
144144

145-
In the future, coerce_inner will be recursively extended to tuples and
145+
<!--In the future, coerce_inner will be recursively extended to tuples and
146146
structs. In addition, coercions from sub-traits to super-traits will be
147-
added. See [RFC 401] for more details.
147+
added. See [RFC 401] for more details.-->
148148

149149
* Non capturing closures to `fn` pointers

src/types.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ which are only assigned when the function is called) - so the value does not
301301
need to contain an actual function pointer, and no indirection is needed when
302302
the function is called.
303303

304-
There is currently no syntax that directly refers to a function item type, but
305-
the compiler will display the type as something like `fn() {foo::<u32>}` in
304+
There is no syntax that directly refers to a function item type, but the
305+
compiler will display the type as something like `fn(u32) -> i32 {fn_name}` in
306306
error messages.
307307

308308
Because the function item type explicitly identifies the function, the item

0 commit comments

Comments
 (0)