Skip to content

Uplift some comments to Doc comments #43640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/librustc/ty/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,14 +581,14 @@ pub struct Struct {
pub min_size: Size,
}

// Info required to optimize struct layout.
/// Info required to optimize struct layout.
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug)]
enum StructKind {
// A tuple, closure, or univariant which cannot be coerced to unsized.
/// A tuple, closure, or univariant which cannot be coerced to unsized.
AlwaysSizedUnivariant,
// A univariant, the last field of which may be coerced to unsized.
/// A univariant, the last field of which may be coerced to unsized.
MaybeUnsizedUnivariant,
// A univariant, but part of an enum.
/// A univariant, but part of an enum.
EnumVariant,
}

Expand Down Expand Up @@ -1020,7 +1020,7 @@ pub enum Layout {
/// TyRawPtr or TyRef with a !Sized pointee.
FatPointer {
metadata: Primitive,
// If true, the pointer cannot be null.
/// If true, the pointer cannot be null.
non_zero: bool
},

Expand All @@ -1031,8 +1031,8 @@ pub enum Layout {
discr: Integer,
signed: bool,
non_zero: bool,
// Inclusive discriminant range.
// If min > max, it represents min...u64::MAX followed by 0...max.
/// Inclusive discriminant range.
/// If min > max, it represents min...u64::MAX followed by 0...max.
// FIXME(eddyb) always use the shortest range, e.g. by finding
// the largest space between two consecutive discriminants and
// taking everything else as the (shortest) discriminant range.
Expand All @@ -1043,7 +1043,7 @@ pub enum Layout {
/// Single-case enums, and structs/tuples.
Univariant {
variant: Struct,
// If true, the structure is NonZero.
/// If true, the structure is NonZero.
// FIXME(eddyb) use a newtype Layout kind for this.
non_zero: bool
},
Expand Down Expand Up @@ -1084,9 +1084,9 @@ pub enum Layout {
StructWrappedNullablePointer {
nndiscr: u64,
nonnull: Struct,
// N.B. There is a 0 at the start, for LLVM GEP through a pointer.
/// N.B. There is a 0 at the start, for LLVM GEP through a pointer.
discrfield: FieldPath,
// Like discrfield, but in source order. For debuginfo.
/// Like discrfield, but in source order. For debuginfo.
discrfield_source: FieldPath
}
}
Expand Down Expand Up @@ -1944,11 +1944,11 @@ pub enum SizeSkeleton<'tcx> {

/// A potentially-fat pointer.
Pointer {
// If true, this pointer is never null.
/// If true, this pointer is never null.
non_zero: bool,
// The type which determines the unsized metadata, if any,
// of this pointer. Either a type parameter or a projection
// depending on one, with regions erased.
/// The type which determines the unsized metadata, if any,
/// of this pointer. Either a type parameter or a projection
/// depending on one, with regions erased.
tail: Ty<'tcx>
}
}
Expand Down