Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inner attribute syntax from #[foo]; to #![foo] #13311

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/doc/guide-unsafe.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ asm!(assembly template
);
```

Any use of `asm` is feature gated (requires `#[feature(asm)];` on the
Any use of `asm` is feature gated (requires `#![feature(asm)]` on the
crate to allow) and of course requires an `unsafe` block.

> **Note**: the examples here are given in x86/x86-64 assembly, but all
Expand All @@ -306,7 +306,7 @@ The `assembly template` is the only required parameter and must be a
literal string (i.e `""`)

```
#[feature(asm)];
#![feature(asm)]

#[cfg(target_arch = "x86")]
#[cfg(target_arch = "x86_64")]
Expand Down Expand Up @@ -334,7 +334,7 @@ Output operands, input operands, clobbers and options are all optional
but you must add the right number of `:` if you skip them:

```
# #[feature(asm)];
# #![feature(asm)]
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
# fn main() { unsafe {
asm!("xor %eax, %eax"
Expand All @@ -348,7 +348,7 @@ asm!("xor %eax, %eax"
Whitespace also doesn't matter:

```
# #[feature(asm)];
# #![feature(asm)]
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
# fn main() { unsafe {
asm!("xor %eax, %eax" ::: "eax");
Expand All @@ -362,7 +362,7 @@ Input and output operands follow the same format: `:
expressions must be mutable lvalues:

```
# #[feature(asm)];
# #![feature(asm)]
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
fn add(a: int, b: int) -> int {
let mut c = 0;
Expand Down Expand Up @@ -390,7 +390,7 @@ compiler not to assume any values loaded into those registers will
stay valid.

```
# #[feature(asm)];
# #![feature(asm)]
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
# fn main() { unsafe {
// Put the value 0x200 in eax
Expand Down
4 changes: 2 additions & 2 deletions src/doc/po/ja/rust.md.po
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Japanese translations for Rust package
# Copyright (C) 2013 The Rust Project Developers
# Copyright (C) 2013-2014 The Rust Project Developers
# This file is distributed under the same license as the Rust package.
# Automatically generated, 2013.
#
Expand Down Expand Up @@ -886,7 +886,7 @@ msgstr ""
#: src/doc/rust.md:2008
#, fuzzy
#| msgid "~~~~ use std::task::spawn;"
msgid "~~~~ {.ignore} #[warn(unstable)];"
msgid "~~~~ {.ignore} #![warn(unstable)]"
msgstr ""
"~~~~\n"
"use std::task::spawn;"
Expand Down
2 changes: 1 addition & 1 deletion src/etc/combine-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def scrub(b):
#[crate_id=\"run_pass_stage2#0.1\"];
#[crate_id=\"run_pass_stage2#0.1\"];
#[feature(globs, macro_rules, struct_variant, managed_boxes)];
#[allow(warnings)];
#![allow(warnings)]
extern crate collections;
"""
)
Expand Down
4 changes: 2 additions & 2 deletions src/liblog/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -15,7 +15,7 @@ Utilities for program-wide and customizable logging
## Example

```
#[feature(phase)];
#![feature(phase)]
#[phase(syntax, link)] extern crate log;

fn main() {
Expand Down
12 changes: 6 additions & 6 deletions src/liblog/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/// # Example
///
/// ```
/// #[feature(phase)];
/// #![feature(phase)]
/// #[phase(syntax, link)] extern crate log;
///
/// # fn main() {
Expand All @@ -45,7 +45,7 @@ macro_rules! log(
/// # Example
///
/// ```
/// #[feature(phase)];
/// #![feature(phase)]
/// #[phase(syntax, link)] extern crate log;
///
/// # fn main() {
Expand All @@ -63,7 +63,7 @@ macro_rules! error(
/// # Example
///
/// ```
/// #[feature(phase)];
/// #![feature(phase)]
/// #[phase(syntax, link)] extern crate log;
///
/// # fn main() {
Expand All @@ -81,7 +81,7 @@ macro_rules! warn(
/// # Example
///
/// ```
/// #[feature(phase)];
/// #![feature(phase)]
/// #[phase(syntax, link)] extern crate log;
///
/// # fn main() {
Expand All @@ -101,7 +101,7 @@ macro_rules! info(
/// # Example
///
/// ```
/// #[feature(phase)];
/// #![feature(phase)]
/// #[phase(syntax, link)] extern crate log;
///
/// # fn main() {
Expand All @@ -118,7 +118,7 @@ macro_rules! debug(
/// # Example
///
/// ```
/// #[feature(phase)];
/// #![feature(phase)]
/// #[phase(syntax, link)] extern crate log;
///
/// # fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand Down
4 changes: 2 additions & 2 deletions src/test/auxiliary/issue_2316_b.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -9,7 +9,7 @@
// except according to those terms.

#[allow(unused_imports)];
#[feature(globs)];
#![feature(globs)]

extern crate issue_2316_a;

Expand Down
4 changes: 2 additions & 2 deletions src/test/auxiliary/logging_right_crate.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[feature(phase)];
#![feature(phase)]
#[phase(syntax, link)] extern crate log;

pub fn foo<T>() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/import-glob-0.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -10,7 +10,7 @@

// error-pattern: unresolved name

#[feature(globs)];
#![feature(globs)]

use module_of_many_things::*;

Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/import-glob-circular.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -10,7 +10,7 @@

// error-pattern: unresolved

#[feature(globs)];
#![feature(globs)]

mod circ1 {
pub use circ2::f2;
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/name-clash-nullary.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[feature(globs)];
#![feature(globs)]

// error-pattern:declaration of `None` shadows
use std::option::*;
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/qquote-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// ignore-test Can't use syntax crate here

#[feature(quote)];
#![feature(quote)]

extern crate syntax;

Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/qquote-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// ignore-test Can't use syntax crate here

#[feature(quote)];
#![feature(quote)]

extern crate syntax;

Expand Down
2 changes: 1 addition & 1 deletion src/test/debug-info/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

// debugger:continue

#[allow(experimental)];
#![allow(experimental)]
#[allow(unused_variable)];

use std::unstable::simd::{i8x16, i16x8,i32x4,i64x2,u8x16,u16x8,u32x4,u64x2,f32x4,f64x2};
Expand Down
2 changes: 1 addition & 1 deletion src/test/pretty/raw-str-nonexpr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// ignore-fast #[feature] doesn't work with check-fast
// pp-exact

#[feature(asm)];
#![feature(asm)]

#[cfg = r#"just parse this"#]
extern crate blah = r##"blah"##;
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-fail/glob-use-std.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -11,7 +11,7 @@
// Issue #7580

// error-pattern:fail works
#[feature(globs)];
#![feature(globs)]

use std::*;

Expand Down
4 changes: 2 additions & 2 deletions src/test/run-fail/rt-set-exit-status-fail.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -10,7 +10,7 @@

// error-pattern:whatever

#[feature(phase)];
#![feature(phase)]
#[phase(syntax, link)] extern crate log;
use std::os;

Expand Down
4 changes: 2 additions & 2 deletions src/test/run-fail/rt-set-exit-status-fail2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -10,7 +10,7 @@

// error-pattern:whatever

#[feature(phase)];
#![feature(phase)]
#[phase(syntax, link)] extern crate log;
use std::os;
use std::task;
Expand Down
4 changes: 2 additions & 2 deletions src/test/run-fail/rt-set-exit-status.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -10,7 +10,7 @@

// error-pattern:whatever

#[feature(phase)];
#![feature(phase)]
#[phase(syntax, link)] extern crate log;
use std::os;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// ignore-android
// ignore-cross-compile #12102

#[feature(phase)];
#![feature(phase)]

#[phase(syntax)]
extern crate macro_crate_outlive_expansion_phase;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/macro-crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// ignore-android
// ignore-cross-compile #12102

#[feature(phase)];
#![feature(phase)]

#[phase(syntax)]
extern crate macro_crate_test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// can't run host binaries, and force-host to make this test build as the host
// arch.

#[feature(phase)];
#![feature(phase)]

#[phase(syntax, link)]
extern crate macro_crate_test;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/qquote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// ignore-pretty
// ignore-test

#[feature(quote)];
#![feature(quote)]

extern crate syntax;

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/quote-tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// ignore-test

#[feature(quote)];
#![feature(quote)]
#[feature(managed_boxes)];

extern crate syntax;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/quote-unused-sp-no-warning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// ignore-fast
// ignore-android
#[feature(quote)];
#![feature(quote)]
#[deny(unused_variable)];

extern crate syntax;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/syntax-extension-fourcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// ignore-pretty
// ignore-cross-compile

#[feature(phase)];
#![feature(phase)]

#[phase(syntax)]
extern crate fourcc;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass-fulldeps/syntax-extension-hexfloat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// ignore-cross-compile #12102
// ignore-fast

#[feature(phase)];
#![feature(phase)]
#[phase(syntax)]
extern crate hexfloat;

Expand Down
Loading