Use phase(plugin) in other crates
This commit is contained in:
parent
ffb2f12ed8
commit
84243ed6e1
|
@ -4098,7 +4098,7 @@ that demonstrates all four of them:
|
|||
|
||||
~~~~
|
||||
#![feature(phase)]
|
||||
#[phase(syntax, link)] extern crate log;
|
||||
#[phase(plugin, link)] extern crate log;
|
||||
|
||||
fn main() {
|
||||
error!("This is an error log")
|
||||
|
|
|
@ -22,7 +22,7 @@ to be `big`, i.e. left-to-right order. It returns a u32.
|
|||
To load the extension and use it:
|
||||
|
||||
```rust,ignore
|
||||
#[phase(syntax)]
|
||||
#[phase(plugin)]
|
||||
extern crate fourcc;
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -148,7 +148,7 @@
|
|||
//!
|
||||
//! ```
|
||||
//! #![feature(phase)]
|
||||
//! #[phase(syntax)] extern crate green;
|
||||
//! #[phase(plugin)] extern crate green;
|
||||
//!
|
||||
//! green_start!(main)
|
||||
//!
|
||||
|
@ -211,7 +211,7 @@
|
|||
#![allow(visible_private_types)]
|
||||
#![deny(deprecated_owned_vector)]
|
||||
|
||||
#[cfg(test)] #[phase(syntax, link)] extern crate log;
|
||||
#[cfg(test)] #[phase(plugin, link)] extern crate log;
|
||||
#[cfg(test)] extern crate rustuv;
|
||||
extern crate libc;
|
||||
extern crate alloc;
|
||||
|
@ -249,7 +249,7 @@ pub mod task;
|
|||
///
|
||||
/// ```
|
||||
/// #![feature(phase)]
|
||||
/// #[phase(syntax)] extern crate green;
|
||||
/// #[phase(plugin)] extern crate green;
|
||||
///
|
||||
/// green_start!(main)
|
||||
///
|
||||
|
|
|
@ -21,7 +21,7 @@ literal.
|
|||
To load the extension and use it:
|
||||
|
||||
```rust,ignore
|
||||
#[phase(syntax)]
|
||||
#[phase(plugin)]
|
||||
extern crate hexfloat;
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -16,7 +16,7 @@ Utilities for program-wide and customizable logging
|
|||
|
||||
```
|
||||
#![feature(phase)]
|
||||
#[phase(syntax, link)] extern crate log;
|
||||
#[phase(plugin, link)] extern crate log;
|
||||
|
||||
fn main() {
|
||||
debug!("this is a debug {}", "message");
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
///
|
||||
/// ```
|
||||
/// #![feature(phase)]
|
||||
/// #[phase(syntax, link)] extern crate log;
|
||||
/// #[phase(plugin, link)] extern crate log;
|
||||
///
|
||||
/// # fn main() {
|
||||
/// log!(log::DEBUG, "this is a debug message");
|
||||
|
@ -51,7 +51,7 @@ macro_rules! log(
|
|||
///
|
||||
/// ```
|
||||
/// #![feature(phase)]
|
||||
/// #[phase(syntax, link)] extern crate log;
|
||||
/// #[phase(plugin, link)] extern crate log;
|
||||
///
|
||||
/// # fn main() {
|
||||
/// # let error = 3;
|
||||
|
@ -69,7 +69,7 @@ macro_rules! error(
|
|||
///
|
||||
/// ```
|
||||
/// #![feature(phase)]
|
||||
/// #[phase(syntax, link)] extern crate log;
|
||||
/// #[phase(plugin, link)] extern crate log;
|
||||
///
|
||||
/// # fn main() {
|
||||
/// # let code = 3;
|
||||
|
@ -87,7 +87,7 @@ macro_rules! warn(
|
|||
///
|
||||
/// ```
|
||||
/// #![feature(phase)]
|
||||
/// #[phase(syntax, link)] extern crate log;
|
||||
/// #[phase(plugin, link)] extern crate log;
|
||||
///
|
||||
/// # fn main() {
|
||||
/// # let ret = 3;
|
||||
|
@ -107,7 +107,7 @@ macro_rules! info(
|
|||
///
|
||||
/// ```
|
||||
/// #![feature(phase)]
|
||||
/// #[phase(syntax, link)] extern crate log;
|
||||
/// #[phase(plugin, link)] extern crate log;
|
||||
///
|
||||
/// # fn main() {
|
||||
/// debug!("x = {x}, y = {y}", x=10, y=20);
|
||||
|
@ -124,7 +124,7 @@ macro_rules! debug(
|
|||
///
|
||||
/// ```
|
||||
/// #![feature(phase)]
|
||||
/// #[phase(syntax, link)] extern crate log;
|
||||
/// #[phase(plugin, link)] extern crate log;
|
||||
///
|
||||
/// # fn main() {
|
||||
/// # struct Point { x: int, y: int }
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
//!
|
||||
//! ```rust
|
||||
//! #![feature(phase)]
|
||||
//! #[phase(syntax)]
|
||||
//! #[phase(plugin)]
|
||||
//! extern crate regex_macros;
|
||||
//! extern crate regex;
|
||||
//!
|
||||
|
@ -95,7 +95,7 @@
|
|||
//!
|
||||
//! ```rust
|
||||
//! # #![feature(phase)]
|
||||
//! # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
//! # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
//! # fn main() {
|
||||
//! let re = regex!(r"(\d{4})-(\d{2})-(\d{2})");
|
||||
//! let text = "2012-03-14, 2013-01-01 and 2014-07-05";
|
||||
|
@ -121,7 +121,7 @@
|
|||
//!
|
||||
//! ```rust
|
||||
//! # #![feature(phase)]
|
||||
//! # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
//! # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
//! # fn main() {
|
||||
//! let re = regex!(r"(?P<y>\d{4})-(?P<m>\d{2})-(?P<d>\d{2})");
|
||||
//! let before = "2012-03-14, 2013-01-01 and 2014-07-05";
|
||||
|
@ -168,7 +168,7 @@
|
|||
//!
|
||||
//! ```rust
|
||||
//! # #![feature(phase)]
|
||||
//! # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
//! # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
//! # fn main() {
|
||||
//! let re = regex!(r"(?i)Δ+");
|
||||
//! assert_eq!(re.find("ΔδΔ"), Some((0, 6)));
|
||||
|
@ -181,7 +181,7 @@
|
|||
//!
|
||||
//! ```rust
|
||||
//! # #![feature(phase)]
|
||||
//! # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
//! # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
//! # fn main() {
|
||||
//! let re = regex!(r"[\pN\p{Greek}\p{Cherokee}]+");
|
||||
//! assert_eq!(re.find("abcΔᎠβⅠᏴγδⅡxyz"), Some((3, 23)));
|
||||
|
@ -278,7 +278,7 @@
|
|||
//!
|
||||
//! ```rust
|
||||
//! # #![feature(phase)]
|
||||
//! # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
//! # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
//! # fn main() {
|
||||
//! let re = regex!(r"(?i)a+(?-i)b+");
|
||||
//! let cap = re.captures("AaAaAbbBBBb").unwrap();
|
||||
|
|
|
@ -87,7 +87,7 @@ pub fn is_match(regex: &str, text: &str) -> Result<bool, parse::Error> {
|
|||
/// ```rust
|
||||
/// #![feature(phase)]
|
||||
/// extern crate regex;
|
||||
/// #[phase(syntax)] extern crate regex_macros;
|
||||
/// #[phase(plugin)] extern crate regex_macros;
|
||||
///
|
||||
/// fn main() {
|
||||
/// let re = regex!(r"\d+");
|
||||
|
@ -172,7 +172,7 @@ impl Regex {
|
|||
///
|
||||
/// ```rust
|
||||
/// # #![feature(phase)]
|
||||
/// # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
/// # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
/// # fn main() {
|
||||
/// let text = "I categorically deny having triskaidekaphobia.";
|
||||
/// let matched = regex!(r"\b\w{13}\b").is_match(text);
|
||||
|
@ -197,7 +197,7 @@ impl Regex {
|
|||
///
|
||||
/// ```rust
|
||||
/// # #![feature(phase)]
|
||||
/// # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
/// # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
/// # fn main() {
|
||||
/// let text = "I categorically deny having triskaidekaphobia.";
|
||||
/// let pos = regex!(r"\b\w{13}\b").find(text);
|
||||
|
@ -224,7 +224,7 @@ impl Regex {
|
|||
///
|
||||
/// ```rust
|
||||
/// # #![feature(phase)]
|
||||
/// # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
/// # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
/// # fn main() {
|
||||
/// let text = "Retroactively relinquishing remunerations is reprehensible.";
|
||||
/// for pos in regex!(r"\b\w{13}\b").find_iter(text) {
|
||||
|
@ -263,7 +263,7 @@ impl Regex {
|
|||
///
|
||||
/// ```rust
|
||||
/// # #![feature(phase)]
|
||||
/// # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
/// # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
/// # fn main() {
|
||||
/// let re = regex!(r"'([^']+)'\s+\((\d{4})\)");
|
||||
/// let text = "Not my favorite movie: 'Citizen Kane' (1941).";
|
||||
|
@ -281,7 +281,7 @@ impl Regex {
|
|||
///
|
||||
/// ```rust
|
||||
/// # #![feature(phase)]
|
||||
/// # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
/// # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
/// # fn main() {
|
||||
/// let re = regex!(r"'(?P<title>[^']+)'\s+\((?P<year>\d{4})\)");
|
||||
/// let text = "Not my favorite movie: 'Citizen Kane' (1941).";
|
||||
|
@ -314,7 +314,7 @@ impl Regex {
|
|||
///
|
||||
/// ```rust
|
||||
/// # #![feature(phase)]
|
||||
/// # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
/// # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
/// # fn main() {
|
||||
/// let re = regex!(r"'(?P<title>[^']+)'\s+\((?P<year>\d{4})\)");
|
||||
/// let text = "'Citizen Kane' (1941), 'The Wizard of Oz' (1939), 'M' (1931).";
|
||||
|
@ -350,7 +350,7 @@ impl Regex {
|
|||
///
|
||||
/// ```rust
|
||||
/// # #![feature(phase)]
|
||||
/// # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
/// # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
/// # fn main() {
|
||||
/// let re = regex!(r"[ \t]+");
|
||||
/// let fields: Vec<&str> = re.split("a b \t c\td e").collect();
|
||||
|
@ -380,7 +380,7 @@ impl Regex {
|
|||
///
|
||||
/// ```rust
|
||||
/// # #![feature(phase)]
|
||||
/// # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
/// # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
/// # fn main() {
|
||||
/// let re = regex!(r"\W+");
|
||||
/// let fields: Vec<&str> = re.splitn("Hey! How are you?", 3).collect();
|
||||
|
@ -410,7 +410,7 @@ impl Regex {
|
|||
///
|
||||
/// ```rust
|
||||
/// # #![feature(phase)]
|
||||
/// # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
/// # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
/// # fn main() {
|
||||
/// let re = regex!("[^01]+");
|
||||
/// assert_eq!(re.replace("1078910", "").as_slice(), "1010");
|
||||
|
@ -424,7 +424,7 @@ impl Regex {
|
|||
///
|
||||
/// ```rust
|
||||
/// # #![feature(phase)]
|
||||
/// # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
/// # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
/// # use regex::Captures; fn main() {
|
||||
/// let re = regex!(r"([^,\s]+),\s+(\S+)");
|
||||
/// let result = re.replace("Springsteen, Bruce", |caps: &Captures| {
|
||||
|
@ -441,7 +441,7 @@ impl Regex {
|
|||
///
|
||||
/// ```rust
|
||||
/// # #![feature(phase)]
|
||||
/// # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
/// # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
/// # fn main() {
|
||||
/// let re = regex!(r"(?P<last>[^,\s]+),\s+(?P<first>\S+)");
|
||||
/// let result = re.replace("Springsteen, Bruce", "$first $last");
|
||||
|
@ -458,7 +458,7 @@ impl Regex {
|
|||
///
|
||||
/// ```rust
|
||||
/// # #![feature(phase)]
|
||||
/// # extern crate regex; #[phase(syntax)] extern crate regex_macros;
|
||||
/// # extern crate regex; #[phase(plugin)] extern crate regex_macros;
|
||||
/// # fn main() {
|
||||
/// use regex::NoExpand;
|
||||
///
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
#[cfg(not(stage1))]
|
||||
#[phase(syntax)]
|
||||
#[phase(plugin)]
|
||||
extern crate regex_macros;
|
||||
|
||||
#[cfg(not(stage1))]
|
||||
|
|
Loading…
Reference in New Issue