Auto merge of #28900 - cristicbz:typos, r=alexcrichton

I found these automatically, but fixed them manually to ensure the semantics are correct. I know things like these are hardly important, since they only marginally improve clarity. But at least for me typos and simple grammatical errors trigger an---unjustified---sense of unprofessionalism, despite the fact that I make them all the time and I understand that they're the sort of thing that is bound to slip through review.  

Anyway, to find most of these I used:

  * `ag '.*//.*(\b[A-Za-z]{2,}\b) \1\b'` for repeated words

  * `ag '\b(the|this|those|these|a|it) (a|the|this|those|these|it)\b'` to find constructs like 'the this' etc. many false positives, but not too hard to scroll through them to actually find the mistakes.

  * `cat ../../typos.txt | paste -d'|' - - - - - - - - - - - - - - - - - - - - - - | tr '\n' '\0' | xargs -0 -P4 -n1 ag`. Hacky way to find misspellings, but it works ok. I got `typos.txt` from [Wikipedia](https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines)

* `ag '.*//.* a ([ae][a-z]|(o[^n])|(i[a-rt-z]))'` to find places where 'a' was followed by a vowel (requiring 'an' instead).

I also used a handful more one off regexes that are too boring to reproduce here.
This commit is contained in:
bors 2015-10-08 22:40:50 +00:00
commit d0cae14f66
71 changed files with 92 additions and 94 deletions

View File

@ -773,7 +773,7 @@ bound := path | lifetime
## Type kinds
**FIXME:** this this probably not relevant to the grammar...
**FIXME:** this is probably not relevant to the grammar...
# Memory and concurrency models

View File

@ -195,7 +195,7 @@ our value if it's immutable, but we want to be able to mutate it, so we need
something else to persuade the borrow checker we know what we're doing.
It looks like we need some type that allows us to safely mutate a shared value,
for example a type that that can ensure only one thread at a time is able to
for example a type that can ensure only one thread at a time is able to
mutate the value inside it at any one time.
For that, we can use the `Mutex<T>` type!

View File

@ -302,7 +302,7 @@ This will print
`filter()` is an adapter that takes a closure as an argument. This closure
returns `true` or `false`. The new iterator `filter()` produces
only the elements that that closure returns `true` for:
only the elements that the closure returns `true` for:
```rust
for i in (1..100).filter(|&x| x % 2 == 0) {

View File

@ -71,7 +71,7 @@ The output on stdout is treated as (f64, f32, decimal) record, encoded thusly:
Incomplete records are an error. Not-a-Number bit patterns are invalid too.
The tests run serially but the validaition for a a single test is parallelized
The tests run serially but the validation for a single test is parallelized
with ``multiprocessing``. Each test is launched as a subprocess.
One thread supervises it: Accepts and enqueues records to validate, observe
stderr, and waits for the process to exit. A set of worker processes perform

View File

@ -593,7 +593,7 @@ mod stack {
top: node::Handle<*mut Node<K, V>, Type, NodeType>,
}
/// A `PartialSearchStack` that doesn't hold a a reference to the next node, and is just
/// A `PartialSearchStack` that doesn't hold a reference to the next node, and is just
/// just waiting for a `Handle` to that next node to be pushed. See `PartialSearchStack::with`
/// for more details.
pub struct Pusher<'id, 'a, K:'a, V:'a> {

View File

@ -86,7 +86,7 @@ fn test_find_str() {
assert_eq!(data[43..86].find("iệt"), Some(77 - 43));
assert_eq!(data[43..86].find("Nam"), Some(83 - 43));
// find every substring -- assert that it finds it, or an earlier occurence.
// find every substring -- assert that it finds it, or an earlier occurrence.
let string = "Việt Namacbaabcaabaaba";
for (i, ci) in string.char_indices() {
let ip = i + ci.len_utf8();

View File

@ -598,7 +598,7 @@ impl<'b, T: ?Sized> Ref<'b, T> {
}
}
/// Make a new `Ref` for a optional component of the borrowed data, e.g. an
/// Make a new `Ref` for an optional component of the borrowed data, e.g. an
/// enum variant.
///
/// The `RefCell` is already immutably borrowed, so this cannot fail.
@ -668,7 +668,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
}
}
/// Make a new `RefMut` for a optional component of the borrowed data, e.g.
/// Make a new `RefMut` for an optional component of the borrowed data, e.g.
/// an enum variant.
///
/// The `RefCell` is already mutably borrowed, so this cannot fail.

View File

@ -373,20 +373,20 @@ extern "rust-intrinsic" {
/// a size of `count` * `size_of::<T>()` and an alignment of
/// `min_align_of::<T>()`
///
/// The volatile parameter parameter is set to `true`, so it will not be optimized out.
/// The volatile parameter is set to `true`, so it will not be optimized out.
pub fn volatile_copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T,
count: usize);
/// Equivalent to the appropriate `llvm.memmove.p0i8.0i8.*` intrinsic, with
/// a size of `count` * `size_of::<T>()` and an alignment of
/// `min_align_of::<T>()`
///
/// The volatile parameter parameter is set to `true`, so it will not be optimized out.
/// The volatile parameter is set to `true`, so it will not be optimized out.
pub fn volatile_copy_memory<T>(dst: *mut T, src: *const T, count: usize);
/// Equivalent to the appropriate `llvm.memset.p0i8.*` intrinsic, with a
/// size of `count` * `size_of::<T>()` and an alignment of
/// `min_align_of::<T>()`.
///
/// The volatile parameter parameter is set to `true`, so it will not be optimized out.
/// The volatile parameter is set to `true`, so it will not be optimized out.
pub fn volatile_set_memory<T>(dst: *mut T, val: u8, count: usize);
/// Perform a volatile load from the `src` pointer.

View File

@ -381,7 +381,7 @@ mod impls {
/// ```
///
/// Without the declaration `T:Reflect`, `foo` would not type check
/// (note: as a matter of style, it would be preferable to to write
/// (note: as a matter of style, it would be preferable to write
/// `T:Any`, because `T:Any` implies `T:Reflect` and `T:'static`, but
/// we use `Reflect` here to show how it works). The `Reflect` bound
/// thus serves to alert `foo`'s caller to the fact that `foo` may

View File

@ -110,7 +110,7 @@ macro_rules! define_bignum {
($name:ident: type=$ty:ty, n=$n:expr) => (
/// Stack-allocated arbitrary-precision (up to certain limit) integer.
///
/// This is backed by an fixed-size array of given type ("digit").
/// This is backed by a fixed-size array of given type ("digit").
/// While the array is not very large (normally some hundred bytes),
/// copying it recklessly may result in the performance hit.
/// Thus this is intentionally not `Copy`.

View File

@ -461,7 +461,7 @@ pub fn to_shortest_str<'a, T, F>(mut format_shortest: F, v: T,
/// You probably would want `strategy::grisu::format_shortest` for this.
///
/// The `dec_bounds` is a tuple `(lo, hi)` such that the number is formatted
/// as decimal only when `10^lo <= V < 10^hi`. Note that this is the *apparant* `V`
/// as decimal only when `10^lo <= V < 10^hi`. Note that this is the *apparent* `V`
/// instead of the actual `v`! Thus any printed exponent in the exponential form
/// cannot be in this range, avoiding any confusion.
///

View File

@ -488,7 +488,7 @@ pub fn format_exact_opt(d: &Decoded, buf: &mut [u8], limit: i16)
// but scaling `max_ten_kappa << e` by 10 can result in overflow.
// thus we are being sloppy here and widen the error range by a factor of 10.
// this will increase the false negative rate, but only very, *very* slightly;
// it can only matter noticably when the mantissa is bigger than 60 bits.
// it can only matter noticeably when the mantissa is bigger than 60 bits.
return possibly_round(buf, 0, exp, limit, v.f / 10, (max_ten_kappa as u64) << e, err << e);
} else if ((exp as i32 - limit as i32) as usize) < buf.len() {
(exp - limit) as usize

View File

@ -1383,7 +1383,7 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32)
// all valid digits are ascii, so we will just iterate over the utf8 bytes
// and cast them to chars. .to_digit() will safely return None for anything
// other than a valid ascii digit for a the given radix, including the first-byte
// other than a valid ascii digit for the given radix, including the first-byte
// of multi-byte sequences
let src = src.as_bytes();

View File

@ -562,7 +562,7 @@ macro_rules! derive_pattern_clone {
}
/// This macro generates two public iterator structs
/// wrapping an private internal one that makes use of the `Pattern` API.
/// wrapping a private internal one that makes use of the `Pattern` API.
///
/// For all patterns `P: Pattern<'a>` the following items will be
/// generated (generics omitted):

View File

@ -16,7 +16,7 @@ use test;
mod parse;
mod rawfp;
// Take an float literal, turn it into a string in various ways (that are all trusted
// Take a float literal, turn it into a string in various ways (that are all trusted
// to be correct) and see if those strings are parsed back to the value of the literal.
// Requires a *polymorphic literal*, i.e. one that can serve as f64 as well as f32.
macro_rules! test_literal {

View File

@ -578,7 +578,7 @@ impl<'ast> Map<'ast> {
}
}
/// Given a node ID, get a list of of attributes associated with the AST
/// Given a node ID, get a list of attributes associated with the AST
/// corresponding to the Node ID
pub fn attrs(&self, id: NodeId) -> &'ast [ast::Attribute] {
let attrs = match self.find(id) {

View File

@ -913,7 +913,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
self.consume_expr(&*arm.body);
}
/// Walks an pat that occurs in isolation (i.e. top-level of fn
/// Walks a pat that occurs in isolation (i.e. top-level of fn
/// arg or let binding. *Not* a match arm or nested pat.)
fn walk_irrefutable_pat(&mut self, cmt_discr: mc::cmt<'tcx>, pat: &hir::Pat) {
let mut mode = Unknown;
@ -1136,7 +1136,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
}
hir::PatIdent(_, _, Some(_)) => {
// Do nothing; this is a binding (not a enum
// Do nothing; this is a binding (not an enum
// variant or struct), and the cat_pattern call
// will visit the substructure recursively.
}
@ -1145,7 +1145,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
hir::PatRegion(..) | hir::PatLit(..) | hir::PatRange(..) |
hir::PatVec(..) => {
// Similarly, each of these cases does not
// correspond to a enum variant or struct, so we
// correspond to an enum variant or struct, so we
// do not do any `matched_pat` calls for these
// cases either.
}

View File

@ -567,7 +567,7 @@ pub fn plug_leaks<'a,'tcx,T>(infcx: &InferCtxt<'a,'tcx>,
// Compute a mapping from the "taint set" of each skolemized
// region back to the `ty::BoundRegion` that it originally
// represented. Because `leak_check` passed, we know that that
// represented. Because `leak_check` passed, we know that
// these taint sets are mutually disjoint.
let inv_skol_map: FnvHashMap<ty::Region, ty::BoundRegion> =
skol_map

View File

@ -2394,7 +2394,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
/// errors as if there is no applicable impl, but rather report
/// errors are about mismatched argument types.
///
/// Here is an example. Imagine we have an closure expression
/// Here is an example. Imagine we have a closure expression
/// and we desugared it so that the type of the expression is
/// `Closure`, and `Closure` expects an int as argument. Then it
/// is "as if" the compiler generated this impl:

View File

@ -408,7 +408,7 @@ pub fn upcast<'tcx>(tcx: &ty::ctxt<'tcx>,
.collect()
}
/// Given an trait `trait_ref`, returns the number of vtable entries
/// Given a trait `trait_ref`, returns the number of vtable entries
/// that come from `trait_ref`, excluding its supertraits. Used in
/// computing the vtable base for an upcast trait of a trait object.
pub fn count_own_vtable_entries<'tcx>(tcx: &ty::ctxt<'tcx>,

View File

@ -48,7 +48,7 @@ pub enum AutoAdjustment<'tcx> {
///
/// 1. The simplest cases are where the pointer is not adjusted fat vs thin.
/// Here the pointer will be dereferenced N times (where a dereference can
/// happen to to raw or borrowed pointers or any smart pointer which implements
/// happen to raw or borrowed pointers or any smart pointer which implements
/// Deref, including Box<_>). The number of dereferences is given by
/// `autoderefs`. It can then be auto-referenced zero or one times, indicated
/// by `autoref`, to either a raw or borrowed pointer. In these cases unsize is

View File

@ -126,7 +126,7 @@ pub enum TypeVariants<'tcx> {
TyRef(&'tcx Region, TypeAndMut<'tcx>),
/// If the def-id is Some(_), then this is the type of a specific
/// fn item. Otherwise, if None(_), it a fn pointer type.
/// fn item. Otherwise, if None(_), it is a fn pointer type.
///
/// FIXME: Conflating function pointers and the type of a
/// function is probably a terrible idea; a function pointer is a

View File

@ -159,7 +159,7 @@ pub struct FragmentSets {
/// FIXME(pnkfelix) probably do not want/need
/// `parents_of_fragments` at all, if we can avoid it.
///
/// Update: I do not see a way to to avoid it. Maybe just remove
/// Update: I do not see a way to avoid it. Maybe just remove
/// above fixme, or at least document why doing this may be hard.
parents_of_fragments: Vec<MovePathIndex>,

View File

@ -373,7 +373,7 @@ const DOWNCAST_PRINTED_OPERATOR: &'static str = " as ";
// A local, "cleaned" version of `mc::InteriorKind` that drops
// information that is not relevant to loan-path analysis. (In
// particular, the distinction between how precisely a array-element
// particular, the distinction between how precisely an array-element
// is tracked is irrelevant here.)
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub enum InteriorKind {

View File

@ -963,8 +963,8 @@ fn insert_lllocals<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>,
// leaving the remainder of the tuple `(_,
// D(B))` still to be dropped in the future.
//
// Thus, here we must must zero the place that
// we are moving *from*, because we do not yet
// Thus, here we must zero the place that we
// are moving *from*, because we do not yet
// track drop flags for a fragmented parent
// match input expression.
//

View File

@ -339,7 +339,7 @@ pub fn trans_fn_pointer_shim<'a, 'tcx>(
let llargs = get_params(fcx.llfn);
let self_idx = fcx.arg_offset();
// the first argument (`self`) will be ptr to the the fn pointer
// the first argument (`self`) will be ptr to the fn pointer
let llfnpointer = if is_by_ref {
Load(bcx, llargs[self_idx])
} else {

View File

@ -809,7 +809,7 @@ pub fn type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
let mut type_map = debug_context(cx).type_map.borrow_mut();
if already_stored_in_typemap {
// Also make sure that we already have a TypeMap entry entry for the unique type id.
// Also make sure that we already have a TypeMap entry for the unique type id.
let metadata_for_uid = match type_map.find_metadata_for_unique_id(unique_type_id) {
Some(metadata) => metadata,
None => {

View File

@ -2526,7 +2526,7 @@ impl OverflowOpViaInputCheck {
// Note that the mask's value is derived from the LHS type
// (since that is where the 32/64 distinction is relevant) but
// the mask's type must match the RHS type (since they will
// both be fed into a and-binop)
// both be fed into an and-binop)
let invert_mask = shift_mask_val(bcx, lhs_llty, rhs_llty, true);
let outer_bits = And(bcx, rhs, invert_mask, binop_debug_loc);

View File

@ -203,9 +203,9 @@ pub enum DropGlueKind<'tcx> {
/// Skips the dtor, if any, for ty; drops the contents directly.
/// Note that the dtor is only skipped at the most *shallow*
/// level, namely, an `impl Drop for Ty` itself. So, for example,
/// if Ty is Newtype(S) then only the Drop impl for for Newtype
/// itself will be skipped, while the Drop impl for S, if any,
/// will be invoked.
/// if Ty is Newtype(S) then only the Drop impl for Newtype itself
/// will be skipped, while the Drop impl for S, if any, will be
/// invoked.
TyContents(Ty<'tcx>),
}

View File

@ -1221,8 +1221,8 @@ fn try_intrinsic<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
// MSVC's definition of the `rust_try` function. The exact implementation here
// is a little different than the GNU (standard) version below, not only because
// of the personality function but also because of the other fiddly bits about
// SEH. LLVM also currently requires us to structure this a very particular way
// as explained below.
// SEH. LLVM also currently requires us to structure this in a very particular
// way as explained below.
//
// Like with the GNU version we generate a shim wrapper
fn trans_msvc_try<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,

View File

@ -476,8 +476,7 @@ fn trans_trait_callee_from_llval<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
/// }
///
/// What is the value of `x` when `foo` is invoked with `T=SomeTrait`?
/// The answer is that it it is a shim function generate by this
/// routine:
/// The answer is that it is a shim function generated by this routine:
///
/// fn shim(t: &SomeTrait) -> int {
/// // ... call t.get() virtually ...

View File

@ -361,7 +361,7 @@ pub fn in_memory_type_of<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) ->
let repr = adt::represent_type(cx, t);
// Unboxed closures can have substitutions in all spaces
// inherited from their environment, so we use entire
// contents of the VecPerParamSpace to to construct the llvm
// contents of the VecPerParamSpace to construct the llvm
// name
adt::incomplete_type_of(cx, &*repr, "closure")
}

View File

@ -347,7 +347,7 @@ fn create_region_substs<'tcx>(
{
let tcx = this.tcx();
// If the type is parameterized by the this region, then replace this
// If the type is parameterized by this region, then replace this
// region with the current anon region binding (in other words,
// whatever & would get replaced with).
let expected_num_region_params = decl_generics.regions.len(TypeSpace);
@ -1238,7 +1238,7 @@ fn one_bound_for_assoc_type<'tcx>(tcx: &ty::ctxt<'tcx>,
Ok(bounds[0].clone())
}
// Create a type from a a path to an associated type.
// Create a type from a path to an associated type.
// For a path A::B::C::D, ty and ty_path_def are the type and def for A::B::C
// and item_segment is the path segment for D. We return a type and a def for
// the whole path.

View File

@ -185,7 +185,7 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
for predicate in predicates {
// (We do not need to worry about deep analysis of type
// expressions etc because the Drop impls are already forced
// to take on a structure that is roughly a alpha-renaming of
// to take on a structure that is roughly an alpha-renaming of
// the generic parameters of the item definition.)
// This path now just checks *all* predicates via the direct

View File

@ -1878,7 +1878,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
// If there are no more fallbacks to apply at this point we have applied all possible
// defaults and type inference will procede as normal.
// defaults and type inference will proceed as normal.
if unbound_tyvars.is_empty() {
break;
}
@ -2222,7 +2222,7 @@ fn make_overloaded_lvalue_return_type<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
{
match method {
Some(method) => {
// extract method method return type, which will be &T;
// extract method return type, which will be &T;
// all LB regions should have been instantiated during method lookup
let ret_ty = method.ty.fn_ret();
let ret_ty = fcx.tcx().no_late_bound_regions(&ret_ty).unwrap().unwrap();
@ -4106,7 +4106,7 @@ fn check_const_with_ty<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
// Gather locals in statics (because of block expressions).
// This is technically unnecessary because locals in static items are forbidden,
// but prevents type checking from blowing up before const checking can properly
// emit a error.
// emit an error.
GatherLocalsVisitor { fcx: fcx }.visit_expr(e);
check_expr_with_hint(fcx, e, declty);
@ -4360,7 +4360,7 @@ pub fn instantiate_path<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
// parameters permitted at present, but perhaps we will allow
// them in the future.)
//
// 1b. Reference to a enum variant or tuple-like struct:
// 1b. Reference to an enum variant or tuple-like struct:
//
// struct foo<T>(...)
// enum E<T> { foo(...) }

View File

@ -77,7 +77,7 @@
//! borrowed pointer? I mean any data that is reached by first
//! dereferencing a borrowed pointer and then either traversing
//! interior offsets or boxes. We say that the guarantor
//! of such data it the region of the borrowed pointer that was
//! of such data is the region of the borrowed pointer that was
//! traversed. This is essentially the same as the ownership
//! relation, except that a borrowed pointer never owns its
//! contents.

View File

@ -507,7 +507,7 @@ impl<'tcx> GetTypeParameterBounds<'tcx> for ty::GenericPredicates<'tcx> {
/// Find bounds from hir::Generics. This requires scanning through the
/// AST. We do this to avoid having to convert *all* the bounds, which
/// would create artificial cycles. Instead we can only convert the
/// bounds for those a type parameter `X` if `X::Foo` is used.
/// bounds for a type parameter `X` if `X::Foo` is used.
impl<'tcx> GetTypeParameterBounds<'tcx> for hir::Generics {
fn get_type_parameter_bounds(&self,
astconv: &AstConv<'tcx>,

View File

@ -109,7 +109,7 @@ fn main(){
"##,
E0026: r##"
This error indicates that a struct pattern attempted to extract a non-existant
This error indicates that a struct pattern attempted to extract a non-existent
field from a struct. Struct fields are identified by the name used before the
colon `:` so struct patterns should resemble the declaration of the struct type
being matched.
@ -3352,7 +3352,7 @@ register_diagnostics! {
E0182,
E0183,
// E0187, // can't infer the kind of the closure
// E0188, // can not cast a immutable reference to a mutable pointer
// E0188, // can not cast an immutable reference to a mutable pointer
// E0189, // deprecated: can only cast a boxed pointer to a boxed object
// E0190, // deprecated: can only cast a &-pointer to an &-object
E0196, // cannot determine a type for this closure

View File

@ -153,7 +153,7 @@ impl<'a, 'tcx> Clean<Crate> for visit_ast::RustdocVisitor<'a, 'tcx> {
//
// Note that this loop only searches the top-level items of the crate,
// and this is intentional. If we were to search the entire crate for an
// item tagged with `#[doc(primitive)]` then we we would also have to
// item tagged with `#[doc(primitive)]` then we would also have to
// search the entirety of external modules for items tagged
// `#[doc(primitive)]`, which is a pretty inefficient process (decoding
// all that metadata unconditionally).

View File

@ -55,8 +55,8 @@ pub struct TocBuilder {
/// strictly increasing (i.e. chain[0].level < chain[1].level <
/// ...) with each entry being the most recent occurrence of a
/// heading with that level (it doesn't include the most recent
/// occurrences of every level, just, if *is* in `chain` then is is
/// the most recent one).
/// occurrences of every level, just, if it *is* in `chain` then
/// it is the most recent one).
///
/// We also have `chain[0].level <= top_level.entries[last]`.
chain: Vec<TocEntry>

View File

@ -546,7 +546,7 @@ impl<W> IntoInnerError<W> {
/// let stream = match stream.into_inner() {
/// Ok(s) => s,
/// Err(e) => {
/// // Here, e is a IntoInnerError, let's re-examine the buffer:
/// // Here, e is an IntoInnerError, let's re-examine the buffer:
/// let buffer = e.into_inner();
///
/// // do stuff to try to recover

View File

@ -23,7 +23,7 @@
//! Because they are traits, they're implemented by a number of other types,
//! and you can implement them for your types too. As such, you'll see a
//! few different types of I/O throughout the documentation in this module:
//! `File`s, `TcpStream`s, and somtimes even `Vec<T>`s. For example, `Read`
//! `File`s, `TcpStream`s, and sometimes even `Vec<T>`s. For example, `Read`
//! adds a `read()` method, which we can use on `File`s:
//!
//! ```
@ -234,7 +234,7 @@
//! The return type of `read_input()`, `io::Result<()>`, is a very common type
//! for functions which don't have a 'real' return value, but do want to return
//! errors if they happen. In this case, the only purpose of this function is
//! to read the line and print it, so we use use `()`.
//! to read the line and print it, so we use `()`.
//!
//! [result]: type.Result.html
//! [try]: macro.try!.html

View File

@ -146,7 +146,7 @@ pub struct Stdin {
inner: Arc<Mutex<BufReader<Maybe<StdinRaw>>>>,
}
/// A locked reference to the a `Stdin` handle.
/// A locked reference to the `Stdin` handle.
///
/// This handle implements both the `Read` and `BufRead` traits and is
/// constructed via the `lock` method on `Stdin`.
@ -323,7 +323,7 @@ pub struct Stdout {
inner: Arc<ReentrantMutex<RefCell<LineWriter<Maybe<StdoutRaw>>>>>,
}
/// A locked reference to the a `Stdout` handle.
/// A locked reference to the `Stdout` handle.
///
/// This handle implements the `Write` trait and is constructed via the `lock`
/// method on `Stdout`.
@ -430,7 +430,7 @@ pub struct Stderr {
inner: Arc<ReentrantMutex<RefCell<Maybe<StderrRaw>>>>,
}
/// A locked reference to the a `Stderr` handle.
/// A locked reference to the `Stderr` handle.
///
/// This handle implements the `Write` trait and is constructed via the `lock`
/// method on `Stderr`.

View File

@ -22,7 +22,7 @@ use libc;
use sys_common::{AsInner, FromInner};
use net::{hton, ntoh};
/// An IP address, either a IPv4 or IPv6 address.
/// An IP address, either an IPv4 or IPv6 address.
#[unstable(feature = "ip_addr", reason = "recent addition", issue = "27801")]
#[derive(Copy, Clone, Eq, PartialEq, Debug, Hash, PartialOrd, Ord)]
pub enum IpAddr {

View File

@ -74,7 +74,7 @@
//! [`Eq`](../cmp/trait.Eq.html),
//! [`Ord`](../cmp/trait.Ord.html)
//! }.
//! The comparision traits, which implement the comparison operators
//! The comparison traits, which implement the comparison operators
//! and are often seen in trait bounds.
//! * `std::convert::`{
//! [`AsRef`](../convert/trait.AsRef.html),

View File

@ -427,7 +427,7 @@ impl<T> UnsafeFlavor<T> for Receiver<T> {
/// use std::sync::mpsc::channel;
/// use std::thread;
///
/// // tx is is the sending half (tx for transmission), and rx is the receiving
/// // tx is the sending half (tx for transmission), and rx is the receiving
/// // half (rx for receiving).
/// let (tx, rx) = channel();
///

View File

@ -146,13 +146,13 @@ impl fmt::Debug for Wtf8Buf {
}
impl Wtf8Buf {
/// Creates an new, empty WTF-8 string.
/// Creates a new, empty WTF-8 string.
#[inline]
pub fn new() -> Wtf8Buf {
Wtf8Buf { bytes: Vec::new() }
}
/// Creates an new, empty WTF-8 string with pre-allocated capacity for `n` bytes.
/// Creates a new, empty WTF-8 string with pre-allocated capacity for `n` bytes.
#[inline]
pub fn with_capacity(n: usize) -> Wtf8Buf {
Wtf8Buf { bytes: Vec::with_capacity(n) }

View File

@ -39,7 +39,7 @@ pub trait CommandExt {
/// This is not enough to create a daemon process. The *init* process should
/// be the child reaper of a daemon. This can be achieved if the parent
/// process exit. Moreover, a daemon should not have a controlling terminal.
/// To acheive this, a session leader (the child) must spawn another process
/// To achieve this, a session leader (the child) must spawn another process
/// (the daemon) in the same session.
#[unstable(feature = "process_session_leader", reason = "recently added",
issue = "27811")]

View File

@ -49,7 +49,7 @@ pub mod time;
pub mod stdio;
pub fn init() {
// By default, some platforms will send a *signal* when a EPIPE error
// By default, some platforms will send a *signal* when an EPIPE error
// would otherwise be delivered. This runtime doesn't install a SIGPIPE
// handler, causing it to kill the program, which isn't exactly what we
// want!

View File

@ -75,8 +75,8 @@ fn to_utf16_os(s: &OsStr) -> Vec<u16> {
v
}
// Many Windows APIs follow a pattern of where we hand the a buffer and then
// they will report back to us how large the buffer should be or how many bytes
// Many Windows APIs follow a pattern of where we hand a buffer and then they
// will report back to us how large the buffer should be or how many bytes
// currently reside in the buffer. This function is an abstraction over these
// functions by making them easier to call.
//

View File

@ -22,7 +22,7 @@
//! more details.
//!
//! 3. While CriticalSection is fair and SRWLock is not, the current Rust policy
//! is there there are no guarantees of fairness.
//! is that there are no guarantees of fairness.
//!
//! The downside of this approach, however, is that SRWLock is not available on
//! Windows XP, so we continue to have a fallback implementation where

View File

@ -600,7 +600,7 @@ impl<'a> ExtCtxt<'a> {
self.expander().fold_expr(e)
}
/// Returns a `Folder` for deeply expanding all macros in a AST node.
/// Returns a `Folder` for deeply expanding all macros in an AST node.
pub fn expander<'b>(&'b mut self) -> expand::MacroExpander<'b, 'a> {
expand::MacroExpander::new(self)
}

View File

@ -32,7 +32,7 @@
//! As it processes them, it fills up `eof_eis` with items that would be valid if
//! the macro invocation is now over, `bb_eis` with items that are waiting on
//! a Rust nonterminal like `$e:expr`, and `next_eis` with items that are waiting
//! on the a particular token. Most of the logic concerns moving the · through the
//! on a particular token. Most of the logic concerns moving the · through the
//! repetitions indicated by Kleene stars. It only advances or calls out to the
//! real Rust parser when no `cur_eis` items remain
//!

View File

@ -497,7 +497,7 @@ fn is_in_follow(_: &ExtCtxt, tok: &Token, frag: &str) -> Result<bool, String> {
Ok(true)
},
"block" => {
// anything can follow block, the braces provide a easy boundary to
// anything can follow block, the braces provide an easy boundary to
// maintain
Ok(true)
},

View File

@ -1107,8 +1107,7 @@ pub enum UnstableFeatures {
/// Errors are bypassed for bootstrapping. This is required any time
/// during the build that feature-related lints are set to warn or above
/// because the build turns on warnings-as-errors and uses lots of unstable
/// features. As a result, this this is always required for building Rust
/// itself.
/// features. As a result, this is always required for building Rust itself.
Cheat
}

View File

@ -250,7 +250,7 @@ LLVMRustWriteOutputFile(LLVMTargetMachineRef Target,
#endif
PM->run(*unwrap(M));
// Apparently `addPassesToEmitFile` adds an pointer to our on-the-stack output
// Apparently `addPassesToEmitFile` adds a pointer to our on-the-stack output
// stream (OS), so the only real safe place to delete this is here? Don't we
// wish this was written in Rust?
delete PM;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Test that we report an error if the trait ref in an qualified type
// Test that we report an error if the trait ref in a qualified type
// uses invalid type arguments.
trait Foo<T> {

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Check that an constant-evaluation underflow highlights the correct
// Check that a constant-evaluation underflow highlights the correct
// spot (where the underflow occurred), while also providing the
// overall context for what caused the evaluation.

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Check that an constant-evaluation underflow highlights the correct
// Check that a constant-evaluation underflow highlights the correct
// spot (where the underflow occurred).
const ONE: usize = 1;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Check that a arena (TypedArena) cannot carry elements whose drop
// Check that an arena (TypedArena) cannot carry elements whose drop
// methods might access borrowed data of lifetime that does not
// strictly outlive the arena itself.
//
@ -30,7 +30,7 @@ struct CheckId<T:HasId> { v: T }
// In the code below, the impl of HasId for `&'a usize` does not
// actually access the borrowed data, but the point is that the
// interface to CheckId does not (and cannot) know that, and therefore
// when encountering the a value V of type CheckId<S>, we must
// when encountering a value V of type CheckId<S>, we must
// conservatively force the type S to strictly outlive V.
impl<T:HasId> Drop for CheckId<T> {
fn drop(&mut self) {

View File

@ -9,7 +9,7 @@
// except according to those terms.
// Reject mixing cyclic structure and Drop when using trait
// objects to hide the the cross-references.
// objects to hide the cross-references.
//
// (Compare against compile-fail/dropck_vec_cycle_checked.rs)

View File

@ -9,7 +9,7 @@
// except according to those terms.
// Test that we can parse a unit struct with a where clause, even if
// it leads to a error later on since `T` is unused.
// it leads to an error later on since `T` is unused.
struct Foo<T> where T: Copy; //~ ERROR parameter `T` is never used

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! Test that when a crate is linked under another name that that name is used in global paths
//! Test that when a crate is linked under another name that name is used in global paths
extern crate core as bar;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Creating a stack closure which references an box and then
// Creating a stack closure which references a box and then
// transferring ownership of the box before invoking the stack
// closure results in a crash.

View File

@ -37,7 +37,7 @@ pub struct WithHrAssoc<T>
}
fn with_assoc<'a,'b>() {
// We get an error because beacuse 'b:'a does not hold:
// We get an error because 'b:'a does not hold:
let _: &'a WithHrAssoc<TheType<'b>> = loop { };
//~^ ERROR reference has a longer lifetime

View File

@ -12,7 +12,7 @@
use std::marker::PhantomData;
// A erroneous variant of `run-pass/unboxed_closures-infer-recursive-fn.rs`
// An erroneous variant of `run-pass/unboxed_closures-infer-recursive-fn.rs`
// where we attempt to perform mutation in the recursive function. This fails to compile
// because it winds up requiring `FnMut` which enforces linearity.

View File

@ -48,7 +48,7 @@ struct Test5<'a, 'b:'a> { //~ ERROR regions=[[+, o];[];[]]
// Invariance is a trap from which NO ONE CAN ESCAPE.
// In other words, even though the `&'b isize` occurs in
// a argument list (which is contravariant), that
// an argument list (which is contravariant), that
// argument list occurs in an invariant context.
#[rustc_variance]

View File

@ -11,7 +11,7 @@
// error-pattern:stop
// #18576
// Make sure that an calling extern function pointer in an unreachable
// Make sure that calling an extern function pointer in an unreachable
// context doesn't cause an LLVM assertion
#[allow(unreachable_code)]

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Check that a arena (TypedArena) can carry elements whose drop
// Check that an arena (TypedArena) can carry elements whose drop
// methods might access borrowed data, as long as the borrowed data
// has lifetime that strictly outlives the arena itself.
//

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Ensure that an user-defined type admits multiple inherent methods
// Ensure that a user-defined type admits multiple inherent methods
// with the same name, which can be called on values that have a
// precise enough type to allow distinguishing between the methods.

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Regression test for #24085. Errors were occuring in region
// Regression test for #24085. Errors were occurring in region
// inference due to the requirement that `'a:b'`, which was getting
// incorrectly translated in connection with the closure below.