Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0ff8610

Browse files
committedNov 21, 2023
Auto merge of rust-lang#118134 - Nilstrieb:rollup-kyo1l6e, r=Nilstrieb
Rollup of 6 pull requests Successful merges: - rust-lang#116085 (rustdoc-search: add support for traits and associated types) - rust-lang#117522 (Remove `--check-cfg` checking of command line `--cfg` args) - rust-lang#118029 (Expand Miri's BorTag GC to a Provenance GC) - rust-lang#118035 (Fix early param lifetimes in generic_const_exprs) - rust-lang#118083 (Remove i686-apple-darwin cross-testing) - rust-lang#118091 (Remove now deprecated target x86_64-sun-solaris.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents e24e5af + fa8878b commit 0ff8610

File tree

96 files changed

+1988
-602
lines changed

Some content is hidden

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

96 files changed

+1988
-602
lines changed
 

‎compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use crate::session_diagnostics::{
3535
LifetimeReturnCategoryErr, RequireStaticErr, VarHereDenote,
3636
};
3737

38-
use super::{OutlivesSuggestionBuilder, RegionName};
38+
use super::{OutlivesSuggestionBuilder, RegionName, RegionNameSource};
3939
use crate::region_infer::{BlameConstraint, ExtraConstraintInfo};
4040
use crate::{
4141
nll::ConstraintDescription,
@@ -763,7 +763,14 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
763763
let err = LifetimeOutliveErr { span: *span };
764764
let mut diag = self.infcx.tcx.sess.create_err(err);
765765

766-
let fr_name = self.give_region_a_name(*fr).unwrap();
766+
// In certain scenarios, such as the one described in issue #118021,
767+
// we might encounter a lifetime that cannot be named.
768+
// These situations are bound to result in errors.
769+
// To prevent an immediate ICE, we opt to create a dummy name instead.
770+
let fr_name = self.give_region_a_name(*fr).unwrap_or(RegionName {
771+
name: kw::UnderscoreLifetime,
772+
source: RegionNameSource::Static,
773+
});
767774
fr_name.highlight_region_name(&mut diag);
768775
let outlived_fr_name = self.give_region_a_name(*outlived_fr).unwrap();
769776
outlived_fr_name.highlight_region_name(&mut diag);

‎compiler/rustc_const_eval/src/const_eval/machine.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ impl<K: Hash + Eq, V> interpret::AllocMap<K, V> for FxIndexMap<K, V> {
107107
FxIndexMap::contains_key(self, k)
108108
}
109109

110+
#[inline(always)]
111+
fn contains_key_ref<Q: ?Sized + Hash + Eq>(&self, k: &Q) -> bool
112+
where
113+
K: Borrow<Q>,
114+
{
115+
FxIndexMap::contains_key(self, k)
116+
}
117+
110118
#[inline(always)]
111119
fn insert(&mut self, k: K, v: V) -> Option<V> {
112120
FxIndexMap::insert(self, k, v)

0 commit comments

Comments
 (0)
Please sign in to comment.