File tree 6 files changed +12
-11
lines changed
compiler/rustc_const_eval
6 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ const_eval_expected_inbounds_pointer =
93
93
}
94
94
95
95
const_eval_extern_static =
96
- cannot access extern static ( { $did } )
96
+ cannot access extern static ` { $did } `
97
97
const_eval_extern_type_field = `extern type` field does not have a known offset
98
98
99
99
const_eval_fn_ptr_call =
@@ -381,7 +381,7 @@ const_eval_thread_local_access =
381
381
thread-local statics cannot be accessed at compile-time
382
382
383
383
const_eval_thread_local_static =
384
- cannot access thread local static ( { $did } )
384
+ cannot access thread local static ` { $did } `
385
385
const_eval_too_generic =
386
386
encountered overly generic constant
387
387
const_eval_too_many_caller_args =
Original file line number Diff line number Diff line change @@ -898,6 +898,7 @@ impl ReportErrorExt for UnsupportedOpInfo {
898
898
UnsupportedOpInfo :: ExternStatic ( _) => const_eval_extern_static,
899
899
}
900
900
}
901
+
901
902
fn add_args < G : EmissionGuarantee > ( self , diag : & mut Diag < ' _ , G > ) {
902
903
use UnsupportedOpInfo :: * ;
903
904
@@ -917,9 +918,9 @@ impl ReportErrorExt for UnsupportedOpInfo {
917
918
OverwritePartialPointer ( ptr) | ReadPartialPointer ( ptr) => {
918
919
diag. arg ( "ptr" , ptr) ;
919
920
}
920
- ThreadLocalStatic ( did) | ExternStatic ( did) => {
921
- diag. arg ( "did" , format ! ( "{ did:?}" ) ) ;
922
- }
921
+ ThreadLocalStatic ( did) | ExternStatic ( did) => rustc_middle :: ty :: tls :: with ( |tcx| {
922
+ diag. arg ( "did" , tcx . def_path_str ( did) ) ;
923
+ } ) ,
923
924
}
924
925
}
925
926
}
Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ error[E0080]: could not evaluate static initializer
2
2
--> $DIR/extern-static.rs:11:25
3
3
|
4
4
LL | unsafe { let _val = DATA; }
5
- | ^^^^ cannot access extern static (DefId(0:4 ~ extern_static[c41e]::{extern#0}:: DATA))
5
+ | ^^^^ cannot access extern static ` DATA`
6
6
7
7
error[E0080]: could not evaluate static initializer
8
8
--> $DIR/extern-static.rs:16:14
9
9
|
10
10
LL | unsafe { DATA = 0; }
11
- | ^^^^^^^^ cannot access extern static (DefId(0:4 ~ extern_static[c41e]::{extern#0}:: DATA))
11
+ | ^^^^^^^^ cannot access extern static ` DATA`
12
12
13
13
error: aborting due to 2 previous errors
14
14
Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ error[E0080]: could not evaluate static initializer
2
2
--> $DIR/tls.rs:11:25
3
3
|
4
4
LL | unsafe { let _val = A; }
5
- | ^ cannot access thread local static (DefId(0:4 ~ tls[ca29]::A))
5
+ | ^ cannot access thread local static `A`
6
6
7
7
error[E0080]: could not evaluate static initializer
8
8
--> $DIR/tls.rs:20:26
9
9
|
10
10
LL | unsafe { let _val = &A; }
11
- | ^ cannot access thread local static (DefId(0:4 ~ tls[ca29]::A))
11
+ | ^ cannot access thread local static `A`
12
12
13
13
warning: skipping const checks
14
14
|
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ error[E0080]: could not evaluate static initializer
2
2
--> $DIR/issue-28324.rs:5:23
3
3
|
4
4
LL | pub static BAZ: u32 = *&error_message_count;
5
- | ^^^^^^^^^^^^^^^^^^^^^ cannot access extern static (DefId(0:4 ~ issue_28324[8ec4]::{extern#0}:: error_message_count))
5
+ | ^^^^^^^^^^^^^^^^^^^^^ cannot access extern static ` error_message_count`
6
6
7
7
error[E0133]: use of extern static is unsafe and requires unsafe function or block
8
8
--> $DIR/issue-28324.rs:5:25
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ error[E0080]: could not evaluate static initializer
2
2
--> $DIR/issue-14227.rs:4:21
3
3
|
4
4
LL | static CRASH: u32 = symbol;
5
- | ^^^^^^ cannot access extern static (DefId(0:4 ~ issue_14227[1133]::{extern#0}:: symbol))
5
+ | ^^^^^^ cannot access extern static ` symbol`
6
6
7
7
error[E0133]: use of extern static is unsafe and requires unsafe function or block
8
8
--> $DIR/issue-14227.rs:4:21
You can’t perform that action at this time.
0 commit comments