File tree Expand file tree Collapse file tree 5 files changed +17
-29
lines changed Expand file tree Collapse file tree 5 files changed +17
-29
lines changed Original file line number Diff line number Diff line change @@ -14,19 +14,19 @@ use crate::thread::Result;
1414#[ cfg_attr( not( test) , rustc_diagnostic_item = "std_panic_2015_macro" ) ]
1515#[ rustc_macro_transparency = "semitransparent" ]
1616pub macro panic_2015 {
17- ( ) => ( {
17+ ( ) => (
1818 $crate:: rt:: begin_panic ( "explicit panic" )
19- } ) ,
20- ( $msg: expr $( , ) ?) => ( {
19+ ) ,
20+ ( $msg: expr $( , ) ?) => (
2121 $crate:: rt:: begin_panic ( $msg)
22- } ) ,
22+ ) ,
2323 // Special-case the single-argument case for const_panic.
24- ( "{}" , $arg: expr $( , ) ?) => ( {
24+ ( "{}" , $arg: expr $( , ) ?) => (
2525 $crate:: rt:: panic_display ( & $arg)
26- } ) ,
27- ( $fmt: expr, $( $arg: tt) +) => ( {
26+ ) ,
27+ ( $fmt: expr, $( $arg: tt) +) => (
2828 $crate:: rt:: panic_fmt ( $crate:: const_format_args!( $fmt, $( $arg) +) )
29- } ) ,
29+ ) ,
3030}
3131
3232#[ doc ( hidden) ]
Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ fn main() {
22 & panic ! ( )
33 //~^ ERROR mismatched types
44 //~| expected unit type `()`
5- //~| found reference `&_ `
6- //~| expected `()`, found reference
5+ //~| found reference `&! `
6+ //~| expected `()`, found `&!`
77}
Original file line number Diff line number Diff line change @@ -4,15 +4,10 @@ error[E0308]: mismatched types
44LL | fn main() {
55 | - expected `()` because of default return type
66LL | &panic!()
7- | ^^^^^^^^^ expected `()`, found reference
7+ | ^^^^^^^^^ expected `()`, found `&!`
88 |
99 = note: expected unit type `()`
10- found reference `&_`
11- help: consider removing the borrow
12- |
13- LL - &panic!()
14- LL + panic!()
15- |
10+ found reference `&!`
1611
1712error: aborting due to previous error
1813
Original file line number Diff line number Diff line change 11error[E0308]: mismatched types
22 --> $DIR/diverging-tuple-parts-39485.rs:8:5
33 |
4+ LL | fn g() {
5+ | - help: try adding a return type: `-> &!`
46LL | &panic!()
5- | ^^^^^^^^^ expected `()`, found reference
7+ | ^^^^^^^^^ expected `()`, found `&!`
68 |
79 = note: expected unit type `()`
8- found reference `&_`
9- help: try adding a return type
10- |
11- LL | fn g() -> &_ {
12- | +++++
13- help: consider removing the borrow
14- |
15- LL - &panic!()
16- LL + panic!()
17- |
10+ found reference `&!`
1811
1912error[E0308]: mismatched types
2013 --> $DIR/diverging-tuple-parts-39485.rs:12:5
Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ struct TrieMapIterator<'a> {
1111fn main ( ) {
1212 let a = 5 ;
1313 let _iter = TrieMapIterator { node : & a} ;
14- _iter. node = & panic ! ( )
14+ _iter. node = & { panic ! ( ) }
1515}
You can’t perform that action at this time.
0 commit comments