Skip to content

Use EII for #[panic_handler] - #159016

Draft
bjorn3 wants to merge 7 commits into
rust-lang:mainfrom
bjorn3:eii_panic_handler
Draft

bjorn3 wants to merge 7 commits into
rust-lang:mainfrom
bjorn3:eii_panic_handler

Conversation

@bjorn3

@bjorn3 bjorn3 commented Jul 9, 2026 •

Copy link
Copy Markdown
Member

While we can't yet use EIIs for things like the global allocator due to missing platform support, we can safely use it for #[panic_handler] as that doesn't require any object file format features. Just matching symbol names.

This gets rid of one of the two remaining weak lang items.

TODO

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-minicore` S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 9, 2026
@bjorn3

bjorn3 commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

cc @jdonszelmann

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@bjorn3
bjorn3 force-pushed the eii_panic_handler branch from ecd1f4c to 2f001d2 Compare July 24, 2026 09:48

/// Attribute macro applied to a function to register it as a panic handler.
///
/// See also [`core::panic::PanicInfo`](crate::panic::PanicInfo).

@bjorn3 bjorn3 Jul 24, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are probably better pages to link to.

View changes since the review

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@bjorn3
bjorn3 force-pushed the eii_panic_handler branch from 6f7844f to 43f6678 Compare August 4, 2026 13:31
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@bjorn3
bjorn3 force-pushed the eii_panic_handler branch from 43f6678 to efeefa8 Compare November 6, 2026 16:07
@rustbot rustbot added the A-panic Area: Panicking machinery label Nov 6, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@bjorn3
bjorn3 force-pushed the eii_panic_handler branch from efeefa8 to bd62b77 Compare November 9, 2026 12:35
@rustbot rustbot added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Nov 9, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

The symbol name of the EII impl will now get changed to match the EII
decl whenever there is no default impl. This already works across all
backends and targets unlike the weak symbol aliases that we currently
use. When there is a default impl, we will still use weak symbol
aliases.
The only way it was possible to skip needing to declare #[panic_handler]
is using #![no_core], which is unstable anyway. Always requiring
\#[panic_handler] makes things more consistent and avoids having to
special case several MIR optimizations for the absence of #[panic_handler].
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-x86_64-gnu-llvm-22 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [mir-opt] tests/mir-opt/unusual_item_types.rs ... ok

failures:

---- [mir-opt] tests/mir-opt/inline/inline_coroutine_body.rs stdout ----
57 +                             let mut _37: &mut std::option::Option<()>;
58 +                             let mut _38: &mut std::future::Ready<()>;
59 +                             let mut _39: &mut std::pin::Pin<&mut std::future::Ready<()>>;
- +                             scope 13 (inlined <Pin<&mut std::future::Ready<()>> as DerefMut>::deref_mut) {
- +                                 let mut _40: *mut std::pin::helper::PinHelper<&mut std::future::Ready<()>>;
- +                                 let mut _41: *mut std::pin::Pin<&mut std::future::Ready<()>>;
- +                                 scope 14 (inlined <pin::helper::PinHelper<&mut std::future::Ready<()>> as pin::helper::PinDerefMutHelper>::deref_mut) {
- +                                     let mut _42: &mut &mut std::future::Ready<()>;
- +                                     scope 15 (inlined <&mut std::future::Ready<()> as DerefMut>::deref_mut) {
+ +                             scope 13 (inlined Option::<()>::take) {
+ +                                 let mut _40: std::option::Option<()>;
+ +                                 scope 19 (inlined std::mem::replace::<Option<()>>) {
+ +                                     let mut _53: *const std::option::Option<()>;
+ +                                     let mut _54: *mut std::option::Option<()>;
+ +                                     let mut _58: usize;
+ +                                     let mut _59: usize;
+ +                                     let mut _60: usize;
+ +                                     let mut _61: bool;
+ +                                     let mut _62: bool;
+ +                                     let mut _63: bool;
+ +                                     let mut _64: bool;
+ +                                     let mut _65: bool;
+ +                                     scope 20 {
+ +                                         let mut _55: usize;
+ +                                         let mut _56: usize;
+ +                                         let mut _57: bool;
+ +                                         let mut _66: bool;
+ +                                         let mut _67: bool;
+ +                                         let mut _68: bool;
66 +                                     }
67 +                                 }
68 +                             }

- +                             scope 16 (inlined Option::<()>::take) {
- +                                 let mut _43: std::option::Option<()>;
- +                                 scope 17 (inlined std::mem::replace::<Option<()>>) {
- +                                     scope 18 {
- +                                     }
+ +                             scope 14 (inlined #[track_caller] Option::<()>::expect) {
+ +                                 let mut _41: isize;
+ +                                 let mut _42: !;
+ +                                 scope 15 {
74 +                                 }
75 +                             }
- +                             scope 19 (inlined #[track_caller] Option::<()>::expect) {
- +                                 let mut _44: isize;
- +                                 let mut _45: !;
- +                                 scope 20 {
+ +                             scope 16 (inlined <Pin<&mut std::future::Ready<()>> as DerefMut>::deref_mut) {
+ +                                 let mut _43: &mut std::pin::helper::PinHelper<&mut std::future::Ready<()>>;
+ +                                 let mut _44: *mut std::pin::helper::PinHelper<&mut std::future::Ready<()>>;
+ +                                 let mut _45: *mut std::pin::Pin<&mut std::future::Ready<()>>;
+ +                                 let mut _46: usize;
+ +                                 let mut _47: usize;
+ +                                 let mut _48: usize;
+ +                                 let mut _49: bool;
+ +                                 let mut _50: bool;
+ +                                 let mut _51: bool;
+ +                                 scope 17 (inlined <pin::helper::PinHelper<&mut std::future::Ready<()>> as pin::helper::PinDerefMutHelper>::deref_mut) {
+ +                                     let mut _52: &mut &mut std::future::Ready<()>;
+ +                                     scope 18 (inlined <&mut std::future::Ready<()> as DerefMut>::deref_mut) {
+ +                                     }
80 +                                 }
81 +                             }
82 +                         }

84 +                     scope 10 (inlined <std::future::Ready<()> as IntoFuture>::into_future) {
85 +                     }
86 +                     scope 21 (inlined ready::<()>) {
- +                         let mut _46: std::option::Option<()>;
+ +                         let mut _69: std::option::Option<()>;
88 +                     }
89 +                 }
90 +             }

189 +         _23 = copy (_24.0: std::ptr::NonNull<std::task::Context<'_>>) as &mut std::task::Context<'_> (Transmute);
190 +         _22 = &mut (*_23);
191 +         StorageDead(_24);
- +         StorageLive(_38);
- +         StorageLive(_40);
- +         StorageLive(_45);
+ +         StorageLive(_42);
195 +         StorageLive(_35);
196 +         StorageLive(_36);
- +         StorageLive(_41);
- +         _41 = &raw mut _19;
- +         _40 = copy _41 as *mut std::pin::helper::PinHelper<&mut std::future::Ready<()>> (PtrToPtr);
- +         StorageDead(_41);
- +         _38 = no_retag copy ((*_40).0: &mut std::future::Ready<()>);
+ +         StorageLive(_37);
+ +         StorageLive(_38);
+ +         StorageLive(_39);
+ +         _39 = &mut _19;
202 +         StorageLive(_43);
- +         _43 = Option::<()>::None;
- +         _36 = copy ((*_38).0: std::option::Option<()>);
- +         ((*_38).0: std::option::Option<()>) = move _43;
- +         StorageDead(_43);
+ +         StorageLive(_46);
+ +         StorageLive(_47);
+ +         StorageLive(_48);
+ +         StorageLive(_49);
+ +         StorageLive(_50);
+ +         StorageLive(_51);
207 +         StorageLive(_44);
- +         _44 = discriminant(_36);
- +         switchInt(move _44) -> [0: bb16, 1: bb17, otherwise: bb6];
+ +         StorageLive(_45);
+ +         _45 = &raw mut (*_39);
+ +         _44 = copy _45 as *mut std::pin::helper::PinHelper<&mut std::future::Ready<()>> (PtrToPtr);
+ +         _46 = copy _45 as usize (Transmute);
+ +         _47 = Sub(const <std::pin::helper::PinHelper<&mut std::future::Ready<()>> as std::mem::SizedTypeProperties>::ALIGN, const 1_usize);
+ +         _48 = BitAnd(copy _46, copy _47);
+ +         _49 = Eq(copy _48, const 0_usize);
+ +         assert(copy _49, "misaligned pointer dereference: address must be a multiple of {} but is {}", const <std::pin::helper::PinHelper<&mut std::future::Ready<()>> as std::mem::SizedTypeProperties>::ALIGN, copy _46) -> [success: bb18, unwind unreachable];
210       }
211   
212 -     bb5 (cleanup): {

295 +         StorageLive(_13);
296 +         StorageLive(_14);
297 +         _14 = ();
- +         StorageLive(_46);
- +         _46 = Option::<()>::Some(copy _14);
- +         _13 = std::future::Ready::<()>(move _46);
- +         StorageDead(_46);
+ +         StorageLive(_69);
+ +         _69 = Option::<()>::Some(copy _14);
+ +         _13 = std::future::Ready::<()>(move _69);
+ +         StorageDead(_69);
302 +         StorageDead(_14);
303 +         _12 = move _13;
304 +         StorageDead(_13);

307 +     }
308 + 
309 +     bb16: {
- +         _45 = option::expect_failed(const "`Ready` should not be polled after completion") -> bb10;
+ +         _42 = option::expect_failed(const "`Ready` should not be polled after completion") -> bb10;
311 +     }
312 + 
313 +     bb17: {

314 +         _35 = move ((_36 as Some).0: ());
- +         StorageDead(_44);
+ +         StorageDead(_41);
316 +         StorageDead(_36);
317 +         _18 = Poll::<()>::Ready(move _35);
- +         StorageDead(_35);
- +         StorageDead(_45);
- +         StorageDead(_40);
321 +         StorageDead(_38);
+ +         StorageDead(_35);
+ +         StorageDead(_42);
322 +         StorageDead(_22);
323 +         StorageDead(_19);
324 +         _25 = discriminant(_18);

325 +         switchInt(move _25) -> [0: bb8, 1: bb7, otherwise: bb6];
+ +     }
+ + 
+ +     bb18: {
+ +         _50 = Eq(copy _46, const 0_usize);
+ +         _51 = Not(copy _50);
+ +         assert(copy _51, "null reference produced") -> [success: bb19, unwind unreachable];
+ +     }
+ + 
+ +     bb19: {
+ +         _43 = &mut (*_44);
+ +         StorageDead(_45);
+ +         StorageDead(_44);
+ +         StorageLive(_52);
+ +         _52 = &mut ((*_43).0: &mut std::future::Ready<()>);
+ +         _38 = no_retag copy (*_52);
+ +         StorageDead(_52);
+ +         StorageDead(_51);
+ +         StorageDead(_50);
+ +         StorageDead(_49);
+ +         StorageDead(_48);
+ +         StorageDead(_47);
+ +         StorageDead(_46);
+ +         StorageDead(_43);
+ +         StorageDead(_39);
+ +         _37 = &mut ((*_38).0: std::option::Option<()>);
+ +         StorageLive(_40);
+ +         _40 = Option::<()>::None;
+ +         StorageLive(_55);
+ +         StorageLive(_56);
+ +         StorageLive(_57);
+ +         StorageLive(_58);
+ +         StorageLive(_59);
+ +         StorageLive(_60);
+ +         StorageLive(_61);
+ +         StorageLive(_62);
+ +         StorageLive(_63);
+ +         StorageLive(_64);
+ +         StorageLive(_65);
+ +         StorageLive(_66);
+ +         StorageLive(_67);
+ +         StorageLive(_68);
+ +         StorageLive(_53);
+ +         _53 = &raw const (*_37);
+ +         _58 = copy _53 as usize (Transmute);
+ +         _59 = Sub(const <std::option::Option<()> as std::mem::SizedTypeProperties>::ALIGN, const 1_usize);
+ +         _60 = BitAnd(copy _58, copy _59);
+ +         _61 = Eq(copy _60, const 0_usize);
+ +         assert(copy _61, "misaligned pointer dereference: address must be a multiple of {} but is {}", const <std::option::Option<()> as std::mem::SizedTypeProperties>::ALIGN, copy _58) -> [success: bb21, unwind unreachable];
+ +     }
+ + 
+ +     bb20: {
+ +         _66 = Eq(copy _55, const 0_usize);
+ +         _67 = BitAnd(copy _66, copy _62);
+ +         _68 = Not(copy _67);
+ +         assert(copy _68, "null pointer dereference occurred") -> [success: bb23, unwind unreachable];
+ +     }
+ + 
+ +     bb21: {
+ +         _62 = Ne(const <std::option::Option<()> as std::mem::SizedTypeProperties>::SIZE, const 0_usize);
+ +         _63 = Eq(copy _58, const 0_usize);
+ +         _64 = BitAnd(copy _63, copy _62);
+ +         _65 = Not(copy _64);
+ +         assert(copy _65, "null pointer dereference occurred") -> [success: bb22, unwind unreachable];
+ +     }
+ + 
+ +     bb22: {
+ +         _36 = copy (*_37);
+ +         StorageDead(_53);
+ +         StorageLive(_54);
+ +         _54 = &raw mut (*_37);
+ +         _55 = copy _54 as usize (Transmute);
+ +         _56 = BitAnd(copy _55, copy _59);
+ +         _57 = Eq(copy _56, const 0_usize);
+ +         assert(copy _57, "misaligned pointer dereference: address must be a multiple of {} but is {}", const <std::option::Option<()> as std::mem::SizedTypeProperties>::ALIGN, copy _55) -> [success: bb20, unwind unreachable];
+ +     }
+ + 
+ +     bb23: {
+ +         (*_54) = move _40;
+ +         StorageDead(_54);
+ +         StorageDead(_68);
+ +         StorageDead(_67);
+ +         StorageDead(_66);
+ +         StorageDead(_65);
+ +         StorageDead(_64);
+ +         StorageDead(_63);
+ +         StorageDead(_62);
+ +         StorageDead(_61);
+ +         StorageDead(_60);
+ +         StorageDead(_59);
+ +         StorageDead(_58);
+ +         StorageDead(_57);
+ +         StorageDead(_56);
+ +         StorageDead(_55);
+ +         StorageDead(_40);
+ +         StorageDead(_37);
+ +         StorageLive(_41);
+ +         _41 = discriminant(_36);
+ +         switchInt(move _41) -> [0: bb16, 1: bb17, otherwise: bb6];
326 +     }
327 + }
328 + 


thread '[mir-opt] tests/mir-opt/inline/inline_coroutine_body.rs' panicked at src/tools/compiletest/src/runtest/mir_opt.rs:73:21:
Actual MIR output differs from expected MIR output /checkout/tests/mir-opt/inline/inline_coroutine_body.run2-{closure#0}.Inline.panic-unwind.diff
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- [mir-opt] tests/mir-opt/inline/inline_coroutine_body.rs stdout end ----
---- [mir-opt] tests/mir-opt/pre-codegen/copy_and_clone.rs#CLONE stdout ----
------FileCheck stdout------------------------------

------FileCheck stderr------------------------------
/checkout/tests/mir-opt/pre-codegen/copy_and_clone.rs:17:12: error: CHECK: expected string not found in input
 // CHECK: [[C:_.*]] = copy (*_1);
           ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/pre-codegen/copy_and_clone.CLONE/copy_and_clone.mir:22:16: note: scanning from here
fn inter_clone(_1: &Av1BlockInter) -> Av1BlockIntraInter {
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/pre-codegen/copy_and_clone.CLONE/copy_and_clone.mir:23:8: note: possible intended match here
 debug inter => _1;
       ^

Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/pre-codegen/copy_and_clone.CLONE/copy_and_clone.mir
Check file: /checkout/tests/mir-opt/pre-codegen/copy_and_clone.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: // WARNING: This output format is intended for human consumers only 
            2: // and is subject to change without notice. Knock yourself out. 
            3: // HINT: See also -Z dump-mir for MIR at specific points during compilation. 
            4: fn intra_clone(_1: &Av1BlockIntra) -> Av1BlockIntraInter { 
            5:  debug intra => _1; 
            6:  let mut _0: Av1BlockIntraInter; 
            7:  let mut _2: Av1BlockIntra; 
            8:  scope 1 (inlined <Av1BlockIntra as Clone>::clone) { 
            9:  scope 2 (inlined <TxfmSize as Clone>::clone) { 
           10:  } 
           11:  } 
           12:  
           13:  bb0: { 
           14:  StorageLive(_2); 
           15:  _2 = copy (*_1); 
           16:  _0 = Av1BlockIntraInter::Intra(move _2); 
           17:  StorageDead(_2); 
           18:  return; 
           19:  } 
           20: } 
           21:  
           22: fn inter_clone(_1: &Av1BlockInter) -> Av1BlockIntraInter { 
check:17'0                    X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           23:  debug inter => _1; 
check:17'0     ~~~~~~~~~~~~~~~~~~~~
check:17'1            ?             possible intended match
           24:  let mut _0: Av1BlockIntraInter; 
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           25:  let mut _2: Av1BlockInter; 
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           26:  
check:17'0     ~
           27:  bb0: { 
check:17'0     ~~~~~~~~
           28:  StorageLive(_2); 
check:17'0     ~~~~~~~~~~~~~~~~~~
           29:  _2 = <Av1BlockInter as Clone>::clone(move _1) -> [return: bb1, unwind continue]; 
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           30:  } 
check:17'0     ~~~
           31:  
check:17'0     ~
           32:  bb1: { 
check:17'0     ~~~~~~~~
           33:  _0 = Av1BlockIntraInter::Inter(move _2); 
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           34:  StorageDead(_2); 
check:17'0     ~~~~~~~~~~~~~~~~~~
           35:  return; 
check:17'0     ~~~~~~~~~
           36:  } 
check:17'0     ~~~
           37: } 
check:17'0     ~~
           38:  
check:17'0     ~
           39: fn dav1dsequenceheader_copy(_1: &Dav1dSequenceHeader) -> Dav1dSequenceHeader { 
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           40:  debug v => _1; 
           41:  let mut _0: Dav1dSequenceHeader; 
           42:  
           43:  bb0: { 
           44:  _0 = <Dav1dSequenceHeader as Clone>::clone(move _1) -> [return: bb1, unwind continue]; 
           45:  } 
           46:  
           47:  bb1: { 
           48:  return; 
           49:  } 
           50: } 
           51:  
           52: fn <impl at /checkout/tests/mir-opt/pre-codegen/copy_and_clone.rs:29:10: 29:15>::clone(_1: &mv) -> mv { 
           53:  debug self => _1; 
           54:  let mut _0: mv; 
           55:  scope 1 { 
           56:  } 
           57:  
           58:  bb0: { 
           59:  _0 = copy (*_1); 
           60:  return; 
           61:  } 
           62: } 
           63:  
           64: fn <impl at /checkout/tests/mir-opt/pre-codegen/copy_and_clone.rs:36:10: 36:15>::clone(_1: &MaskedInterIntraPredMode) -> MaskedInterIntraPredMode { 
           65:  debug self => _1; 
           66:  let mut _0: MaskedInterIntraPredMode; 
           67:  scope 1 { 
           68:  } 
           69:  
           70:  bb0: { 
           71:  _0 = copy (*_1); 
           72:  return; 
           73:  } 
           74: } 
           75:  
           76: const Av1BlockInter1d::mv::{constant#0}: usize = const 2_usize; 
           77:  
           78: fn <impl at /checkout/tests/mir-opt/pre-codegen/copy_and_clone.rs:40:10: 40:15>::clone(_1: &Av1BlockInter1d) -> Av1BlockInter1d { 
           79:  debug self => _1; 
           80:  let mut _0: Av1BlockInter1d; 
           81:  scope 1 (inlined array::<impl Clone for [mv; 2]>::clone) { 
           82:  scope 2 (inlined <mv as array::SpecArrayClone>::clone::<2>) { 
           83:  let mut _2: *const [mv; 2]; 
           84:  scope 3 (inlined #[track_caller] std::ptr::read::<[mv; 2]>) { 
           85:  let mut _3: usize; 
           86:  let mut _4: usize; 
           87:  let mut _5: bool; 
           88:  let mut _6: bool; 
           89:  let mut _7: bool; 
           90:  scope 4 (inlined core::ub_checks::check_language_ub) { 
           91:  scope 5 (inlined core::ub_checks::check_language_ub::runtime) { 
           92:  } 
           93:  } 
           94:  scope 6 (inlined std::mem::align_of::<[mv; 2]>) { 
           95:  } 
           96:  } 
           97:  } 
           98:  } 
           99:  scope 7 (inlined <MaskedInterIntraPredMode as Clone>::clone) { 
          100:  scope 8 { 
          101:  } 
          102:  } 
          103:  
          104:  bb0: { 
          105:  StorageLive(_2); 
          106:  _2 = &raw const ((*_1).0: [mv; 2]); 
          107:  StorageLive(_3); 
          108:  StorageLive(_4); 
          109:  StorageLive(_5); 
          110:  StorageLive(_6); 
          111:  StorageLive(_7); 
          112:  _3 = copy _2 as usize (Transmute); 
          113:  _4 = BitAnd(copy _3, const 1_usize); 
          114:  _5 = Eq(copy _4, const 0_usize); 
          115:  assert(copy _5, "misaligned pointer dereference: address must be a multiple of {} but is {}", const 2_usize, copy _3) -> [success: bb1, unwind unreachable]; 
          116:  } 
          117:  
          118:  bb1: { 
          119:  _6 = Eq(copy _3, const 0_usize); 
          120:  _7 = Not(copy _6); 
          121:  assert(copy _7, "null pointer dereference occurred") -> [success: bb2, unwind unreachable]; 
          122:  } 
          123:  
            .
            .
            .
>>>>>>

------------------------------------------

error in revision `CLONE`: verification with 'FileCheck' failed
status: exit status: 1
command: "/usr/lib/llvm-22/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/pre-codegen/copy_and_clone.CLONE/copy_and_clone.mir" "/checkout/tests/mir-opt/pre-codegen/copy_and_clone.rs" "--check-prefix=CHECK" "--check-prefix" "CLONE" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/checkout/tests/mir-opt/pre-codegen/copy_and_clone.rs:17:12: error: CHECK: expected string not found in input
 // CHECK: [[C:_.*]] = copy (*_1);
           ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/pre-codegen/copy_and_clone.CLONE/copy_and_clone.mir:22:16: note: scanning from here
fn inter_clone(_1: &Av1BlockInter) -> Av1BlockIntraInter {
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/pre-codegen/copy_and_clone.CLONE/copy_and_clone.mir:23:8: note: possible intended match here
 debug inter => _1;
       ^

Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt/pre-codegen/copy_and_clone.CLONE/copy_and_clone.mir
Check file: /checkout/tests/mir-opt/pre-codegen/copy_and_clone.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: // WARNING: This output format is intended for human consumers only 
            2: // and is subject to change without notice. Knock yourself out. 
            3: // HINT: See also -Z dump-mir for MIR at specific points during compilation. 
            4: fn intra_clone(_1: &Av1BlockIntra) -> Av1BlockIntraInter { 
            5:  debug intra => _1; 
            6:  let mut _0: Av1BlockIntraInter; 
            7:  let mut _2: Av1BlockIntra; 
            8:  scope 1 (inlined <Av1BlockIntra as Clone>::clone) { 
            9:  scope 2 (inlined <TxfmSize as Clone>::clone) { 
           10:  } 
           11:  } 
           12:  
           13:  bb0: { 
           14:  StorageLive(_2); 
           15:  _2 = copy (*_1); 
           16:  _0 = Av1BlockIntraInter::Intra(move _2); 
           17:  StorageDead(_2); 
           18:  return; 
           19:  } 
           20: } 
           21:  
           22: fn inter_clone(_1: &Av1BlockInter) -> Av1BlockIntraInter { 
check:17'0                    X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           23:  debug inter => _1; 
check:17'0     ~~~~~~~~~~~~~~~~~~~~
check:17'1            ?             possible intended match
           24:  let mut _0: Av1BlockIntraInter; 
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           25:  let mut _2: Av1BlockInter; 
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           26:  
check:17'0     ~
           27:  bb0: { 
check:17'0     ~~~~~~~~
           28:  StorageLive(_2); 
check:17'0     ~~~~~~~~~~~~~~~~~~
           29:  _2 = <Av1BlockInter as Clone>::clone(move _1) -> [return: bb1, unwind continue]; 

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-panic Area: Panicking machinery A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-minicore` S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants