Skip to content

Commit 4c04e36

Browse files
authored
Auto merge of #36651 - jonathandturner:rollup, r=jonathandturner
Rollup of 7 pull requests - Successful merges: #36330, #36423, #36539, #36571, #36589, #36600, #36632 - Failed merges:
2 parents 458f411 + c1e3938 commit 4c04e36

File tree

28 files changed

+401
-199
lines changed

28 files changed

+401
-199
lines changed

src/liballoc/rc.rs

Lines changed: 310 additions & 160 deletions
Large diffs are not rendered by default.

src/libcollections/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ impl<T> [T] {
10371037
self.sort_by(|a, b| a.cmp(b))
10381038
}
10391039

1040-
/// Sorts the slice, in place, using `key` to extract a key by which to
1040+
/// Sorts the slice, in place, using `f` to extract a key by which to
10411041
/// order the sort by.
10421042
///
10431043
/// This sort is stable and `O(n log n)` worst-case but allocates

src/libcore/char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ pub fn decode_utf8<I: IntoIterator<Item = u8>>(i: I) -> DecodeUtf8<I::IntoIter>
800800

801801
/// `<DecodeUtf8 as Iterator>::next` returns this for an invalid input sequence.
802802
#[unstable(feature = "decode_utf8", issue = "33906")]
803-
#[derive(PartialEq, Debug)]
803+
#[derive(PartialEq, Eq, Debug)]
804804
pub struct InvalidSequence(());
805805

806806
#[unstable(feature = "decode_utf8", issue = "33906")]

src/libcore/fmt/rt/v1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub struct FormatSpec {
3131
}
3232

3333
/// Possible alignments that can be requested as part of a formatting directive.
34-
#[derive(Copy, Clone, PartialEq)]
34+
#[derive(Copy, Clone, PartialEq, Eq)]
3535
pub enum Alignment {
3636
/// Indication that contents should be left-aligned.
3737
Left,

src/libcore/num/dec2flt/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ from_str_float_impl!(f64);
155155
/// [`FromStr`]: ../str/trait.FromStr.html
156156
/// [`f32`]: ../../std/primitive.f32.html
157157
/// [`f64`]: ../../std/primitive.f64.html
158-
#[derive(Debug, Clone, PartialEq)]
158+
#[derive(Debug, Clone, PartialEq, Eq)]
159159
#[stable(feature = "rust1", since = "1.0.0")]
160160
pub struct ParseFloatError {
161161
kind: FloatErrorKind
162162
}
163163

164-
#[derive(Debug, Clone, PartialEq)]
164+
#[derive(Debug, Clone, PartialEq, Eq)]
165165
enum FloatErrorKind {
166166
Empty,
167167
Invalid,

src/libcore/num/flt2dec/decoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use num::dec2flt::rawfp::RawFloat;
2121
/// - Any number from `(mant - minus) * 2^exp` to `(mant + plus) * 2^exp` will
2222
/// round to the original value. The range is inclusive only when
2323
/// `inclusive` is true.
24-
#[derive(Copy, Clone, Debug, PartialEq)]
24+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
2525
pub struct Decoded {
2626
/// The scaled mantissa.
2727
pub mant: u64,
@@ -38,7 +38,7 @@ pub struct Decoded {
3838
}
3939

4040
/// Decoded unsigned value.
41-
#[derive(Copy, Clone, Debug, PartialEq)]
41+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
4242
pub enum FullDecoded {
4343
/// Not-a-number.
4444
Nan,

src/libcore/num/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,7 +2401,7 @@ impl usize {
24012401
/// assert_eq!(nan.classify(), FpCategory::Nan);
24022402
/// assert_eq!(sub.classify(), FpCategory::Subnormal);
24032403
/// ```
2404-
#[derive(Copy, Clone, PartialEq, Debug)]
2404+
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
24052405
#[stable(feature = "rust1", since = "1.0.0")]
24062406
pub enum FpCategory {
24072407
/// "Not a Number", often obtained by dividing by zero.
@@ -2744,11 +2744,11 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32)
27442744
/// on the primitive integer types, such as [`i8::from_str_radix()`].
27452745
///
27462746
/// [`i8::from_str_radix()`]: ../../std/primitive.i8.html#method.from_str_radix
2747-
#[derive(Debug, Clone, PartialEq)]
2747+
#[derive(Debug, Clone, PartialEq, Eq)]
27482748
#[stable(feature = "rust1", since = "1.0.0")]
27492749
pub struct ParseIntError { kind: IntErrorKind }
27502750

2751-
#[derive(Debug, Clone, PartialEq)]
2751+
#[derive(Debug, Clone, PartialEq, Eq)]
27522752
enum IntErrorKind {
27532753
Empty,
27542754
InvalidDigit,

src/libcore/option.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,16 +296,14 @@ impl<T> Option<T> {
296296

297297
/// Moves the value `v` out of the `Option<T>` if it is `Some(v)`.
298298
///
299-
/// # Panics
300-
///
301-
/// Panics if the self value equals `None`.
302-
///
303-
/// # Safety note
304-
///
305299
/// In general, because this function may panic, its use is discouraged.
306300
/// Instead, prefer to use pattern matching and handle the `None`
307301
/// case explicitly.
308302
///
303+
/// # Panics
304+
///
305+
/// Panics if the self value equals `None`.
306+
///
309307
/// # Examples
310308
///
311309
/// ```

src/libcore/str/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl FromStr for bool {
101101
}
102102

103103
/// An error returned when parsing a `bool` from a string fails.
104-
#[derive(Debug, Clone, PartialEq)]
104+
#[derive(Debug, Clone, PartialEq, Eq)]
105105
#[stable(feature = "rust1", since = "1.0.0")]
106106
pub struct ParseBoolError { _priv: () }
107107

src/librustc_typeck/check/mod.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3099,7 +3099,18 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
30993099
if let Some(field_name) = Self::suggest_field_name(variant,
31003100
&field.name,
31013101
skip_fields.collect()) {
3102-
err.span_label(field.name.span,&format!("did you mean `{}`?",field_name));
3102+
err.span_label(field.name.span,
3103+
&format!("field does not exist - did you mean `{}`?", field_name));
3104+
} else {
3105+
match ty.sty {
3106+
ty::TyAdt(adt, ..) if adt.is_enum() => {
3107+
err.span_label(field.name.span, &format!("`{}::{}` does not have this field",
3108+
ty, variant.name.as_str()));
3109+
}
3110+
_ => {
3111+
err.span_label(field.name.span, &format!("`{}` does not have this field", ty));
3112+
}
3113+
}
31033114
};
31043115
err.emit();
31053116
}

0 commit comments

Comments
 (0)