Skip to content

Commit 713e875

Browse files
committed
Use new attribute syntax in python files in src/etc too (rust-lang#13478)
1 parent e2e7548 commit 713e875

File tree

473 files changed

+607
-607
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

473 files changed

+607
-607
lines changed

src/etc/generate-deriving-span-tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
3838
// This file was auto-generated using 'src/etc/generate-keyword-span-tests.py'
3939
40-
#[feature(struct_variant)];
40+
#![feature(struct_variant)]
4141
extern crate rand;
4242
4343
{error_deriving}

src/etc/unicode.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ def emit_decomp_module(f, canon, compat, combine):
411411
412412
// The following code was generated by "src/etc/unicode.py"
413413
414-
#[allow(missing_doc)];
415-
#[allow(non_uppercase_statics)];
414+
#![allow(missing_doc)]
415+
#![allow(non_uppercase_statics)]
416416
417417
''')
418418

src/librustc/front/std_inject.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<'a> fold::Folder for PreludeInjector<'a> {
126126
fn fold_crate(&mut self, krate: ast::Crate) -> ast::Crate {
127127
if !no_prelude(krate.attrs.as_slice()) {
128128
// only add `use std::prelude::*;` if there wasn't a
129-
// `#[no_implicit_prelude];` at the crate level.
129+
// `#![no_implicit_prelude]` at the crate level.
130130
ast::Crate {
131131
module: self.fold_mod(&krate.module),
132132
..krate
@@ -138,7 +138,7 @@ impl<'a> fold::Folder for PreludeInjector<'a> {
138138

139139
fn fold_item(&mut self, item: @ast::Item) -> SmallVector<@ast::Item> {
140140
if !no_prelude(item.attrs.as_slice()) {
141-
// only recur if there wasn't `#[no_implicit_prelude];`
141+
// only recur if there wasn't `#![no_implicit_prelude]`
142142
// on this item, i.e. this means that the prelude is not
143143
// implicitly imported though the whole subtree
144144
fold::noop_fold_item(item, self)

src/librustc/middle/typeck/check/regionmanip.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// #[warn(deprecated_mode)];
11+
// #![warn(deprecated_mode)]
1212

1313
use middle::ty;
1414
use middle::ty_fold;

src/libstd/fmt/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ strings and instead directly write the output. Under the hood, this function is
250250
actually invoking the `write` function defined in this module. Example usage is:
251251
252252
```rust
253-
# #[allow(unused_must_use)];
253+
# #![allow(unused_must_use)]
254254
use std::io;
255255
256256
let mut w = io::MemWriter::new();
@@ -699,7 +699,7 @@ uniform_fn_call_workaround! {
699699
/// # Example
700700
///
701701
/// ```rust
702-
/// # #[allow(unused_must_use)];
702+
/// # #![allow(unused_must_use)]
703703
/// use std::fmt;
704704
/// use std::io;
705705
///

src/libstd/io/buffered.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl<R: Reader> Reader for BufferedReader<R> {
125125
/// # Example
126126
///
127127
/// ```rust
128-
/// # #[allow(unused_must_use)];
128+
/// # #![allow(unused_must_use)]
129129
/// use std::io::{BufferedWriter, File};
130130
///
131131
/// let file = File::open(&Path::new("message.txt"));
@@ -287,7 +287,7 @@ impl<W: Reader> Reader for InternalBufferedWriter<W> {
287287
/// # Example
288288
///
289289
/// ```rust
290-
/// # #[allow(unused_must_use)];
290+
/// # #![allow(unused_must_use)]
291291
/// use std::io::{BufferedStream, File};
292292
///
293293
/// let file = File::open(&Path::new("message.txt"));

src/libstd/io/comm_adapters.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl Reader for ChanReader {
8989
/// # Example
9090
///
9191
/// ```
92-
/// # #[allow(unused_must_use)];
92+
/// # #![allow(unused_must_use)]
9393
/// use std::io::ChanWriter;
9494
///
9595
/// let (tx, rx) = channel();

src/libstd/io/fs.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ particular bits of it, etc.
2828
# Example
2929
3030
```rust
31-
# #[allow(unused_must_use)];
31+
# #![allow(unused_must_use)]
3232
use std::io::{File, fs};
3333
3434
let path = Path::new("foo.txt");
@@ -162,7 +162,7 @@ impl File {
162162
/// # Example
163163
///
164164
/// ```rust
165-
/// # #[allow(unused_must_use)];
165+
/// # #![allow(unused_must_use)]
166166
/// use std::io::File;
167167
///
168168
/// let mut f = File::create(&Path::new("foo.txt"));
@@ -220,7 +220,7 @@ impl File {
220220
/// # Example
221221
///
222222
/// ```rust
223-
/// # #[allow(unused_must_use)];
223+
/// # #![allow(unused_must_use)]
224224
/// use std::io::fs;
225225
///
226226
/// let p = Path::new("/some/file/path.txt");
@@ -290,7 +290,7 @@ pub fn lstat(path: &Path) -> IoResult<FileStat> {
290290
/// # Example
291291
///
292292
/// ```rust
293-
/// # #[allow(unused_must_use)];
293+
/// # #![allow(unused_must_use)]
294294
/// use std::io::fs;
295295
///
296296
/// fs::rename(&Path::new("foo"), &Path::new("bar"));
@@ -314,7 +314,7 @@ pub fn rename(from: &Path, to: &Path) -> IoResult<()> {
314314
/// # Example
315315
///
316316
/// ```rust
317-
/// # #[allow(unused_must_use)];
317+
/// # #![allow(unused_must_use)]
318318
/// use std::io::fs;
319319
///
320320
/// fs::copy(&Path::new("foo.txt"), &Path::new("bar.txt"));
@@ -364,7 +364,7 @@ pub fn copy(from: &Path, to: &Path) -> IoResult<()> {
364364
/// # Example
365365
///
366366
/// ```rust
367-
/// # #[allow(unused_must_use)];
367+
/// # #![allow(unused_must_use)]
368368
/// use std::io;
369369
/// use std::io::fs;
370370
///
@@ -416,7 +416,7 @@ pub fn readlink(path: &Path) -> IoResult<Path> {
416416
/// # Example
417417
///
418418
/// ```rust
419-
/// # #[allow(unused_must_use)];
419+
/// # #![allow(unused_must_use)]
420420
/// use std::io;
421421
/// use std::io::fs;
422422
///
@@ -437,7 +437,7 @@ pub fn mkdir(path: &Path, mode: FilePermission) -> IoResult<()> {
437437
/// # Example
438438
///
439439
/// ```rust
440-
/// # #[allow(unused_must_use)];
440+
/// # #![allow(unused_must_use)]
441441
/// use std::io::fs;
442442
///
443443
/// let p = Path::new("/some/dir");

src/libstd/io/mem.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn combine(seek: SeekStyle, cur: uint, end: uint, offset: i64) -> IoResult<u64>
4444
/// # Example
4545
///
4646
/// ```rust
47-
/// # #[allow(unused_must_use)];
47+
/// # #![allow(unused_must_use)]
4848
/// use std::io::MemWriter;
4949
///
5050
/// let mut w = MemWriter::new();
@@ -125,7 +125,7 @@ impl Seek for MemWriter {
125125
/// # Example
126126
///
127127
/// ```rust
128-
/// # #[allow(unused_must_use)];
128+
/// # #![allow(unused_must_use)]
129129
/// use std::io::MemReader;
130130
///
131131
/// let mut r = MemReader::new(vec!(0, 1, 2));
@@ -209,7 +209,7 @@ impl Buffer for MemReader {
209209
/// # Example
210210
///
211211
/// ```rust
212-
/// # #[allow(unused_must_use)];
212+
/// # #![allow(unused_must_use)]
213213
/// use std::io::BufWriter;
214214
///
215215
/// let mut buf = [0, ..4];
@@ -267,7 +267,7 @@ impl<'a> Seek for BufWriter<'a> {
267267
/// # Example
268268
///
269269
/// ```rust
270-
/// # #[allow(unused_must_use)];
270+
/// # #![allow(unused_must_use)]
271271
/// use std::io::BufReader;
272272
///
273273
/// let mut buf = [0, 1, 2, 3];

src/libstd/io/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Some examples of obvious things you might want to do
4646
* Write a line to a file
4747
4848
```rust
49-
# #[allow(unused_must_use)];
49+
# #![allow(unused_must_use)]
5050
use std::io::File;
5151
5252
let mut file = File::create(&Path::new("message.txt"));
@@ -82,7 +82,7 @@ Some examples of obvious things you might want to do
8282
* Make a simple TCP client connection and request
8383
8484
```rust,should_fail
85-
# #[allow(unused_must_use)];
85+
# #![allow(unused_must_use)]
8686
use std::io::net::ip::SocketAddr;
8787
use std::io::net::tcp::TcpStream;
8888
@@ -159,7 +159,7 @@ be an error.
159159
If you wanted to handle the error though you might write:
160160
161161
```rust
162-
# #[allow(unused_must_use)];
162+
# #![allow(unused_must_use)]
163163
use std::io::File;
164164
165165
match File::create(&Path::new("diary.txt")).write(bytes!("Met a girl.\n")) {

src/libstd/io/net/tcp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use rt::rtio::{RtioTcpAcceptor, RtioTcpStream};
3131
/// # Example
3232
///
3333
/// ```rust
34-
/// # #[allow(unused_must_use)];
34+
/// # #![allow(unused_must_use)]
3535
/// use std::io::net::tcp::TcpStream;
3636
/// use std::io::net::ip::{Ipv4Addr, SocketAddr};
3737
///

src/libstd/io/net/udp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use rt::rtio::{RtioSocket, RtioUdpSocket, IoFactory, LocalIo};
3131
/// # Example
3232
///
3333
/// ```rust,no_run
34-
/// # #[allow(unused_must_use)];
34+
/// # #![allow(unused_must_use)]
3535
/// use std::io::net::udp::UdpSocket;
3636
/// use std::io::net::ip::{Ipv4Addr, SocketAddr};
3737
///

src/libstd/io/net/unix.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl UnixStream {
5252
/// # Example
5353
///
5454
/// ```rust
55-
/// # #[allow(unused_must_use)];
55+
/// # #![allow(unused_must_use)]
5656
/// use std::io::net::unix::UnixStream;
5757
///
5858
/// let server = Path::new("path/to/my/socket");
@@ -98,7 +98,7 @@ impl UnixListener {
9898
/// ```
9999
/// # fn main() {}
100100
/// # fn foo() {
101-
/// # #[allow(unused_must_use)];
101+
/// # #![allow(unused_must_use)]
102102
/// use std::io::net::unix::UnixListener;
103103
/// use std::io::{Listener, Acceptor};
104104
///

src/libstd/io/pipe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl PipeStream {
3737
/// # Example
3838
///
3939
/// ```rust
40-
/// # #[allow(unused_must_use)];
40+
/// # #![allow(unused_must_use)]
4141
/// extern crate libc;
4242
///
4343
/// use std::io::pipe::PipeStream;

src/libstd/io/stdio.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ about the stream or terminal to which it is attached.
1818
# Example
1919
2020
```rust
21-
# #[allow(unused_must_use)];
21+
# #![allow(unused_must_use)]
2222
use std::io;
2323
2424
let mut out = io::stdout();

src/libstd/macros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/// # Example
3030
///
3131
/// ```should_fail
32-
/// # #[allow(unreachable_code)];
32+
/// # #![allow(unreachable_code)]
3333
/// fail!();
3434
/// fail!("this is a terrible mistake!");
3535
/// fail!(4); // fail with the value of 4 to be collected elsewhere
@@ -188,7 +188,7 @@ macro_rules! format(
188188
/// # Example
189189
///
190190
/// ```
191-
/// # #[allow(unused_must_use)];
191+
/// # #![allow(unused_must_use)]
192192
/// use std::io::MemWriter;
193193
///
194194
/// let mut w = MemWriter::new();

src/test/auxiliary/anon-extern-mod-cross-crate-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[crate_id="anonexternmod#0.1"];
11+
#![crate_id="anonexternmod#0.1"]
1212

1313
extern crate libc;
1414

src/test/auxiliary/cci_impl_lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[crate_id="cci_impl_lib"];
11+
#![crate_id="cci_impl_lib"]
1212

1313
pub trait uint_helpers {
1414
fn to(&self, v: uint, f: |uint|);

src/test/auxiliary/cci_iter_lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[crate_id="cci_iter_lib"];
11+
#![crate_id="cci_iter_lib"]
1212

1313
#[inline]
1414
pub fn iter<T>(v: &[T], f: |&T|) {

src/test/auxiliary/cci_nested_lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[feature(managed_boxes)];
11+
#![feature(managed_boxes)]
1212

1313
use std::cell::RefCell;
1414

src/test/auxiliary/cci_no_inline_lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[crate_id="cci_no_inline_lib"];
11+
#![crate_id="cci_no_inline_lib"]
1212

1313

1414
// same as cci_iter_lib, more-or-less, but not marked inline

src/test/auxiliary/changing-crates-a1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[crate_id = "a"];
11+
#![crate_id = "a"]
1212

1313
pub fn foo<T>() {}

src/test/auxiliary/changing-crates-a2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[crate_id = "a"];
11+
#![crate_id = "a"]
1212

1313
pub fn foo<T>() { println!("hello!"); }
1414

src/test/auxiliary/changing-crates-b.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[crate_id = "b"];
11+
#![crate_id = "b"]
1212

1313
extern crate a;
1414

src/test/auxiliary/crate-method-reexport-grrrrrrr2.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[feature(managed_boxes)];
12-
#[crate_id="crate_method_reexport_grrrrrrr2"];
11+
#![feature(managed_boxes)]
12+
#![crate_id="crate_method_reexport_grrrrrrr2"]
1313

1414
pub use name_pool::add;
1515

src/test/auxiliary/crateresolve1-1.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[crate_id="crateresolve1#0.1"];
11+
#![crate_id="crateresolve1#0.1"]
1212

13-
#[crate_type = "lib"];
13+
#![crate_type = "lib"]
1414

1515
pub fn f() -> int { 10 }

0 commit comments

Comments
 (0)