Skip to content

Commit

Permalink
Rollup merge of rust-lang#23329 - jbcrail:rm-syntax-highlight, r=sanxiyn
Browse files Browse the repository at this point in the history
 As suggested by @steveklabnik in rust-lang#23254, I removed the redundant Rust syntax highlighting from the documentation.
  • Loading branch information
Manishearth committed Mar 17, 2015
2 parents 46200e5 + fcf3f32 commit 0b463b0
Show file tree
Hide file tree
Showing 51 changed files with 172 additions and 167 deletions.
2 changes: 1 addition & 1 deletion src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ use heap::deallocate;
/// With simple pipes, without `Arc`, a copy would have to be made for each
/// task.
///
/// ```rust
/// ```
/// use std::sync::Arc;
/// use std::thread;
///
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ use core::raw::TraitObject;
///
/// The following two examples are equivalent:
///
/// ```rust
/// ```
/// #![feature(box_syntax)]
/// use std::boxed::HEAP;
///
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/bit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static FALSE: bool = false;
///
/// # Examples
///
/// ```rust
/// ```
/// use std::collections::BitVec;
///
/// let mut bv = BitVec::from_elem(10, false);
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl<T> ToOwned for T where T: Clone {
///
/// # Examples
///
/// ```rust
/// ```
/// use std::borrow::Cow;
///
/// fn abs_all(input: &mut Cow<[i32]>) {
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ use string;
///
/// # Examples
///
/// ```rust
/// ```
/// use std::fmt;
///
/// let s = fmt::format(format_args!("Hello, {}!", "world"));
Expand Down
30 changes: 15 additions & 15 deletions src/libcollections/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ pub trait SliceExt {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut v = [5, 4, 1, 3, 2];
/// v.sort_by(|a, b| a.cmp(b));
/// assert!(v == [1, 2, 3, 4, 5]);
Expand All @@ -162,7 +162,7 @@ pub trait SliceExt {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut a = [1, 2, 3, 4, 5];
/// let b = vec![6, 7, 8];
/// let num_moved = a.move_from(b, 0, 3);
Expand Down Expand Up @@ -284,7 +284,7 @@ pub trait SliceExt {
/// Print the adjacent pairs of a slice (i.e. `[1,2]`, `[2,3]`,
/// `[3,4]`):
///
/// ```rust
/// ```
/// let v = &[1, 2, 3, 4];
/// for win in v.windows(2) {
/// println!("{:?}", win);
Expand All @@ -307,7 +307,7 @@ pub trait SliceExt {
/// Print the slice two elements at a time (i.e. `[1,2]`,
/// `[3,4]`, `[5]`):
///
/// ```rust
/// ```
/// let v = &[1, 2, 3, 4, 5];
/// for win in v.chunks(2) {
/// println!("{:?}", win);
Expand Down Expand Up @@ -398,7 +398,7 @@ pub trait SliceExt {
/// uniquely determined position; the second and third are not
/// found; the fourth could match any position in `[1,4]`.
///
/// ```rust
/// ```
/// let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
/// let s = s.as_slice();
///
Expand Down Expand Up @@ -533,7 +533,7 @@ pub trait SliceExt {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut v = ["a", "b", "c", "d"];
/// v.swap(1, 3);
/// assert!(v == ["a", "d", "c", "b"]);
Expand All @@ -553,7 +553,7 @@ pub trait SliceExt {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut v = [1, 2, 3, 4, 5, 6];
///
/// // scoped to restrict the lifetime of the borrows
Expand Down Expand Up @@ -582,7 +582,7 @@ pub trait SliceExt {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut v = [1, 2, 3];
/// v.reverse();
/// assert!(v == [3, 2, 1]);
Expand Down Expand Up @@ -614,7 +614,7 @@ pub trait SliceExt {
///
/// # Examples
///
/// ```rust
/// ```
/// let v = [1, 2, 3];
/// let mut perms = v.permutations();
///
Expand All @@ -625,7 +625,7 @@ pub trait SliceExt {
///
/// Iterating through permutations one by one.
///
/// ```rust
/// ```
/// let v = [1, 2, 3];
/// let mut perms = v.permutations();
///
Expand All @@ -642,7 +642,7 @@ pub trait SliceExt {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut dst = [0, 0, 0];
/// let src = [1, 2];
///
Expand All @@ -662,7 +662,7 @@ pub trait SliceExt {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut v = [-5, 4, 1, -3, 2];
///
/// v.sort();
Expand All @@ -684,7 +684,7 @@ pub trait SliceExt {
/// uniquely determined position; the second and third are not
/// found; the fourth could match any position in `[1,4]`.
///
/// ```rust
/// ```
/// let s = [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
/// let s = s.as_slice();
///
Expand All @@ -711,7 +711,7 @@ pub trait SliceExt {
///
/// # Examples
///
/// ```rust
/// ```
/// let v: &mut [_] = &mut [0, 1, 2];
/// v.next_permutation();
/// let b: &mut [_] = &mut [0, 2, 1];
Expand All @@ -731,7 +731,7 @@ pub trait SliceExt {
///
/// # Examples
///
/// ```rust
/// ```
/// let v: &mut [_] = &mut [1, 0, 2];
/// v.prev_permutation();
/// let b: &mut [_] = &mut [0, 2, 1];
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
///
/// # Examples
///
/// ```rust
/// ```
/// assert!("banana".ends_with("nana"));
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
8 changes: 4 additions & 4 deletions src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl String {
///
/// # Examples
///
/// ```rust
/// ```
/// use std::str::Utf8Error;
///
/// let hello_vec = vec![104, 101, 108, 108, 111];
Expand All @@ -164,7 +164,7 @@ impl String {
///
/// # Examples
///
/// ```rust
/// ```
/// let input = b"Hello \xF0\x90\x80World";
/// let output = String::from_utf8_lossy(input);
/// assert_eq!(output, "Hello \u{FFFD}World");
Expand Down Expand Up @@ -296,7 +296,7 @@ impl String {
///
/// # Examples
///
/// ```rust
/// ```
/// // 𝄞music
/// let mut v = &mut [0xD834, 0xDD1E, 0x006d, 0x0075,
/// 0x0073, 0x0069, 0x0063];
Expand Down Expand Up @@ -324,7 +324,7 @@ impl String {
///
/// # Examples
///
/// ```rust
/// ```
/// // 𝄞mus<invalid>ic<invalid>
/// let v = &[0xD834, 0xDD1E, 0x006d, 0x0075,
/// 0x0073, 0xDD1E, 0x0069, 0x0063,
Expand Down
4 changes: 2 additions & 2 deletions src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ impl<T> Vec<T> {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut vec = vec!(1, 2);
/// vec.push(3);
/// assert_eq!(vec, [1, 2, 3]);
Expand Down Expand Up @@ -671,7 +671,7 @@ impl<T> Vec<T> {
///
/// # Examples
///
/// ```rust
/// ```
/// let mut vec = vec![1, 2, 3];
/// assert_eq!(vec.pop(), Some(3));
/// assert_eq!(vec, [1, 2]);
Expand Down
18 changes: 9 additions & 9 deletions src/libcollections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ impl<T> VecDeque<T> {
///
/// # Examples
///
/// ```rust
/// ```
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand All @@ -224,7 +224,7 @@ impl<T> VecDeque<T> {
///
/// # Examples
///
/// ```rust
/// ```
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand Down Expand Up @@ -258,7 +258,7 @@ impl<T> VecDeque<T> {
///
/// # Examples
///
/// ```rust
/// ```
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand Down Expand Up @@ -513,7 +513,7 @@ impl<T> VecDeque<T> {
///
/// # Examples
///
/// ```rust
/// ```
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand All @@ -536,7 +536,7 @@ impl<T> VecDeque<T> {
///
/// # Examples
///
/// ```rust
/// ```
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand Down Expand Up @@ -824,7 +824,7 @@ impl<T> VecDeque<T> {
///
/// # Examples
///
/// ```rust
/// ```
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand All @@ -849,7 +849,7 @@ impl<T> VecDeque<T> {
///
/// # Examples
///
/// ```rust
/// ```
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand Down Expand Up @@ -949,7 +949,7 @@ impl<T> VecDeque<T> {
/// Panics if `i` is greater than ringbuf's length
///
/// # Examples
/// ```rust
/// ```
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand Down Expand Up @@ -1151,7 +1151,7 @@ impl<T> VecDeque<T> {
/// Returns `None` if `i` is out of bounds.
///
/// # Examples
/// ```rust
/// ```
/// use std::collections::VecDeque;
///
/// let mut buf = VecDeque::new();
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ macro_rules! writeln {
///
/// Match arms:
///
/// ```rust
/// ```
/// fn foo(x: Option<int>) {
/// match x {
/// Some(n) if n >= 0 => println!("Some(Non-negative)"),
Expand All @@ -229,7 +229,7 @@ macro_rules! writeln {
///
/// Iterators:
///
/// ```rust
/// ```
/// fn divide_by_three(x: u32) -> u32 { // one of the poorest implementations of x/3
/// for i in std::iter::count(0, 1) {
/// if 3*i < i { panic!("u32 overflow"); }
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,15 @@ impl<T:?Sized> MarkerTrait for T { }
///
/// Therefore, we can model a method like this as follows:
///
/// ```rust
/// ```
/// use std::marker::PhantomFn;
/// trait Even : PhantomFn<Self> { }
/// ```
///
/// Another equivalent, but clearer, option would be to use
/// `MarkerTrait`:
///
/// ```rust
/// ```
/// use std::marker::MarkerTrait;
/// trait Even : MarkerTrait { }
/// ```
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ pub fn swap<T>(x: &mut T, y: &mut T) {
/// `self.buf`. But `replace` can be used to disassociate the original value of `self.buf` from
/// `self`, allowing it to be returned:
///
/// ```rust
/// ```
/// use std::mem;
/// # struct Buffer<T> { buf: Vec<T> }
/// impl<T> Buffer<T> {
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ impl Float for f32 {

/// The fractional part of the number, satisfying:
///
/// ```rust
/// ```
/// use core::num::Float;
///
/// let x = 1.65f32;
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ impl Float for f64 {

/// The fractional part of the number, satisfying:
///
/// ```rust
/// ```
/// use core::num::Float;
///
/// let x = 1.65f64;
Expand Down
Loading

0 comments on commit 0b463b0

Please sign in to comment.