Fix typos “an”→“a” and a few different ones that appeared in the same search
This commit is contained in:
parent
2396fad095
commit
2f9ddf3bc7
36 changed files with 43 additions and 43 deletions
|
@ -376,27 +376,27 @@ impl<'tcx, Tag: Provenance> Scalar<Tag> {
|
|||
self.to_bits(sz)
|
||||
}
|
||||
|
||||
/// Converts the scalar to produce an `u8`. Fails if the scalar is a pointer.
|
||||
/// Converts the scalar to produce a `u8`. Fails if the scalar is a pointer.
|
||||
pub fn to_u8(self) -> InterpResult<'static, u8> {
|
||||
self.to_unsigned_with_bit_width(8).map(|v| u8::try_from(v).unwrap())
|
||||
}
|
||||
|
||||
/// Converts the scalar to produce an `u16`. Fails if the scalar is a pointer.
|
||||
/// Converts the scalar to produce a `u16`. Fails if the scalar is a pointer.
|
||||
pub fn to_u16(self) -> InterpResult<'static, u16> {
|
||||
self.to_unsigned_with_bit_width(16).map(|v| u16::try_from(v).unwrap())
|
||||
}
|
||||
|
||||
/// Converts the scalar to produce an `u32`. Fails if the scalar is a pointer.
|
||||
/// Converts the scalar to produce a `u32`. Fails if the scalar is a pointer.
|
||||
pub fn to_u32(self) -> InterpResult<'static, u32> {
|
||||
self.to_unsigned_with_bit_width(32).map(|v| u32::try_from(v).unwrap())
|
||||
}
|
||||
|
||||
/// Converts the scalar to produce an `u64`. Fails if the scalar is a pointer.
|
||||
/// Converts the scalar to produce a `u64`. Fails if the scalar is a pointer.
|
||||
pub fn to_u64(self) -> InterpResult<'static, u64> {
|
||||
self.to_unsigned_with_bit_width(64).map(|v| u64::try_from(v).unwrap())
|
||||
}
|
||||
|
||||
/// Converts the scalar to produce an `u128`. Fails if the scalar is a pointer.
|
||||
/// Converts the scalar to produce a `u128`. Fails if the scalar is a pointer.
|
||||
pub fn to_u128(self) -> InterpResult<'static, u128> {
|
||||
self.to_unsigned_with_bit_width(128)
|
||||
}
|
||||
|
|
|
@ -265,7 +265,7 @@ impl BorrowKind {
|
|||
BorrowKind::Shared => hir::Mutability::Not,
|
||||
|
||||
// We have no type corresponding to a unique imm borrow, so
|
||||
// use `&mut`. It gives all the capabilities of an `&uniq`
|
||||
// use `&mut`. It gives all the capabilities of a `&uniq`
|
||||
// and hence is a safe "over approximation".
|
||||
BorrowKind::Unique => hir::Mutability::Mut,
|
||||
|
||||
|
|
|
@ -1202,7 +1202,7 @@ pub enum NonUseContext {
|
|||
StorageDead,
|
||||
/// User type annotation assertions for NLL.
|
||||
AscribeUserTy,
|
||||
/// The data of an user variable, for debug info.
|
||||
/// The data of a user variable, for debug info.
|
||||
VarDebugInfo,
|
||||
}
|
||||
|
||||
|
|
|
@ -1733,7 +1733,7 @@ rustc_queries! {
|
|||
}
|
||||
|
||||
/// Performs an HIR-based well-formed check on the item with the given `HirId`. If
|
||||
/// we get an `Umimplemented` error that matches the provided `Predicate`, return
|
||||
/// we get an `Unimplemented` error that matches the provided `Predicate`, return
|
||||
/// the cause of the newly created obligation.
|
||||
///
|
||||
/// This is only used by error-reporting code to get a better cause (in particular, a better
|
||||
|
|
|
@ -434,7 +434,7 @@ impl BorrowKind {
|
|||
ImmBorrow => hir::Mutability::Not,
|
||||
|
||||
// We have no type corresponding to a unique imm borrow, so
|
||||
// use `&mut`. It gives all the capabilities of an `&uniq`
|
||||
// use `&mut`. It gives all the capabilities of a `&uniq`
|
||||
// and hence is a safe "over approximation".
|
||||
UniqueImmBorrow => hir::Mutability::Mut,
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ where
|
|||
impl<'tcx, D: TyDecoder<'tcx>> Decodable<D> for Ty<'tcx> {
|
||||
#[allow(rustc::usage_of_ty_tykind)]
|
||||
fn decode(decoder: &mut D) -> Result<Ty<'tcx>, D::Error> {
|
||||
// Handle shorthands first, if we have an usize > 0x80.
|
||||
// Handle shorthands first, if we have a usize > 0x80.
|
||||
if decoder.positioned_at_shorthand() {
|
||||
let pos = decoder.read_usize()?;
|
||||
assert!(pos >= SHORTHAND_OFFSET);
|
||||
|
@ -228,7 +228,7 @@ impl<'tcx, D: TyDecoder<'tcx>> Decodable<D> for Ty<'tcx> {
|
|||
impl<'tcx, D: TyDecoder<'tcx>> Decodable<D> for ty::Binder<'tcx, ty::PredicateKind<'tcx>> {
|
||||
fn decode(decoder: &mut D) -> Result<ty::Binder<'tcx, ty::PredicateKind<'tcx>>, D::Error> {
|
||||
let bound_vars = Decodable::decode(decoder)?;
|
||||
// Handle shorthands first, if we have an usize > 0x80.
|
||||
// Handle shorthands first, if we have a usize > 0x80.
|
||||
Ok(ty::Binder::bind_with_vars(
|
||||
if decoder.positioned_at_shorthand() {
|
||||
let pos = decoder.read_usize()?;
|
||||
|
|
|
@ -239,7 +239,7 @@ static_assert_size!(TyKind<'_>, 32);
|
|||
/// implements `CK<(u32, u32), Output = u32>`, where `CK` is the trait
|
||||
/// specified above.
|
||||
/// - U is a type parameter representing the types of its upvars, tupled up
|
||||
/// (borrowed, if appropriate; that is, if an U field represents a by-ref upvar,
|
||||
/// (borrowed, if appropriate; that is, if a U field represents a by-ref upvar,
|
||||
/// and the up-var has the type `Foo`, then that field of U will be `&Foo`).
|
||||
///
|
||||
/// So, for example, given this function:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue