Skip to content

Commit 0a437b2

Browse files
committedMay 22, 2022
Auto merge of rust-lang#97283 - jackh726:rollup-ga84p7n, r=jackh726
Rollup of 5 pull requests Successful merges: - rust-lang#97043 (Move some tests to more reasonable directories) - rust-lang#97206 (Do leak check after function pointer coercion) - rust-lang#97275 (small change) - rust-lang#97277 (Avoid accidentally enabling unstable features in compilers (take 2)) - rust-lang#97280 (Quote replace target in bootstrap configure) Failed merges: - rust-lang#97214 (Finish bumping stage0) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 4bb4dc4 + b392cdf commit 0a437b2

File tree

52 files changed

+287
-261
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+287
-261
lines changed
 

‎compiler/rustc_infer/src/infer/error_reporting/mod.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -1442,6 +1442,10 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
14421442
/// the message in `secondary_span` as the primary label, and apply the message that would
14431443
/// otherwise be used for the primary label on the `secondary_span` `Span`. This applies on
14441444
/// E0271, like `src/test/ui/issues/issue-39970.stderr`.
1445+
#[tracing::instrument(
1446+
level = "debug",
1447+
skip(self, diag, secondary_span, swap_secondary_and_primary, force_label)
1448+
)]
14451449
pub fn note_type_err(
14461450
&self,
14471451
diag: &mut Diagnostic,
@@ -1453,7 +1457,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
14531457
force_label: bool,
14541458
) {
14551459
let span = cause.span(self.tcx);
1456-
debug!("note_type_err cause={:?} values={:?}, terr={:?}", cause, values, terr);
14571460

14581461
// For some types of errors, expected-found does not make
14591462
// sense, so just ignore the values we were given.
@@ -1621,9 +1624,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
16211624
}
16221625
};
16231626

1624-
// Ignore msg for object safe coercion
1625-
// since E0038 message will be printed
16261627
match terr {
1628+
// Ignore msg for object safe coercion
1629+
// since E0038 message will be printed
16271630
TypeError::ObjectUnsafeCoercion(_) => {}
16281631
_ => {
16291632
let mut label_or_note = |span: Span, msg: &str| {
@@ -1774,6 +1777,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
17741777
// It reads better to have the error origin as the final
17751778
// thing.
17761779
self.note_error_origin(diag, cause, exp_found, terr);
1780+
1781+
debug!(?diag);
17771782
}
17781783

17791784
fn suggest_tuple_pattern(

‎compiler/rustc_middle/src/ty/error.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,10 @@ impl<'tcx> fmt::Display for TypeError<'tcx> {
135135
ArgCount => write!(f, "incorrect number of function parameters"),
136136
FieldMisMatch(adt, field) => write!(f, "field type mismatch: {}.{}", adt, field),
137137
RegionsDoesNotOutlive(..) => write!(f, "lifetime mismatch"),
138-
RegionsInsufficientlyPolymorphic(br, _) => write!(
139-
f,
140-
"expected bound lifetime parameter{}, found concrete lifetime",
141-
br_string(br)
142-
),
138+
// Actually naming the region here is a bit confusing because context is lacking
139+
RegionsInsufficientlyPolymorphic(..) => {
140+
write!(f, "one type is more general than the other")
141+
}
143142
RegionsOverlyPolymorphic(br, _) => write!(
144143
f,
145144
"expected concrete lifetime, found bound lifetime parameter{}",

0 commit comments

Comments
 (0)
Please sign in to comment.