Skip to content

Commit ad46ad6

Browse files
committed
pacify the mercilous tidy
1 parent fa9ebfc commit ad46ad6

File tree

3 files changed

+38
-12
lines changed

3 files changed

+38
-12
lines changed

src/librustc/infer/error_reporting.rs

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -327,18 +327,24 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
327327
}
328328
SubSupConflict(ref var_origin, ref sub_origin, sub, ref sup_origin, sup) => {
329329
debug!("processing SubSupConflict sub: {:?} sup: {:?}", sub, sup);
330-
if let SubregionOrigin::CompareImplMethodObligation { .. } = *sub_origin {
331-
// As above, when comparing an impl method
332-
// against a trait method, it is not helpful
333-
// to suggest changes to the impl method.
334-
} else if let SubregionOrigin::CompareImplMethodObligation { .. } = *sup_origin {
335-
// See above.
336-
} else if let Some(same_frs) = free_regions_from_same_fn(self.tcx, sub, sup) {
337-
origins.push(
338-
ProcessedErrorOrigin::VariableFailure(
339-
var_origin.clone()));
340-
append_to_same_regions(&mut same_regions, &same_frs);
341-
continue;
330+
match (sub_origin, sup_origin) {
331+
(&SubregionOrigin::CompareImplMethodObligation { .. }, _) => {
332+
// As above, when comparing an impl method
333+
// against a trait method, it is not helpful
334+
// to suggest changes to the impl method.
335+
}
336+
(_, &SubregionOrigin::CompareImplMethodObligation { .. }) => {
337+
// See above.
338+
}
339+
_ => {
340+
if let Some(same_frs) = free_regions_from_same_fn(self.tcx, sub, sup) {
341+
origins.push(
342+
ProcessedErrorOrigin::VariableFailure(
343+
var_origin.clone()));
344+
append_to_same_regions(&mut same_regions, &same_frs);
345+
continue;
346+
}
347+
}
342348
}
343349
}
344350
GenericBoundFailure(ref origin, ref kind, region) => {

src/librustc_errors/diagnostic.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
use CodeSuggestion;
212
use Level;
313
use RenderSpan;

src/librustc_errors/diagnostic_builder.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
use Diagnostic;
212
use Level;
313
use Handler;

0 commit comments

Comments
 (0)