Skip to content

Commit

Permalink
'iff' for docs to 'if and only if'
Browse files Browse the repository at this point in the history
  • Loading branch information
Esption committed Jul 9, 2015
1 parent 492f33a commit dad8cd1
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/libbacktrace/aclocal.m4
Expand Up @@ -88,7 +88,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# if we strip the leading $srcdir from $ac_aux_dir. That would be:
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
Expand Down
2 changes: 1 addition & 1 deletion src/libbacktrace/hashtab.h
Expand Up @@ -69,7 +69,7 @@ typedef void (*htab_del) (void *);
typedef int (*htab_trav) (void **, void *);

/* Memory-allocation function, with the same functionality as calloc().
If it returns NULL, the hash table implementation will pass an error
Iff it returns NULL, the hash table implementation will pass an error
code back to the user, so if your code doesn't handle errors,
best if you use xcalloc instead. */
typedef void *(*htab_alloc) (size_t, size_t);
Expand Down
10 changes: 5 additions & 5 deletions src/libbacktrace/ltmain.sh
Expand Up @@ -1059,7 +1059,7 @@ $opt_help || {


# func_lalib_p file
# True if FILE is a libtool `.la' library or `.lo' object file.
# True iff FILE is a libtool `.la' library or `.lo' object file.
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_lalib_p ()
Expand All @@ -1070,7 +1070,7 @@ func_lalib_p ()
}

# func_lalib_unsafe_p file
# True if FILE is a libtool `.la' library or `.lo' object file.
# True iff FILE is a libtool `.la' library or `.lo' object file.
# This function implements the same check as func_lalib_p without
# resorting to external programs. To this end, it redirects stdin and
# closes it afterwards, without saving the original file descriptor.
Expand All @@ -1093,7 +1093,7 @@ func_lalib_unsafe_p ()
}

# func_ltwrapper_script_p file
# True if FILE is a libtool wrapper script
# True iff FILE is a libtool wrapper script
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_ltwrapper_script_p ()
Expand All @@ -1102,7 +1102,7 @@ func_ltwrapper_script_p ()
}

# func_ltwrapper_executable_p file
# True if FILE is a libtool wrapper executable
# True iff FILE is a libtool wrapper executable
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_ltwrapper_executable_p ()
Expand Down Expand Up @@ -1130,7 +1130,7 @@ func_ltwrapper_scriptname ()
}

# func_ltwrapper_p file
# True if FILE is a libtool wrapper script or wrapper executable
# True iff FILE is a libtool wrapper script or wrapper executable
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_ltwrapper_p ()
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/vec_deque.rs
Expand Up @@ -108,7 +108,7 @@ impl<T> VecDeque<T> {
ptr::write(self.ptr.offset(off as isize), t);
}

/// Returns true if the buffer is at capacity
/// Returns true if and only if the buffer is at capacity
#[inline]
fn is_full(&self) -> bool { self.cap - self.len() == 1 }

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/mod.rs
Expand Up @@ -1126,7 +1126,7 @@ macro_rules! uint_impl {
acc
}

/// Returns `true` if `self == 2^k` for some `k`.
/// Returns `true` if and only if `self == 2^k` for some `k`.
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn is_power_of_two(self) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/str/pattern.rs
Expand Up @@ -739,7 +739,7 @@ struct TwoWaySearcher {
(We also allow for the possibility of the *empty word*, a word of length zero).
If x is any non-empty word, then an integer p with 0 < p <= |x| is said to be a
*period* for x if for all i with 0 <= i <= |x| - p - 1, we have x[i] == x[i+p].
*period* for x iff for all i with 0 <= i <= |x| - p - 1, we have x[i] == x[i+p].
For example, both 1 and 2 are periods for the string "aa". As another example,
the only period of the string "abcd" is 4.
Expand Down
2 changes: 1 addition & 1 deletion src/librand/distributions/gamma.rs
Expand Up @@ -147,7 +147,7 @@ impl IndependentSample<f64> for GammaLargeShape {
loop {
let StandardNormal(x) = rng.gen::<StandardNormal>();
let v_cbrt = 1.0 + self.c * x;
if v_cbrt <= 0.0 { // a^3 <= 0 if a <= 0
if v_cbrt <= 0.0 { // a^3 <= 0 iff a <= 0
continue
}

Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/ty.rs
Expand Up @@ -509,9 +509,9 @@ pub struct ItemVariances {

#[derive(Clone, PartialEq, RustcDecodable, RustcEncodable, Copy)]
pub enum Variance {
Covariant, // T<A> <: T<B> if A <: B -- e.g., function return type
Invariant, // T<A> <: T<B> if B == A -- e.g., type of mutable cell
Contravariant, // T<A> <: T<B> if B <: A -- e.g., function param type
Covariant, // T<A> <: T<B> iff A <: B -- e.g., function return type
Invariant, // T<A> <: T<B> iff B == A -- e.g., type of mutable cell
Contravariant, // T<A> <: T<B> iff B <: A -- e.g., function param type
Bivariant, // T<A> <: T<B> -- e.g., unused type parameter
}

Expand Down
4 changes: 2 additions & 2 deletions src/librustc/util/common.rs
Expand Up @@ -145,7 +145,7 @@ impl<'v, P> Visitor<'v> for LoopQueryVisitor<P> where P: FnMut(&ast::Expr_) -> b
}
}

// Takes a predicate p, returns true if p is true for any subexpressions
// Takes a predicate p, returns true iff p is true for any subexpressions
// of b -- skipping any inner loops (loop, while, loop_body)
pub fn loop_query<P>(b: &ast::Block, p: P) -> bool where P: FnMut(&ast::Expr_) -> bool {
let mut v = LoopQueryVisitor {
Expand All @@ -168,7 +168,7 @@ impl<'v, P> Visitor<'v> for BlockQueryVisitor<P> where P: FnMut(&ast::Expr) -> b
}
}

// Takes a predicate p, returns true if p is true for any subexpressions
// Takes a predicate p, returns true iff p is true for any subexpressions
// of b -- skipping any inner loops (loop, while, loop_body)
pub fn block_query<P>(b: &ast::Block, p: P) -> bool where P: FnMut(&ast::Expr) -> bool {
let mut v = BlockQueryVisitor {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_borrowck/borrowck/README.md
Expand Up @@ -877,7 +877,7 @@ Thus the presence of an assignment bit indicates that the assignment
may have occurred. Note that assignments are only killed when the
variable goes out of scope, as it is not relevant whether or not there
has been a move in the meantime. Using these bits, we can declare that
an assignment to an immutable variable is legal if there is no other
an assignment to an immutable variable is legal iff there is no other
assignment bit to that same variable in scope.

## Why is the design made this way?
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_privacy/lib.rs
Expand Up @@ -1319,7 +1319,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for VisiblePrivateTypesVisitor<'a, 'tcx> {

// miscellaneous info about the impl

// `true` if this is `impl Private for ...`.
// `true` iff this is `impl Private for ...`.
let not_private_trait =
trait_ref.as_ref().map_or(true, // no trait counts as public trait
|tr| {
Expand All @@ -1328,7 +1328,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for VisiblePrivateTypesVisitor<'a, 'tcx> {
!is_local(did) || self.trait_is_public(did.node)
});

// `true` if this is a trait impl or at least one method is public.
// `true` iff this is a trait impl or at least one method is public.
//
// `impl Public { $( fn ...() {} )* }` is not visible.
//
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/variance.rs
Expand Up @@ -216,7 +216,7 @@
//! this case, because the `Self` parameter is contravariant and `A` is
//! covariant, it means that:
//!
//! V_O <: V_S if
//! V_O <: V_S iff
//! int <: int
//! String <: Object
//!
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/net/parser.rs
Expand Up @@ -104,7 +104,7 @@ impl<'a> Parser<'a> {
}
}

// Return char and advance if next char is equal to requested
// Return char and advance iff next char is equal to requested
fn read_given_char(&mut self, c: char) -> Option<char> {
self.read_atomically(|p| {
match p.read_char() {
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ext/tt/macro_parser.rs
Expand Up @@ -321,7 +321,7 @@ pub fn parse(sess: &ParseSess,
if idx >= len {
// can't move out of `match`es, so:
if ei.up.is_some() {
// hack: a matcher sequence is repeating if it has a
// hack: a matcher sequence is repeating iff it has a
// parent (the top level is just a container)


Expand Down
Expand Up @@ -15,7 +15,7 @@
// variance inference works in the first place.

// This is contravariant with respect to 'a, meaning that
// Contravariant<'long> <: Contravariant<'short> if
// Contravariant<'long> <: Contravariant<'short> iff
// 'short <= 'long
struct Contravariant<'a> {
f: &'a isize
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/deriving-cmp-shortcircuit.rs
Expand Up @@ -10,7 +10,7 @@

// check that the derived impls for the comparison traits shortcircuit
// where possible, by having a type that panics when compared as the
// second element, so this passes if the instances shortcircuit.
// second element, so this passes iff the instances shortcircuit.


use std::cmp::Ordering;
Expand Down
Expand Up @@ -24,7 +24,7 @@ struct Covariant<'a> {
}

fn use_<'a>(c: Covariant<'a>) {
// OK Because Covariant<'a> <: Covariant<'static> if 'a <= 'static
// OK Because Covariant<'a> <: Covariant<'static> iff 'a <= 'static
let _: Covariant<'static> = c;
}

Expand Down

0 comments on commit dad8cd1

Please sign in to comment.