Skip to content

Commit b01734e

Browse files
committed
fix tests
1 parent 7b39afd commit b01734e

File tree

57 files changed

+153
-137
lines changed

Some content is hidden

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

57 files changed

+153
-137
lines changed

compiler/rustc_hir_typeck/src/check.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::cell::RefCell;
22

33
use rustc_abi::ExternAbi;
4-
use rustc_hir::def::DefKind;
54
use rustc_hir as hir;
65
use rustc_hir::intravisit::Visitor;
76
use rustc_hir::lang_items::LangItem;

compiler/rustc_metadata/src/rmeta/decoder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,10 +782,9 @@ impl MetadataBlob {
782782
)?;
783783
writeln!(
784784
out,
785-
"has_global_allocator {} has_alloc_error_handler {} has_panic_handler {} has_default_lib_allocator {}",
785+
"has_global_allocator {} has_alloc_error_handler {} has_default_lib_allocator {}",
786786
root.has_global_allocator,
787787
root.has_alloc_error_handler,
788-
root.has_panic_handler,
789788
root.has_default_lib_allocator
790789
)?;
791790
writeln!(

compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ provide! { tcx, def_id, other, cdata,
348348
is_compiler_builtins => { cdata.root.compiler_builtins }
349349
has_global_allocator => { cdata.root.has_global_allocator }
350350
has_alloc_error_handler => { cdata.root.has_alloc_error_handler }
351-
has_panic_handler => { cdata.root.has_panic_handler }
352351
is_profiler_runtime => { cdata.root.profiler_runtime }
353352
required_panic_strategy => { cdata.root.required_panic_strategy }
354353
panic_in_drop_strategy => { cdata.root.panic_in_drop_strategy }

compiler/rustc_metadata/src/rmeta/encoder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
713713
edition: tcx.sess.edition(),
714714
has_global_allocator: tcx.has_global_allocator(LOCAL_CRATE),
715715
has_alloc_error_handler: tcx.has_alloc_error_handler(LOCAL_CRATE),
716-
has_panic_handler: tcx.has_panic_handler(LOCAL_CRATE),
717716
externally_implementable_items,
718717

719718
has_default_lib_allocator: ast::attr::contains_name(

compiler/rustc_metadata/src/rmeta/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ pub(crate) struct CrateRoot {
261261
// TODO: these booleans can be replaced by the entries in `externally_implementable_items`
262262
has_global_allocator: bool,
263263
has_alloc_error_handler: bool,
264-
has_panic_handler: bool,
265264
has_default_lib_allocator: bool,
266265
externally_implementable_items: LazyArray<(DefId, (EIIDecl, Vec<(DefId, EIIImpl)>))>,
267266

compiler/rustc_middle/src/hir/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,9 +1030,9 @@ impl<'tcx> TyCtxt<'tcx> {
10301030
Node::PreciseCapturingNonLifetimeArg(param) => param.ident.span,
10311031
Node::Synthetic => {
10321032
if let Some(EiiMapping { chosen_impl, .. }) =
1033-
self.tcx.get_externally_implementable_item_impls(()).get(&hir_id.owner.def_id)
1033+
self.get_externally_implementable_item_impls(()).get(&hir_id.owner.def_id)
10341034
{
1035-
self.tcx.def_span(chosen_impl)
1035+
self.def_span(chosen_impl)
10361036
} else {
10371037
unreachable!()
10381038
}

compiler/rustc_middle/src/hir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ pub fn provide(providers: &mut Providers) {
227227
} else if let Some(EiiMapping { chosen_impl, .. }) =
228228
tcx.get_externally_implementable_item_impls(()).get(&def_id)
229229
{
230-
tcx.fn_arg_names(chosen_impl)
230+
tcx.fn_arg_idents(chosen_impl)
231231
} else {
232232
span_bug!(
233233
tcx.hir_span(tcx.local_def_id_to_hir_id(def_id)),

compiler/rustc_passes/src/errors.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -862,10 +862,6 @@ pub(crate) struct UnknownExternLangItem {
862862
pub lang_item: Symbol,
863863
}
864864

865-
#[derive(Diagnostic)]
866-
#[diag(passes_missing_panic_handler)]
867-
pub(crate) struct MissingPanicHandler;
868-
869865
#[derive(Diagnostic)]
870866
#[diag(passes_panic_unwind_without_std)]
871867
#[help]

compiler/rustc_passes/src/weak_lang_items.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ use rustc_middle::middle::lang_items::required;
99
use rustc_middle::ty::TyCtxt;
1010
use rustc_session::config::CrateType;
1111

12-
use crate::errors::{
13-
MissingLangItem, MissingPanicHandler, PanicUnwindWithoutStd, UnknownExternLangItem,
14-
};
12+
use crate::errors::{MissingLangItem, PanicUnwindWithoutStd, UnknownExternLangItem};
1513

1614
/// Checks the crate for usage of weak lang items, returning a vector of all the
1715
/// lang items required by this crate, but not defined yet.
@@ -83,9 +81,7 @@ fn verify(tcx: TyCtxt<'_>, items: &lang_items::LanguageItems) {
8381

8482
for &item in WEAK_LANG_ITEMS.iter() {
8583
if missing.contains(&item) && required(tcx, item) && items.get(item).is_none() {
86-
if item == LangItem::PanicImpl {
87-
tcx.dcx().emit_err(MissingPanicHandler);
88-
} else if item == LangItem::EhPersonality {
84+
if item == LangItem::EhPersonality {
8985
tcx.dcx().emit_err(PanicUnwindWithoutStd);
9086
} else {
9187
tcx.dcx().emit_err(MissingLangItem { name: item.name() });

compiler/rustc_resolve/src/check_unused.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,6 @@ impl Resolver<'_, '_> {
402402
!tcx.is_compiler_builtins(cnum)
403403
&& !tcx.is_panic_runtime(cnum)
404404
&& !tcx.has_global_allocator(cnum)
405-
&& !tcx.has_panic_handler(cnum)
406405
}) {
407406
maybe_unused_extern_crates.insert(id, import.span);
408407
}

0 commit comments

Comments
 (0)