diff options
| author | bors <bors@rust-lang.org> | 2021-04-16 13:46:01 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-04-16 13:46:01 +0000 |
| commit | 2faef12b656d40522ca3b4a53b36299b4364e717 (patch) | |
| tree | cd720d31399a713ad854b977cc401d72f5ccd02f /compiler | |
| parent | 3833636446b670ee905fba5f8d18881b1739814e (diff) | |
| parent | c7c59d7c3b5ace6f47a48fb74c7114e1f60a4667 (diff) | |
Auto merge of #84241 - Dylan-DPC:rollup-jk9nt6k, r=Dylan-DPC
Rollup of 4 pull requests Successful merges: - #83337 (rustdoc: Hide item contents, not items) - #83944 (Fix a couple resolve bugs from binder refactor) - #84145 (Address comments for vecdeque_binary_search #78021) - #84172 (Compiler error messages: reduce assertiveness of message E0384) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/late/lifetimes.rs | 16 |
2 files changed, 16 insertions, 2 deletions
diff --git a/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs b/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs index 5fdf8a8d1ee..df6f1963923 100644 --- a/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs +++ b/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs @@ -1681,7 +1681,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { if decl.can_be_made_mutable() { err.span_suggestion( decl.source_info.span, - "make this binding mutable", + "consider making this binding mutable", format!("mut {}", name), Applicability::MachineApplicable, ); diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs index 91bc8ab5ef4..a93afedf7f6 100644 --- a/compiler/rustc_resolve/src/late/lifetimes.rs +++ b/compiler/rustc_resolve/src/late/lifetimes.rs @@ -2719,6 +2719,13 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { Some(next) => next, None => break None, }; + // See issue #83753. If someone writes an associated type on a non-trait, just treat it as + // there being no supertrait HRTBs. + match tcx.def_kind(def_id) { + DefKind::Trait | DefKind::TraitAlias | DefKind::Impl => {} + _ => break None, + } + if trait_defines_associated_type_named(def_id) { break Some(bound_vars.into_iter().collect()); } @@ -2764,7 +2771,14 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { | Scope::TraitRefBoundary { ref s, .. } => { scope = *s; } - Scope::Root => bug!("In fn_like_elision without appropriate scope above"), + Scope::Root => { + // See issue #83907. Just bail out from looking inside. + self.tcx.sess.delay_span_bug( + rustc_span::DUMMY_SP, + "In fn_like_elision without appropriate scope above", + ); + return; + } } }; // While not strictly necessary, we gather anon lifetimes *before* actually |
