unequal → not equal
This commit is contained in:
parent
e4b9f86054
commit
e5a5b90afc
@ -306,7 +306,7 @@ fn kill_borrows_on_place(&self, trans: &mut impl GenKill<BorrowIndex>, place: Pl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// By passing `PlaceConflictBias::NoOverlap`, we conservatively assume that any given
|
// By passing `PlaceConflictBias::NoOverlap`, we conservatively assume that any given
|
||||||
// pair of array indices are unequal, so that when `places_conflict` returns true, we
|
// pair of array indices are not equal, so that when `places_conflict` returns true, we
|
||||||
// will be assured that two places being compared definitely denotes the same sets of
|
// will be assured that two places being compared definitely denotes the same sets of
|
||||||
// locations.
|
// locations.
|
||||||
let definitely_conflicting_borrows = other_borrows_of_local.filter(|&i| {
|
let definitely_conflicting_borrows = other_borrows_of_local.filter(|&i| {
|
||||||
|
@ -23,6 +23,6 @@ Or maybe did you mean to unify? Consider using a guard:
|
|||||||
# let (A, B, C) = (1, 2, 3);
|
# let (A, B, C) = (1, 2, 3);
|
||||||
match (A, B, C) {
|
match (A, B, C) {
|
||||||
(x, x2, see) if x == x2 => { /* A and B are equal, do one thing */ }
|
(x, x2, see) if x == x2 => { /* A and B are equal, do one thing */ }
|
||||||
(y, z, see) => { /* A and B unequal; do another thing */ }
|
(y, z, see) => { /* A and B not equal; do another thing */ }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -367,7 +367,7 @@ fn with(self, other: LockstepIterSize) -> LockstepIterSize {
|
|||||||
///
|
///
|
||||||
/// Example: `$($($x $y)+*);+` -- we need to make sure that `x` and `y` repeat the same amount as
|
/// Example: `$($($x $y)+*);+` -- we need to make sure that `x` and `y` repeat the same amount as
|
||||||
/// each other at the given depth when the macro was invoked. If they don't it might mean they were
|
/// each other at the given depth when the macro was invoked. If they don't it might mean they were
|
||||||
/// declared at unequal depths or there was a compile bug. For example, if we have 3 repetitions of
|
/// declared at depths which weren't equal or there was a compiler bug. For example, if we have 3 repetitions of
|
||||||
/// the outer sequence and 4 repetitions of the inner sequence for `x`, we should have the same for
|
/// the outer sequence and 4 repetitions of the inner sequence for `x`, we should have the same for
|
||||||
/// `y`; otherwise, we can't transcribe them both at the given depth.
|
/// `y`; otherwise, we can't transcribe them both at the given depth.
|
||||||
fn lockstep_iter_size(
|
fn lockstep_iter_size(
|
||||||
|
@ -1081,7 +1081,7 @@ pub enum Rvalue<'tcx> {
|
|||||||
/// Same as `BinaryOp`, but yields `(T, bool)` with a `bool` indicating an error condition.
|
/// Same as `BinaryOp`, but yields `(T, bool)` with a `bool` indicating an error condition.
|
||||||
///
|
///
|
||||||
/// For addition, subtraction, and multiplication on integers the error condition is set when
|
/// For addition, subtraction, and multiplication on integers the error condition is set when
|
||||||
/// the infinite precision result would be unequal to the actual result.
|
/// the infinite precision result would not be equal to the actual result.
|
||||||
///
|
///
|
||||||
/// For shift operations on integers the error condition is set when the value of right-hand
|
/// For shift operations on integers the error condition is set when the value of right-hand
|
||||||
/// side is greater than or equal to the number of bits in the type of the left-hand side, or
|
/// side is greater than or equal to the number of bits in the type of the left-hand side, or
|
||||||
|
@ -2215,7 +2215,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Used in `super_combine_consts` to ICE if the type of the two consts are definitely not going to end up being
|
/// Used in `super_combine_consts` to ICE if the type of the two consts are definitely not going to end up being
|
||||||
/// equal to eachother. This might return `Ok` even if the types are unequal, but will never return `Err` if
|
/// equal to eachother. This might return `Ok` even if the types are not equal, but will never return `Err` if
|
||||||
/// the types might be equal.
|
/// the types might be equal.
|
||||||
query check_tys_might_be_eq(arg: Canonical<'tcx, (ty::ParamEnv<'tcx>, Ty<'tcx>, Ty<'tcx>)>) -> Result<(), NoSolution> {
|
query check_tys_might_be_eq(arg: Canonical<'tcx, (ty::ParamEnv<'tcx>, Ty<'tcx>, Ty<'tcx>)>) -> Result<(), NoSolution> {
|
||||||
desc { "check whether two const param are definitely not equal to eachother"}
|
desc { "check whether two const param are definitely not equal to eachother"}
|
||||||
|
@ -237,7 +237,7 @@ pub fn try_to_target_usize(&self, tcx: TyCtxt<'_>) -> Result<u64, Size> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Tries to convert the `ScalarInt` to an unsigned integer of the given size.
|
/// Tries to convert the `ScalarInt` to an unsigned integer of the given size.
|
||||||
/// Fails if the size of the `ScalarInt` is unequal to `size` and returns the
|
/// Fails if the size of the `ScalarInt` is not equal to `size` and returns the
|
||||||
/// `ScalarInt`s size in that case.
|
/// `ScalarInt`s size in that case.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn try_to_uint(self, size: Size) -> Result<u128, Size> {
|
pub fn try_to_uint(self, size: Size) -> Result<u128, Size> {
|
||||||
@ -297,7 +297,7 @@ pub fn try_to_u128(self) -> Result<u128, Size> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Tries to convert the `ScalarInt` to a signed integer of the given size.
|
/// Tries to convert the `ScalarInt` to a signed integer of the given size.
|
||||||
/// Fails if the size of the `ScalarInt` is unequal to `size` and returns the
|
/// Fails if the size of the `ScalarInt` is not equal to `size` and returns the
|
||||||
/// `ScalarInt`s size in that case.
|
/// `ScalarInt`s size in that case.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn try_to_int(self, size: Size) -> Result<i128, Size> {
|
pub fn try_to_int(self, size: Size) -> Result<i128, Size> {
|
||||||
@ -306,35 +306,35 @@ pub fn try_to_int(self, size: Size) -> Result<i128, Size> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Tries to convert the `ScalarInt` to i8.
|
/// Tries to convert the `ScalarInt` to i8.
|
||||||
/// Fails if the size of the `ScalarInt` is unequal to `Size { raw: 1 }`
|
/// Fails if the size of the `ScalarInt` is not equal to `Size { raw: 1 }`
|
||||||
/// and returns the `ScalarInt`s size in that case.
|
/// and returns the `ScalarInt`s size in that case.
|
||||||
pub fn try_to_i8(self) -> Result<i8, Size> {
|
pub fn try_to_i8(self) -> Result<i8, Size> {
|
||||||
self.try_to_int(Size::from_bits(8)).map(|v| i8::try_from(v).unwrap())
|
self.try_to_int(Size::from_bits(8)).map(|v| i8::try_from(v).unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Tries to convert the `ScalarInt` to i16.
|
/// Tries to convert the `ScalarInt` to i16.
|
||||||
/// Fails if the size of the `ScalarInt` is unequal to `Size { raw: 2 }`
|
/// Fails if the size of the `ScalarInt` is not equal to `Size { raw: 2 }`
|
||||||
/// and returns the `ScalarInt`s size in that case.
|
/// and returns the `ScalarInt`s size in that case.
|
||||||
pub fn try_to_i16(self) -> Result<i16, Size> {
|
pub fn try_to_i16(self) -> Result<i16, Size> {
|
||||||
self.try_to_int(Size::from_bits(16)).map(|v| i16::try_from(v).unwrap())
|
self.try_to_int(Size::from_bits(16)).map(|v| i16::try_from(v).unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Tries to convert the `ScalarInt` to i32.
|
/// Tries to convert the `ScalarInt` to i32.
|
||||||
/// Fails if the size of the `ScalarInt` is unequal to `Size { raw: 4 }`
|
/// Fails if the size of the `ScalarInt` is not equal to `Size { raw: 4 }`
|
||||||
/// and returns the `ScalarInt`s size in that case.
|
/// and returns the `ScalarInt`s size in that case.
|
||||||
pub fn try_to_i32(self) -> Result<i32, Size> {
|
pub fn try_to_i32(self) -> Result<i32, Size> {
|
||||||
self.try_to_int(Size::from_bits(32)).map(|v| i32::try_from(v).unwrap())
|
self.try_to_int(Size::from_bits(32)).map(|v| i32::try_from(v).unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Tries to convert the `ScalarInt` to i64.
|
/// Tries to convert the `ScalarInt` to i64.
|
||||||
/// Fails if the size of the `ScalarInt` is unequal to `Size { raw: 8 }`
|
/// Fails if the size of the `ScalarInt` is not equal to `Size { raw: 8 }`
|
||||||
/// and returns the `ScalarInt`s size in that case.
|
/// and returns the `ScalarInt`s size in that case.
|
||||||
pub fn try_to_i64(self) -> Result<i64, Size> {
|
pub fn try_to_i64(self) -> Result<i64, Size> {
|
||||||
self.try_to_int(Size::from_bits(64)).map(|v| i64::try_from(v).unwrap())
|
self.try_to_int(Size::from_bits(64)).map(|v| i64::try_from(v).unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Tries to convert the `ScalarInt` to i128.
|
/// Tries to convert the `ScalarInt` to i128.
|
||||||
/// Fails if the size of the `ScalarInt` is unequal to `Size { raw: 16 }`
|
/// Fails if the size of the `ScalarInt` is not equal to `Size { raw: 16 }`
|
||||||
/// and returns the `ScalarInt`s size in that case.
|
/// and returns the `ScalarInt`s size in that case.
|
||||||
pub fn try_to_i128(self) -> Result<i128, Size> {
|
pub fn try_to_i128(self) -> Result<i128, Size> {
|
||||||
self.try_to_int(Size::from_bits(128)).map(|v| i128::try_from(v).unwrap())
|
self.try_to_int(Size::from_bits(128)).map(|v| i128::try_from(v).unwrap())
|
||||||
|
@ -1738,11 +1738,11 @@ fn eq(&self, other: &Rc<T>) -> bool {
|
|||||||
|
|
||||||
/// Inequality for two `Rc`s.
|
/// Inequality for two `Rc`s.
|
||||||
///
|
///
|
||||||
/// Two `Rc`s are unequal if their inner values are unequal.
|
/// Two `Rc`s are not equal if their inner values are not equal.
|
||||||
///
|
///
|
||||||
/// If `T` also implements `Eq` (implying reflexivity of equality),
|
/// If `T` also implements `Eq` (implying reflexivity of equality),
|
||||||
/// two `Rc`s that point to the same allocation are
|
/// two `Rc`s that point to the same allocation are
|
||||||
/// never unequal.
|
/// always equal.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
@ -2475,10 +2475,10 @@ fn eq(&self, other: &Arc<T>) -> bool {
|
|||||||
|
|
||||||
/// Inequality for two `Arc`s.
|
/// Inequality for two `Arc`s.
|
||||||
///
|
///
|
||||||
/// Two `Arc`s are unequal if their inner values are unequal.
|
/// Two `Arc`s are not equal if their inner values are not equal.
|
||||||
///
|
///
|
||||||
/// If `T` also implements `Eq` (implying reflexivity of equality),
|
/// If `T` also implements `Eq` (implying reflexivity of equality),
|
||||||
/// two `Arc`s that point to the same value are never unequal.
|
/// two `Arc`s that point to the same value are always equal.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
@ -158,7 +158,7 @@
|
|||||||
///
|
///
|
||||||
/// Implementations of `hash` should ensure that the data they
|
/// Implementations of `hash` should ensure that the data they
|
||||||
/// pass to the `Hasher` are prefix-free. That is,
|
/// pass to the `Hasher` are prefix-free. That is,
|
||||||
/// unequal values should cause two different sequences of values to be written,
|
/// values which are not equal should cause two different sequences of values to be written,
|
||||||
/// and neither of the two sequences should be a prefix of the other.
|
/// and neither of the two sequences should be a prefix of the other.
|
||||||
///
|
///
|
||||||
/// For example, the standard implementation of [`Hash` for `&str`][impl] passes an extra
|
/// For example, the standard implementation of [`Hash` for `&str`][impl] passes an extra
|
||||||
|
@ -3721,7 +3721,7 @@ fn compare<X, Y, F>(mut eq: F) -> impl FnMut(X, Y) -> ControlFlow<()>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Determines if the elements of this [`Iterator`] are unequal to those of
|
/// Determines if the elements of this [`Iterator`] are not equal to those of
|
||||||
/// another.
|
/// another.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
|
@ -1110,7 +1110,7 @@ impl<T: Copy> Copy for (T,) {
|
|||||||
/// - [NaN (not a number)](#associatedconstant.NAN): this value results from
|
/// - [NaN (not a number)](#associatedconstant.NAN): this value results from
|
||||||
/// calculations like `(-1.0).sqrt()`. NaN has some potentially unexpected
|
/// calculations like `(-1.0).sqrt()`. NaN has some potentially unexpected
|
||||||
/// behavior:
|
/// behavior:
|
||||||
/// - It is unequal to any float, including itself! This is the reason `f32`
|
/// - It is not equal to any float, including itself! This is the reason `f32`
|
||||||
/// doesn't implement the `Eq` trait.
|
/// doesn't implement the `Eq` trait.
|
||||||
/// - It is also neither smaller nor greater than any float, making it
|
/// - It is also neither smaller nor greater than any float, making it
|
||||||
/// impossible to sort by the default comparison operation, which is the
|
/// impossible to sort by the default comparison operation, which is the
|
||||||
|
@ -1110,7 +1110,7 @@ impl<T: Copy> Copy for (T,) {
|
|||||||
/// - [NaN (not a number)](#associatedconstant.NAN): this value results from
|
/// - [NaN (not a number)](#associatedconstant.NAN): this value results from
|
||||||
/// calculations like `(-1.0).sqrt()`. NaN has some potentially unexpected
|
/// calculations like `(-1.0).sqrt()`. NaN has some potentially unexpected
|
||||||
/// behavior:
|
/// behavior:
|
||||||
/// - It is unequal to any float, including itself! This is the reason `f32`
|
/// - It is not equal to any float, including itself! This is the reason `f32`
|
||||||
/// doesn't implement the `Eq` trait.
|
/// doesn't implement the `Eq` trait.
|
||||||
/// - It is also neither smaller nor greater than any float, making it
|
/// - It is also neither smaller nor greater than any float, making it
|
||||||
/// impossible to sort by the default comparison operation, which is the
|
/// impossible to sort by the default comparison operation, which is the
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
/// `owner` can be checked by other threads that want to see if they already
|
/// `owner` can be checked by other threads that want to see if they already
|
||||||
/// hold the lock, so needs to be atomic. If it compares equal, we're on the
|
/// hold the lock, so needs to be atomic. If it compares equal, we're on the
|
||||||
/// same thread that holds the mutex and memory access can use relaxed ordering
|
/// same thread that holds the mutex and memory access can use relaxed ordering
|
||||||
/// since we're not dealing with multiple threads. If it compares unequal,
|
/// since we're not dealing with multiple threads. If it's not equal,
|
||||||
/// synchronization is left to the mutex, making relaxed memory ordering for
|
/// synchronization is left to the mutex, making relaxed memory ordering for
|
||||||
/// the `owner` field fine in all cases.
|
/// the `owner` field fine in all cases.
|
||||||
pub struct ReentrantMutex<T> {
|
pub struct ReentrantMutex<T> {
|
||||||
|
Loading…
Reference in New Issue
Block a user