use eii for bug! macro - #161873
Conversation
|
Some changes occurred to the CTFE machinery changes to the core type system cc @lcnr Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to constck cc @fee1-dead Some changes occurred in coverage instrumentation. cc @Zalathar changes to the core type system cc @lcnr Some changes occurred in compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs cc @ZuseZ4 Some changes occurred in compiler/rustc_codegen_llvm/src/builder/autodiff.rs cc @ZuseZ4 Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr Some changes occurred in match checking cc @Nadrieril Some changes occurred in match lowering cc @Nadrieril
Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri HIR ty lowering was modified cc @fmease |
|
|
|
Neat. :) |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
|
||
| #[eii(bug_handler)] | ||
| #[inline(never)] | ||
| pub fn bug_impl(_: Option<Span>, args: fmt::Arguments<'_>, location: &Location<'_>) -> ! { |
There was a problem hiding this comment.
Default impls for EIIs are not stable in the slightest. And EIIs without defaults will need #159843 before they can safely be used.
There was a problem hiding this comment.
For the time being using a static that is set by rustc_interface like all other callbacks is probably the best solution.
There was a problem hiding this comment.
If they are so unstable, maybe they should have a separate feature gate that's marked as incomplete. Or the entire extern_item_impls should be marked "incomplete".
There was a problem hiding this comment.
Putting EIIs with default impls behind an incomplete feature makes sense to me.
There was a problem hiding this comment.
For the time being using a static that is set by rustc_interface like all other callbacks is probably the best solution.
it looks like rustc_interface's callbacks doesn't support #[track_caller], so one gets backtraces starting like this:
thread 'rustc' (14300) panicked at compiler\rustc_interface\src\callbacks.rs:89:1:
Box<dyn Any>
stack backtrace:
0: std::panicking::begin_panic<rustc_errors::ExplicitBug>
at /rustc/f47d5bb13648d5c859f5b438eb7dc834b9729961/library\std\src\panicking.rs:751
1: std::panic::panic_any<rustc_errors::ExplicitBug>
at /rustc/f47d5bb13648d5c859f5b438eb7dc834b9729961/library\std\src\panic.rs:260
2: rustc_errors::diagnostic::impl$2::emit_producing_guarantee
at .\compiler\rustc_errors\src\diagnostic.rs:58
3: rustc_errors::diagnostic::Diag::emit<rustc_errors::diagnostic::BugAbort>
at .\compiler\rustc_errors\src\diagnostic.rs:1319
4: rustc_errors::DiagCtxtHandle::span_bug<rustc_span::span_encoding::Span,alloc::string::String>
at .\compiler\rustc_errors\src\lib.rs:982
5: rustc_interface::callbacks::bug_impl::closure$0
at .\compiler\rustc_interface\src\callbacks.rs:95
6: rustc_middle::ty::context::tls::with_opt::closure$0<rustc_interface::callbacks::bug_impl::closure_env$0,never$>
at .\compiler\rustc_middle\src\ty\context\tls.rs:109
7: rustc_middle::ty::context::tls::with_context_opt<rustc_middle::ty::context::tls::with_opt::closure_env$0<rustc_interface::callbacks::bug_impl::closure_env$0,never$>,never$>
at .\compiler\rustc_middle\src\ty\context\tls.rs:75
8: rustc_middle::ty::context::tls::with_opt<rustc_interface::callbacks::bug_impl::closure_env$0,never$>
at .\compiler\rustc_middle\src\ty\context\tls.rs:107
9: rustc_interface::callbacks::bug_impl
at .\compiler\rustc_interface\src\callbacks.rs:90
10: rustc_interface::callbacks::bug_impl
at .\compiler\rustc_interface\src\callbacks.rs:89
11: rustc_span::macros::bug_impl
at .\compiler\rustc_span\src\macros.rs:43
There was a problem hiding this comment.
Try
unsafe extern "Rust" {
#[lang = "panic_impl"]
fn panic_impl(pi: &PanicInfo<'_>) -> !;
}
panic_impl(&PanicInfo::new(
&fmt,
location,
/* can_unwind */ true,
/* force_no_backtrace */ false,
))You will need to enable some unstable features for it. This is based on the implementation of panic!() and by extension core::panicking::panic_fmt.
Mark `extern_item_impls` feature as incomplete context: rust-lang#161873 (comment) > If they are so unstable, maybe they should have a separate feature gate that's marked as `incomplete`. Or the entire `extern_item_impls` should be marked "incomplete". I think it's just best to mark the entire thing as incomplete for now. Later, when the implementation matures we can consider removing the incompleteness or splitting the feature in unstable and incomplete parts. r? @bjorn3 @RalfJung
Mark `extern_item_impls` feature as incomplete context: rust-lang#161873 (comment) > If they are so unstable, maybe they should have a separate feature gate that's marked as `incomplete`. Or the entire `extern_item_impls` should be marked "incomplete". I think it's just best to mark the entire thing as incomplete for now. Later, when the implementation matures we can consider removing the incompleteness or splitting the feature in unstable and incomplete parts. r? @bjorn3 @RalfJung
Mark `extern_item_impls` feature as incomplete context: rust-lang#161873 (comment) > If they are so unstable, maybe they should have a separate feature gate that's marked as `incomplete`. Or the entire `extern_item_impls` should be marked "incomplete". I think it's just best to mark the entire thing as incomplete for now. Later, when the implementation matures we can consider removing the incompleteness or splitting the feature in unstable and incomplete parts. r? @bjorn3 @RalfJung
Rollup merge of #161891 - mejrs:eii_incomplete, r=RalfJung Mark `extern_item_impls` feature as incomplete context: #161873 (comment) > If they are so unstable, maybe they should have a separate feature gate that's marked as `incomplete`. Or the entire `extern_item_impls` should be marked "incomplete". I think it's just best to mark the entire thing as incomplete for now. Later, when the implementation matures we can consider removing the incompleteness or splitting the feature in unstable and incomplete parts. r? @bjorn3 @RalfJung
|
☔ The latest upstream changes (presumably #161906) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
This allows it to be used without depending on rustc_middle.
r? @jdonszelmann @bjorn3