Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Apply formatting fixes
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
  • Loading branch information
Aaron1011 and Centril committed Sep 18, 2019
1 parent 9e777eb commit 6edcfbe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/librustc_typeck/check/_match.rs
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_typeck/check/mod.rs
Expand Up @@ -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>
},

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6edcfbe

Please sign in to comment.