Apply formatting fixes
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
This commit is contained in:
parent
9e777eb45d
commit
6edcfbe59a
@ -170,12 +170,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
prior_arm_ty = Some(arm_ty);
|
||||
}
|
||||
|
||||
// If all of the arms in the 'match' diverge,
|
||||
// and we're dealing with an actual 'match' block
|
||||
// (as opposed to a 'match' desugared from something else'),
|
||||
// If all of the arms in the `match` diverge,
|
||||
// and we're dealing with an actual `match` block
|
||||
// (as opposed to a `match` desugared from something else'),
|
||||
// we can emit a better note. Rather than pointing
|
||||
// at a diverging expression in an arbitrary arm,
|
||||
// we can point at the entire 'match' expression
|
||||
// we can point at the entire `match` expression
|
||||
match (all_arms_diverge, match_src) {
|
||||
(Diverges::Always { .. }, hir::MatchSource::Normal) => {
|
||||
all_arms_diverge = Diverges::Always {
|
||||
|
@ -453,15 +453,15 @@ pub enum Diverges {
|
||||
Always {
|
||||
/// The `Span` points to the expression
|
||||
/// that caused us to diverge
|
||||
/// (e.g. `return`, `break`, etc)
|
||||
/// (e.g. `return`, `break`, etc).
|
||||
span: Span,
|
||||
/// In some cases (e.g. a 'match' expression
|
||||
/// In some cases (e.g. a `match` expression
|
||||
/// where all arms diverge), we may be
|
||||
/// able to provide a more informative
|
||||
/// message to the user.
|
||||
/// If this is None, a default messsage
|
||||
/// If this is `None`, a default messsage
|
||||
/// will be generated, which is suitable
|
||||
/// for most cases
|
||||
/// for most cases.
|
||||
custom_note: Option<&'static str>
|
||||
},
|
||||
|
||||
@ -502,7 +502,7 @@ impl Diverges {
|
||||
fn always(self) -> bool {
|
||||
// Enum comparison ignores the
|
||||
// contents of fields, so we just
|
||||
// fill them in with garbage here
|
||||
// fill them in with garbage here.
|
||||
self >= Diverges::Always {
|
||||
span: DUMMY_SP,
|
||||
custom_note: None
|
||||
|
Loading…
x
Reference in New Issue
Block a user