File tree 5 files changed +17
-29
lines changed
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;
14
14
#[ cfg_attr( not( test) , rustc_diagnostic_item = "std_panic_2015_macro" ) ]
15
15
#[ rustc_macro_transparency = "semitransparent" ]
16
16
pub macro panic_2015 {
17
- ( ) => ( {
17
+ ( ) => (
18
18
$crate:: rt:: begin_panic ( "explicit panic" )
19
- } ) ,
20
- ( $msg: expr $( , ) ?) => ( {
19
+ ) ,
20
+ ( $msg: expr $( , ) ?) => (
21
21
$crate:: rt:: begin_panic ( $msg)
22
- } ) ,
22
+ ) ,
23
23
// Special-case the single-argument case for const_panic.
24
- ( "{}" , $arg: expr $( , ) ?) => ( {
24
+ ( "{}" , $arg: expr $( , ) ?) => (
25
25
$crate:: rt:: panic_display ( & $arg)
26
- } ) ,
27
- ( $fmt: expr, $( $arg: tt) +) => ( {
26
+ ) ,
27
+ ( $fmt: expr, $( $arg: tt) +) => (
28
28
$crate:: rt:: panic_fmt ( $crate:: const_format_args!( $fmt, $( $arg) +) )
29
- } ) ,
29
+ ) ,
30
30
}
31
31
32
32
#[ doc ( hidden) ]
Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ fn main() {
2
2
& panic ! ( )
3
3
//~^ ERROR mismatched types
4
4
//~| expected unit type `()`
5
- //~| found reference `&_ `
6
- //~| expected `()`, found reference
5
+ //~| found reference `&! `
6
+ //~| expected `()`, found `&!`
7
7
}
Original file line number Diff line number Diff line change @@ -4,15 +4,10 @@ error[E0308]: mismatched types
4
4
LL | fn main() {
5
5
| - expected `()` because of default return type
6
6
LL | &panic!()
7
- | ^^^^^^^^^ expected `()`, found reference
7
+ | ^^^^^^^^^ expected `()`, found `&!`
8
8
|
9
9
= note: expected unit type `()`
10
- found reference `&_`
11
- help: consider removing the borrow
12
- |
13
- LL - &panic!()
14
- LL + panic!()
15
- |
10
+ found reference `&!`
16
11
17
12
error: aborting due to previous error
18
13
Original file line number Diff line number Diff line change 1
1
error[E0308]: mismatched types
2
2
--> $DIR/diverging-tuple-parts-39485.rs:8:5
3
3
|
4
+ LL | fn g() {
5
+ | - help: try adding a return type: `-> &!`
4
6
LL | &panic!()
5
- | ^^^^^^^^^ expected `()`, found reference
7
+ | ^^^^^^^^^ expected `()`, found `&!`
6
8
|
7
9
= 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 `&!`
18
11
19
12
error[E0308]: mismatched types
20
13
--> $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> {
11
11
fn main ( ) {
12
12
let a = 5 ;
13
13
let _iter = TrieMapIterator { node : & a} ;
14
- _iter. node = & panic ! ( )
14
+ _iter. node = & { panic ! ( ) }
15
15
}
You can’t perform that action at this time.
0 commit comments