File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
23
23
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
24
24
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
25
25
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26
- refs/heads/beta: bcf3921a2aaf72c0f7a3e052dd2ef20f188054a3
26
+ refs/heads/beta: cbf4c342cf9facb660df181c9c1d7d9a8934d5a1
27
27
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28
28
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
29
29
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ enum CastError {
100
100
DifferingKinds ,
101
101
IllegalCast ,
102
102
NeedViaPtr ,
103
+ NeedViaThinPtr ,
103
104
NeedViaInt ,
104
105
NeedViaUsize ,
105
106
NonScalar ,
@@ -120,6 +121,7 @@ impl<'tcx> CastCheck<'tcx> {
120
121
e : CastError ) {
121
122
match e {
122
123
CastError :: NeedViaPtr |
124
+ CastError :: NeedViaThinPtr |
123
125
CastError :: NeedViaInt |
124
126
CastError :: NeedViaUsize => {
125
127
fcx. type_error_message ( self . span , |actual| {
@@ -130,6 +132,7 @@ impl<'tcx> CastCheck<'tcx> {
130
132
fcx. ccx . tcx . sess . fileline_help ( self . span ,
131
133
& format ! ( "cast through {} first" , match e {
132
134
CastError :: NeedViaPtr => "a raw pointer" ,
135
+ CastError :: NeedViaThinPtr => "a thin pointer" ,
133
136
CastError :: NeedViaInt => "an integer" ,
134
137
CastError :: NeedViaUsize => "a usize" ,
135
138
_ => unreachable!( )
@@ -324,7 +327,7 @@ impl<'tcx> CastCheck<'tcx> {
324
327
if fcx. type_is_known_to_be_sized ( m_expr. ty , self . span ) {
325
328
Ok ( CastKind :: PtrAddrCast )
326
329
} else {
327
- Err ( CastError :: NeedViaPtr )
330
+ Err ( CastError :: NeedViaThinPtr )
328
331
}
329
332
}
330
333
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ fn main()
96
96
let _ = & f as * const f64 ; //~ ERROR casting
97
97
let _ = fat_v as usize ;
98
98
//~^ ERROR casting
99
- //~^^ HELP through a raw pointer first
99
+ //~^^ HELP through a thin pointer first
100
100
101
101
let a : * const str = "hello" ;
102
102
let _ = a as * const Foo ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ fn main() {
21
21
b as usize ; //~ ERROR non-scalar cast
22
22
p as usize ;
23
23
//~^ ERROR casting
24
- //~^^ HELP cast through a raw pointer
24
+ //~^^ HELP cast through a thin pointer
25
25
26
26
// #22955
27
27
q as * const [ i32 ] ; //~ ERROR casting
You can’t perform that action at this time.
0 commit comments