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 1
1
---
2
2
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
3
3
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4
- refs/heads/try: bcf3921a2aaf72c0f7a3e052dd2ef20f188054a3
4
+ refs/heads/try: cbf4c342cf9facb660df181c9c1d7d9a8934d5a1
5
5
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
6
6
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
7
7
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
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