Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 48696f5

Browse files
committed
Auto merge of rust-lang#133516 - compiler-errors:rollup-mq334h8, r=compiler-errors
Rollup of 8 pull requests Successful merges: - rust-lang#115293 (Remove -Zfuel.) - rust-lang#132605 (CI: increase timeout from 4h to 6h) - rust-lang#133304 (Revert diagnostics hack to fix ICE 132920) - rust-lang#133402 (Constify `Drop` and `Destruct`) - rust-lang#133458 (Fix `Result` and `Option` not getting a jump to def link generated) - rust-lang#133471 (gce: fix typing_mode mismatch) - rust-lang#133475 (`MaybeStorage` improvements) - rust-lang#133513 (Only ignore windows-gnu in avr-jmp-offset) r? `@ghost` `@rustbot` modify labels: rollup
2 parents dd2837e + 702996c commit 48696f5

File tree

73 files changed

+371
-1069
lines changed

Some content is hidden

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

73 files changed

+371
-1069
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
defaults:
6666
run:
6767
shell: ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}
68-
timeout-minutes: 240
68+
timeout-minutes: 360
6969
env:
7070
CI_JOB_NAME: ${{ matrix.image }}
7171
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

compiler/rustc_const_eval/src/check_consts/check.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ use rustc_middle::span_bug;
1818
use rustc_middle::ty::adjustment::PointerCoercion;
1919
use rustc_middle::ty::{self, Ty, TypeVisitableExt};
2020
use rustc_mir_dataflow::Analysis;
21-
use rustc_mir_dataflow::impls::MaybeStorageLive;
22-
use rustc_mir_dataflow::storage::always_storage_live_locals;
21+
use rustc_mir_dataflow::impls::{MaybeStorageLive, always_storage_live_locals};
2322
use rustc_span::{Span, Symbol, sym};
2423
use rustc_trait_selection::traits::{
2524
Obligation, ObligationCause, ObligationCauseCode, ObligationCtxt,

compiler/rustc_const_eval/src/interpret/stack.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_index::IndexVec;
1010
use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
1111
use rustc_middle::ty::{self, Ty, TyCtxt};
1212
use rustc_middle::{bug, mir};
13-
use rustc_mir_dataflow::storage::always_storage_live_locals;
13+
use rustc_mir_dataflow::impls::always_storage_live_locals;
1414
use rustc_span::Span;
1515
use tracing::{info_span, instrument, trace};
1616

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,6 @@ fn run_compiler(
472472
linker.link(sess, codegen_backend)?
473473
}
474474

475-
if let Some(fuel) = sess.opts.unstable_opts.print_fuel.as_deref() {
476-
eprintln!("Fuel used by {}: {}", fuel, sess.print_fuel.load(Ordering::SeqCst));
477-
}
478-
479475
Ok(())
480476
})
481477
}

compiler/rustc_interface/src/tests.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,6 @@ fn test_unstable_options_tracking_hash() {
784784
tracked!(flatten_format_args, false);
785785
tracked!(fmt_debug, FmtDebug::Shallow);
786786
tracked!(force_unstable_if_unmarked, true);
787-
tracked!(fuel, Some(("abc".to_string(), 99)));
788787
tracked!(function_return, FunctionReturn::ThunkExtern);
789788
tracked!(function_sections, Some(false));
790789
tracked!(human_readable_cgu_names, true);
@@ -830,7 +829,6 @@ fn test_unstable_options_tracking_hash() {
830829
tracked!(plt, Some(true));
831830
tracked!(polonius, Polonius::Legacy);
832831
tracked!(precise_enum_drop_elaboration, false);
833-
tracked!(print_fuel, Some("abc".to_string()));
834832
tracked!(profile_sample_use, Some(PathBuf::from("abc")));
835833
tracked!(profiler_runtime, "abc".to_string());
836834
tracked!(regparm, Some(3));

compiler/rustc_middle/src/ty/context.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,10 +1566,6 @@ impl<'tcx> TyCtxt<'tcx> {
15661566
}
15671567
}
15681568

1569-
pub fn consider_optimizing<T: Fn() -> String>(self, msg: T) -> bool {
1570-
self.sess.consider_optimizing(|| self.crate_name(LOCAL_CRATE), msg)
1571-
}
1572-
15731569
/// Obtain all lang items of this crate and all dependencies (recursively)
15741570
pub fn lang_items(self) -> &'tcx rustc_hir::lang_items::LanguageItems {
15751571
self.get_lang_items(())

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,10 +1558,7 @@ impl<'tcx> TyCtxt<'tcx> {
15581558
let is_box = self.is_lang_item(did.to_def_id(), LangItem::OwnedBox);
15591559

15601560
// This is here instead of layout because the choice must make it into metadata.
1561-
if is_box
1562-
|| !self
1563-
.consider_optimizing(|| format!("Reorder fields of {:?}", self.def_path_str(did)))
1564-
{
1561+
if is_box {
15651562
flags.insert(ReprFlags::IS_LINEAR);
15661563
}
15671564

compiler/rustc_mir_dataflow/src/impls/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ pub use self::initialized::{
1414
pub use self::liveness::{
1515
MaybeLiveLocals, MaybeTransitiveLiveLocals, TransferFunction as LivenessTransferFunction,
1616
};
17-
pub use self::storage_liveness::{MaybeRequiresStorage, MaybeStorageDead, MaybeStorageLive};
17+
pub use self::storage_liveness::{
18+
MaybeRequiresStorage, MaybeStorageDead, MaybeStorageLive, always_storage_live_locals,
19+
};

compiler/rustc_mir_dataflow/src/impls/storage_liveness.rs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ use rustc_middle::mir::*;
77
use super::MaybeBorrowedLocals;
88
use crate::{Analysis, GenKill, ResultsCursor};
99

10+
/// The set of locals in a MIR body that do not have `StorageLive`/`StorageDead` annotations.
11+
///
12+
/// These locals have fixed storage for the duration of the body.
13+
pub fn always_storage_live_locals(body: &Body<'_>) -> BitSet<Local> {
14+
let mut always_live_locals = BitSet::new_filled(body.local_decls.len());
15+
16+
for block in &*body.basic_blocks {
17+
for statement in &block.statements {
18+
if let StatementKind::StorageLive(l) | StatementKind::StorageDead(l) = statement.kind {
19+
always_live_locals.remove(l);
20+
}
21+
}
22+
}
23+
24+
always_live_locals
25+
}
26+
1027
pub struct MaybeStorageLive<'a> {
1128
always_live_locals: Cow<'a, BitSet<Local>>,
1229
}
@@ -28,10 +45,7 @@ impl<'a, 'tcx> Analysis<'tcx> for MaybeStorageLive<'a> {
2845
}
2946

3047
fn initialize_start_block(&self, body: &Body<'tcx>, on_entry: &mut Self::Domain) {
31-
assert_eq!(body.local_decls.len(), self.always_live_locals.domain_size());
32-
for local in self.always_live_locals.iter() {
33-
on_entry.insert(local);
34-
}
48+
on_entry.union(&*self.always_live_locals);
3549

3650
for arg in body.args_iter() {
3751
on_entry.insert(arg);

compiler/rustc_mir_dataflow/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@ pub use self::framework::{
2525
use self::move_paths::MoveData;
2626

2727
pub mod debuginfo;
28-
pub mod drop_flag_effects;
28+
mod drop_flag_effects;
2929
pub mod elaborate_drops;
3030
mod errors;
3131
mod framework;
3232
pub mod impls;
3333
pub mod move_paths;
3434
pub mod points;
3535
pub mod rustc_peek;
36-
pub mod storage;
37-
pub mod un_derefer;
36+
mod un_derefer;
3837
pub mod value_analysis;
3938

4039
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }

0 commit comments

Comments
 (0)