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