rollup merge of #21001: camjackson/master
With the code samples as they are, the compiler says: `feature has been added to Rust, directive not necessary`
This commit is contained in:
commit
dbbe506c10
@ -254,7 +254,6 @@ a large module, and so this is a common use of the `glob` feature. Let's change
|
|||||||
our `src/lib.rs` to make use of it:
|
our `src/lib.rs` to make use of it:
|
||||||
|
|
||||||
```{rust,ignore}
|
```{rust,ignore}
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
pub fn add_two(a: i32) -> i32 {
|
pub fn add_two(a: i32) -> i32 {
|
||||||
a + 2
|
a + 2
|
||||||
@ -271,8 +270,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Note the `feature` attribute, as well as the different `use` line. Now we run
|
Note the different `use` line. Now we run our tests:
|
||||||
our tests:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ cargo test
|
$ cargo test
|
||||||
@ -370,8 +368,6 @@ with examples:
|
|||||||
//! assert_eq!(4, adder::add_two(2));
|
//! assert_eq!(4, adder::add_two(2));
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
/// This function adds two to its argument.
|
/// This function adds two to its argument.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@ -440,8 +436,6 @@ Rust also supports benchmark tests, which can test the performance of your
|
|||||||
code. Let's make our `src/lib.rs` look like this (comments elided):
|
code. Let's make our `src/lib.rs` look like this (comments elided):
|
||||||
|
|
||||||
```{rust,ignore}
|
```{rust,ignore}
|
||||||
#![feature(globs)]
|
|
||||||
|
|
||||||
extern crate test;
|
extern crate test;
|
||||||
|
|
||||||
pub fn add_two(a: i32) -> i32 {
|
pub fn add_two(a: i32) -> i32 {
|
||||||
|
@ -530,7 +530,6 @@ vectors provided from C, using idiomatic Rust practices.
|
|||||||
|
|
||||||
```
|
```
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![feature(globs)]
|
|
||||||
#![feature(lang_items)]
|
#![feature(lang_items)]
|
||||||
|
|
||||||
# extern crate libc;
|
# extern crate libc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user