Skip to content

Commit 531cb83

Browse files
committed
Auto merge of rust-lang#117881 - TaKO8Ki:rollup-n7jtmgj, r=TaKO8Ki
Rollup of 5 pull requests Successful merges: - rust-lang#117737 (Remove `-Zkeep-hygiene-data`.) - rust-lang#117830 (Small improvements in object lifetime default code) - rust-lang#117858 (Compute layout with spans for better cycle errors in coroutines) - rust-lang#117863 (Remove some unused stuff from `rustc_index`) - rust-lang#117872 (Cranelift isn't available on non-nightly channels) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 4bd2fd5 + b0a68a4 commit 531cb83

File tree

16 files changed

+39
-114
lines changed

16 files changed

+39
-114
lines changed

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,8 +792,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
792792
// debuggers and debugger extensions expect it to be called `__awaitee`. They use
793793
// this name to identify what is being awaited by a suspended async functions.
794794
let awaitee_ident = Ident::with_dummy_span(sym::__awaitee);
795-
let (awaitee_pat, awaitee_pat_hid) =
796-
self.pat_ident_binding_mode(span, awaitee_ident, hir::BindingAnnotation::MUT);
795+
let (awaitee_pat, awaitee_pat_hid) = self.pat_ident_binding_mode(
796+
gen_future_span,
797+
awaitee_ident,
798+
hir::BindingAnnotation::MUT,
799+
);
797800

798801
let task_context_ident = Ident::with_dummy_span(sym::_task_context);
799802

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,6 @@ pub fn lower_to_hir(tcx: TyCtxt<'_>, (): ()) -> hir::Crate<'_> {
443443
drop(ast_index);
444444
sess.time("drop_ast", || drop(krate));
445445

446-
// Discard hygiene data, which isn't required after lowering to HIR.
447-
if !sess.opts.unstable_opts.keep_hygiene_data {
448-
rustc_span::hygiene::clear_syntax_context_map();
449-
}
450-
451446
// Don't hash unless necessary, because it's expensive.
452447
let opt_hir_hash =
453448
if tcx.needs_crate_hash() { Some(compute_hir_hash(tcx, &owners)) } else { None };

compiler/rustc_hir_analysis/src/astconv/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2847,6 +2847,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
28472847
/// provided, if they provided one, and otherwise search the supertypes of trait bounds
28482848
/// for region bounds. It may be that we can derive no bound at all, in which case
28492849
/// we return `None`.
2850+
#[instrument(level = "debug", skip(self, span), ret)]
28502851
fn compute_object_lifetime_bound(
28512852
&self,
28522853
span: Span,
@@ -2855,8 +2856,6 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
28552856
{
28562857
let tcx = self.tcx();
28572858

2858-
debug!("compute_opt_region_bound(existential_predicates={:?})", existential_predicates);
2859-
28602859
// No explicit region bound specified. Therefore, examine trait
28612860
// bounds and see if we can derive region bounds from those.
28622861
let derived_region_bounds = object_region_bounds(tcx, existential_predicates);

compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,8 +1848,8 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> {
18481848
}
18491849
}
18501850

1851+
#[instrument(level = "debug", skip(self))]
18511852
fn resolve_object_lifetime_default(&mut self, lifetime_ref: &'tcx hir::Lifetime) {
1852-
debug!("resolve_object_lifetime_default(lifetime_ref={:?})", lifetime_ref);
18531853
let mut late_depth = 0;
18541854
let mut scope = self.scope;
18551855
let lifetime = loop {

compiler/rustc_index/src/bit_set.rs

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -237,23 +237,12 @@ impl<T: Idx> BitSet<T> {
237237
new_word != word
238238
}
239239

240-
/// Gets a slice of the underlying words.
241-
pub fn words(&self) -> &[Word] {
242-
&self.words
243-
}
244-
245240
/// Iterates over the indices of set bits in a sorted order.
246241
#[inline]
247242
pub fn iter(&self) -> BitIter<'_, T> {
248243
BitIter::new(&self.words)
249244
}
250245

251-
/// Duplicates the set as a hybrid set.
252-
pub fn to_hybrid(&self) -> HybridBitSet<T> {
253-
// Note: we currently don't bother trying to make a Sparse set.
254-
HybridBitSet::Dense(self.to_owned())
255-
}
256-
257246
/// Set `self = self | other`. In contrast to `union` returns `true` if the set contains at
258247
/// least one bit that is not in `other` (i.e. `other` is not a superset of `self`).
259248
///
@@ -1601,11 +1590,11 @@ impl<R: Idx, C: Idx> BitMatrix<R, C> {
16011590
pub fn from_row_n(row: &BitSet<C>, num_rows: usize) -> BitMatrix<R, C> {
16021591
let num_columns = row.domain_size();
16031592
let words_per_row = num_words(num_columns);
1604-
assert_eq!(words_per_row, row.words().len());
1593+
assert_eq!(words_per_row, row.words.len());
16051594
BitMatrix {
16061595
num_rows,
16071596
num_columns,
1608-
words: iter::repeat(row.words()).take(num_rows).flatten().cloned().collect(),
1597+
words: iter::repeat(&row.words).take(num_rows).flatten().cloned().collect(),
16091598
marker: PhantomData,
16101599
}
16111600
}
@@ -1700,9 +1689,9 @@ impl<R: Idx, C: Idx> BitMatrix<R, C> {
17001689
assert_eq!(with.domain_size(), self.num_columns);
17011690
let (write_start, write_end) = self.range(write);
17021691
let mut changed = false;
1703-
for (read_index, write_index) in iter::zip(0..with.words().len(), write_start..write_end) {
1692+
for (read_index, write_index) in iter::zip(0..with.words.len(), write_start..write_end) {
17041693
let word = self.words[write_index];
1705-
let new_word = word | with.words()[read_index];
1694+
let new_word = word | with.words[read_index];
17061695
self.words[write_index] = new_word;
17071696
changed |= word != new_word;
17081697
}
@@ -2002,54 +1991,6 @@ impl std::fmt::Debug for FiniteBitSet<u32> {
20021991
}
20031992
}
20041993

2005-
impl FiniteBitSetTy for u64 {
2006-
const DOMAIN_SIZE: u32 = 64;
2007-
2008-
const FILLED: Self = Self::MAX;
2009-
const EMPTY: Self = Self::MIN;
2010-
2011-
const ONE: Self = 1u64;
2012-
const ZERO: Self = 0u64;
2013-
2014-
fn checked_shl(self, rhs: u32) -> Option<Self> {
2015-
self.checked_shl(rhs)
2016-
}
2017-
2018-
fn checked_shr(self, rhs: u32) -> Option<Self> {
2019-
self.checked_shr(rhs)
2020-
}
2021-
}
2022-
2023-
impl std::fmt::Debug for FiniteBitSet<u64> {
2024-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2025-
write!(f, "{:064b}", self.0)
2026-
}
2027-
}
2028-
2029-
impl FiniteBitSetTy for u128 {
2030-
const DOMAIN_SIZE: u32 = 128;
2031-
2032-
const FILLED: Self = Self::MAX;
2033-
const EMPTY: Self = Self::MIN;
2034-
2035-
const ONE: Self = 1u128;
2036-
const ZERO: Self = 0u128;
2037-
2038-
fn checked_shl(self, rhs: u32) -> Option<Self> {
2039-
self.checked_shl(rhs)
2040-
}
2041-
2042-
fn checked_shr(self, rhs: u32) -> Option<Self> {
2043-
self.checked_shr(rhs)
2044-
}
2045-
}
2046-
2047-
impl std::fmt::Debug for FiniteBitSet<u128> {
2048-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2049-
write!(f, "{:0128b}", self.0)
2050-
}
2051-
}
2052-
20531994
/// A fixed-sized bitset type represented by an integer type. Indices outwith than the range
20541995
/// representable by `T` are considered set.
20551996
#[derive(Copy, Clone, Eq, PartialEq, Decodable, Encodable)]

compiler/rustc_index/src/vec.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ impl<I: Idx, T> IndexVec<I, T> {
137137
self.raw.truncate(a)
138138
}
139139

140-
pub fn convert_index_type<Ix: Idx>(self) -> IndexVec<Ix, T> {
141-
IndexVec::from_raw(self.raw)
142-
}
143-
144140
/// Grows the index vector so that it contains an entry for
145141
/// `elem`; if that is already true, then has no
146142
/// effect. Otherwise, inserts new values as needed by invoking

compiler/rustc_index/src/vec/tests.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(dead_code)]
2-
31
// Allows the macro invocation below to work
42
use crate as rustc_index;
53

compiler/rustc_interface/src/tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,6 @@ fn test_unstable_options_tracking_hash() {
679679
untracked!(incremental_info, true);
680680
untracked!(incremental_verify_ich, true);
681681
untracked!(input_stats, true);
682-
untracked!(keep_hygiene_data, true);
683682
untracked!(link_native_libraries, false);
684683
untracked!(llvm_time_trace, true);
685684
untracked!(ls, vec!["all".to_owned()]);

compiler/rustc_session/src/options.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,8 +1621,6 @@ options! {
16211621
`=skip-entry`
16221622
`=skip-exit`
16231623
Multiple options can be combined with commas."),
1624-
keep_hygiene_data: bool = (false, parse_bool, [UNTRACKED],
1625-
"keep hygiene data after analysis (default: no)"),
16261624
layout_seed: Option<u64> = (None, parse_opt_number, [TRACKED],
16271625
"seed layout randomization"),
16281626
link_directives: bool = (true, parse_bool, [TRACKED],

compiler/rustc_span/src/hygiene.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,10 +569,6 @@ impl HygieneData {
569569
}
570570
}
571571

572-
pub fn clear_syntax_context_map() {
573-
HygieneData::with(|data| data.syntax_context_map = FxHashMap::default());
574-
}
575-
576572
pub fn walk_chain(span: Span, to: SyntaxContext) -> Span {
577573
HygieneData::with(|data| data.walk_chain(span, to))
578574
}

0 commit comments

Comments
 (0)