Skip to content

Commit c931eff

Browse files
committed
reduce unreachable-code churn after todo!()
1 parent b954122 commit c931eff

655 files changed

Lines changed: 1481 additions & 877 deletions

File tree

Some content is hidden

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

compiler/rustc_borrowck/src/places_conflict.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ fn place_components_conflict<'tcx>(
286286

287287
// Given that the bases of `elem1` and `elem2` are always either equal
288288
// or disjoint (and have the same type!), return the overlap situation
289-
// between `elem1` and `elem2`.
289+
// between `elem1` and `elem2`
290+
#[cfg_attr(not(bootstrap), allow(todo_macro_calls))]
290291
fn place_projection_conflict<'tcx>(
291292
tcx: TyCtxt<'tcx>,
292293
body: &Body<'tcx>,

compiler/rustc_borrowck/src/universal_regions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ impl<'tcx> UniversalRegions<'tcx> {
373373
/// that this region imposes on others. The methods in this file
374374
/// handle the part about dumping the inference context internal
375375
/// state.
376+
#[cfg_attr(not(bootstrap), allow(todo_macro_calls))]
376377
pub(crate) fn annotate(&self, tcx: TyCtxt<'tcx>, err: &mut Diag<'_, ()>) {
377378
match self.defining_ty {
378379
DefiningTy::Closure(def_id, args) => {

compiler/rustc_builtin_macros/src/autodiff.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ mod llvm_enzyme {
501501
// ```
502502
// std::intrinsics::autodiff(source as fn(..) -> .., diff, (args))
503503
// ```
504+
#[cfg_attr(not(bootstrap), allow(todo_macro_calls))]
504505
fn call_autodiff(
505506
ecx: &ExtCtxt<'_>,
506507
primal: Ident,

compiler/rustc_codegen_cranelift/src/debuginfo/unwind.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pub(crate) struct UnwindContext {
2525
}
2626

2727
impl UnwindContext {
28+
#[cfg_attr(not(bootstrap), allow(todo_macro_calls))]
2829
pub(crate) fn new(module: &mut dyn Module, pic_eh_frame: bool) -> Self {
2930
let endian = match module.isa().endianness() {
3031
Endianness::Little => RunTimeEndian::Little,

compiler/rustc_codegen_cranelift/src/intrinsics/llvm_x86.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use crate::inline_asm::{CInlineAsmOperand, codegen_inline_asm_inner};
77
use crate::intrinsics::*;
88
use crate::prelude::*;
99

10+
#[cfg_attr(not(bootstrap), allow(todo_macro_calls))]
1011
pub(super) fn codegen_x86_llvm_intrinsic_call<'tcx>(
1112
fx: &mut FunctionCx<'_, '_, 'tcx>,
1213
intrinsic: &str,

compiler/rustc_codegen_cranelift/src/value_and_place.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ impl<'tcx> CValue<'tcx> {
180180
}
181181
}
182182

183+
#[cfg_attr(not(bootstrap), allow(todo_macro_calls))]
183184
pub(crate) fn value_field(
184185
self,
185186
fx: &mut FunctionCx<'_, '_, 'tcx>,
@@ -522,6 +523,7 @@ impl<'tcx> CPlace<'tcx> {
522523
self.write_cvalue_maybe_transmute(fx, from, "write_cvalue_transmute");
523524
}
524525

526+
#[cfg_attr(not(bootstrap), allow(todo_macro_calls))]
525527
fn write_cvalue_maybe_transmute(
526528
self,
527529
fx: &mut FunctionCx<'_, '_, 'tcx>,

compiler/rustc_codegen_gcc/src/type_of.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
5656
}
5757
}
5858

59+
#[cfg_attr(not(bootstrap), allow(todo_macro_calls))]
5960
fn uncached_gcc_type<'gcc, 'tcx>(
6061
cx: &CodegenCx<'gcc, 'tcx>,
6162
layout: TyAndLayout<'tcx>,
@@ -177,6 +178,7 @@ pub trait LayoutGccExt<'tcx> {
177178
}
178179

179180
impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
181+
#[cfg_attr(not(bootstrap), allow(todo_macro_calls))]
180182
fn is_gcc_immediate(&self) -> bool {
181183
match self.backend_repr {
182184
BackendRepr::Scalar(_) | BackendRepr::SimdVector { .. } => true,

compiler/rustc_const_eval/src/interpret/validity.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,7 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> {
872872
/// at that type. Return `true` if the type is indeed primitive.
873873
///
874874
/// Note that not all of these have `FieldsShape::Primitive`, e.g. wide references.
875+
#[cfg_attr(not(bootstrap), allow(todo_macro_calls))]
875876
fn try_visit_primitive(
876877
&mut self,
877878
value: &PlaceTy<'tcx, M::Provenance>,

compiler/rustc_expand/src/expand.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1935,6 +1935,7 @@ impl InvocationCollectorNode for ast::Pat {
19351935
_ => unreachable!(),
19361936
}
19371937
}
1938+
#[cfg_attr(not(bootstrap), allow(todo_macro_calls))]
19381939
fn as_target(&self) -> Target {
19391940
todo!();
19401941
}

compiler/rustc_hir_analysis/src/coherence/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ pub(crate) fn coerce_shared_info<'tcx>(
625625
span,
626626
Unnormalized::new_wip(trait_ref.args.type_at(1)),
627627
) else {
628-
todo!("something went wrong with structurally_normalize_ty");
628+
panic!("something went wrong with structurally_normalize_ty");
629629
};
630630

631631
let param_env = tcx.param_env(impl_did);

0 commit comments

Comments
 (0)