Skip to content

Instantly share code, notes, and snippets.

@edwin0cheng
Created April 29, 2019 12:20
Show Gist options
  • Save edwin0cheng/3f3f17bba11b8c262bf375895379a60e to your computer and use it in GitHub Desktop.
Save edwin0cheng/3f3f17bba11b8c262bf375895379a60e to your computer and use it in GitHub Desktop.
Remain mbe bugs
WARN [ra_hir::ids] fail on macro_parse: (reason: NoMatchingRule) macro call [file: "src/errors.rs"] : single_cause ! {
/// Cannot tell whether an `u16` needs an extra unit,
/// because it's a trailing surrogate itself.
InvalidUtf16FirstUnit = > "is a trailing surrogate"
}
has rules: true
WARN [ra_hir::ids] fail on macro_parse: (reason: NoMatchingRule) macro call [file: "src/errors.rs"] : single_cause ! {
/// Cannot create an `Utf8Char` or `Utf16Char` from the first codepoint of a str,
/// because there are none.
EmptyStrError = > "is empty"
}
has rules: true
WARN [ra_hir::ids] fail on macro_parse: (reason: NoMatchingRule) macro call [file: "src/errors.rs"] : single_cause ! {
/// Cannot create an `Utf8Char` from a standalone `u8`
/// that is not an ASCII character.
NonAsciiError = > "is not an ASCII character"
}
has rules: true
WARN [ra_hir::ids] fail on macro_parse: (reason: NoMatchingRule) macro call [file: "src/errors.rs"] : single_cause ! {
/// Cannot create an `Utf16Char` from a standalone `u16` that is not a
/// codepoint in the basic multilingual plane, but part of a suurrogate pair.
NonBMPError = > "is not a codepoint in the basic multilingual plane"
}
has rules: true
WARN [ra_hir::ids] fail on macro_parse: (reason: NoMatchingRule) macro call [file: "src/errors.rs"] : simple ! { /// Reasons why an `u32` is not a valid UTF codepoint.
InvalidCodepoint {
/// It's reserved for UTF-16 surrogate pairs."
: : Utf16Reserved = > "is reserved for UTF-16 surrogate pairs" ,
/// It's higher than the highest codepoint (which is 0x10ffff).
: : TooHigh = > "is higher than the highest codepoint" ,
} }
has rules: true
WARN [ra_hir::ids] fail on macro_parse: (reason: NoMatchingRule) macro call [file: "src/errors.rs"] : simple ! { /// Reasons why one or two `u16`s are not valid UTF-16, in sinking precedence.
InvalidUtf16Tuple {
/// The first unit is a trailing/low surrogate, which is never valid.
///
/// Note that the value of a low surrogate is actually higher than a high surrogate.
: : FirstIsTrailingSurrogate = > "the first unit is a trailing / low surrogate, which is never valid" ,
/// You provided a second unit, but the first one stands on its own.
: : SuperfluousSecond = > "the second unit is superfluous" ,
/// The first and only unit requires a second unit.
: : MissingSecond = > "the first unit requires a second unit" ,
/// The first unit requires a second unit, but it's not a trailing/low surrogate.
///
/// Note that the value of a low surrogate is actually higher than a high surrogate.
: : InvalidSecond = > "the required second unit is not a trailing / low surrogate" ,
} }
has rules: true
WARN [ra_hir::ids] fail on macro_parse: (reason: NoMatchingRule) macro call [file: "src/errors.rs"] : simple ! { /// Reasons why a slice of `u16`s doesn't start with valid UTF-16.
InvalidUtf16Slice {
/// The slice is empty.
: : EmptySlice = > "the slice is empty" ,
/// The first unit is a low surrogate.
: : FirstLowSurrogate = > "the first unit is a trailing surrogate" ,
/// The first and only unit requires a second unit.
: : MissingSecond = > "the first and only unit requires a second one" ,
/// The first unit requires a second one, but it's not a trailing surrogate.
: : SecondNotLowSurrogate = > "the required second unit is not a trailing surrogate" ,
} }
has rules: true
WARN [ra_hir::ids] fail on macro_parse: (reason: NoMatchingRule) macro call [file: "src/errors.rs"] : simple ! { /// Types of invalid sequences encountered by `Utf16CharParser`.
Utf16PairError {
/// A trailing surrogate was not preceeded by a leading surrogate.
: : UnexpectedTrailingSurrogate = > "a trailing surrogate was not preceeded by a leading surrogate" ,
/// A leading surrogate was followed by an unit that was not a trailing surrogate.
: : UnmatchedLeadingSurrogate = > "a leading surrogate was followed by an unit that was not a trailing surrogate" ,
/// A trailing surrogate was expected when the end was reached.
: : Incomplete = > "a trailing surrogate was expected when the end was reached" ,
} }
has rules: true
WARN [ra_hir::ids] fail on macro_parse: (reason: NoMatchingRule) macro call [file: "src/errors.rs"] : simple ! { /// Reasons why `Utf8Char::from_str()` or `Utf16Char::from_str()` failed.
FromStrError {
/// `Utf8Char` or `Utf16Char` cannot store more than a single codepoint.
: : MultipleCodepoints = > "has more than one codepoint" ,
/// `Utf8Char` or `Utf16Char` cannot be empty.
: : Empty = > "is empty" ,
} }
has rules: true
WARN [ra_hir::ids] fail on macro_parse: (reason: NoMatchingRule) macro call [file: "src/errors.rs"] : simple ! { /// Reasons why a byte is not the start of a UTF-8 codepoint.
InvalidUtf8FirstByte {
/// Sequences cannot be longer than 4 bytes. Is given for values >= 240.
: : TooLongSeqence = > "is greater than 247 (UTF-8 sequences cannot be longer than four bytes)" ,
/// This byte belongs to a previous sequence. Is given for values between 128 and 192 (exclusive).
: : ContinuationByte = > "is a continuation of a previous sequence" ,
} }
has rules: true
WARN [ra_hir::ids] fail on macro_parse: (reason: NoMatchingRule) macro call [file: "src/compile_fail/must_use.rs"] : must_use ! {
chain /** v.par_iter().chain(&v); */
chunks /** v.par_iter().chunks(2); */
cloned /** v.par_iter().cloned(); */
enumerate /** v.par_iter().enumerate(); */
filter /** v.par_iter().filter(|_| true); */
filter_map /** v.par_iter().filter_map(|x| *x); */
flat_map /** v.par_iter().flat_map(|x| *x); */
flatten /** v.par_iter().flatten(); */
fold /** v.par_iter().fold(|| 0, |x, _| x); */
fold_with /** v.par_iter().fold_with(0, |x, _| x); */
try_fold /** v.par_iter().try_fold(|| 0, |x, _| Some(x)); */
try_fold_with /** v.par_iter().try_fold_with(0, |x, _| Some(x)); */
inspect /** v.par_iter().inspect(|_| {}); */
interleave /** v.par_iter().interleave(&v); */
interleave_shortest /** v.par_iter().interleave_shortest(&v); */
intersperse /** v.par_iter().intersperse(&None); */
map /** v.par_iter().map(|x| x); */
map_with /** v.par_iter().map_with(0, |_, x| x); */
map_init /** v.par_iter().map_init(|| 0, |_, x| x); */
rev /** v.par_iter().rev(); */
skip /** v.par_iter().skip(1); */
take /** v.par_iter().take(1); */
update /** v.par_iter().update(|_| {}); */
while_some /** v.par_iter().cloned().while_some(); */
with_max_len /** v.par_iter().with_max_len(1); */
with_min_len /** v.par_iter().with_min_len(1); */
zip /** v.par_iter().zip(&v); */
zip_eq /** v.par_iter().zip_eq(&v); */
}
has rules: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment