Skip to content

Commit 6b6cc55

Browse files
committed
---
yaml --- r: 226165 b: refs/heads/tmp c: f351e76 h: refs/heads/master i: 226163: b284e21 v: v3
1 parent 38842d6 commit 6b6cc55

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: 83dee3dfbb452a7558193f3ce171b3c60bf4a499
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
28+
refs/heads/tmp: f351e762f0af1cce5068850e9bd21c54f7cb15f2
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/src/librustc_typeck/check/cast.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ enum CastError {
100100
DifferingKinds,
101101
IllegalCast,
102102
NeedViaPtr,
103+
NeedViaThinPtr,
103104
NeedViaInt,
104105
NeedViaUsize,
105106
NonScalar,
@@ -120,6 +121,7 @@ impl<'tcx> CastCheck<'tcx> {
120121
e: CastError) {
121122
match e {
122123
CastError::NeedViaPtr |
124+
CastError::NeedViaThinPtr |
123125
CastError::NeedViaInt |
124126
CastError::NeedViaUsize => {
125127
fcx.type_error_message(self.span, |actual| {
@@ -130,6 +132,7 @@ impl<'tcx> CastCheck<'tcx> {
130132
fcx.ccx.tcx.sess.fileline_help(self.span,
131133
&format!("cast through {} first", match e {
132134
CastError::NeedViaPtr => "a raw pointer",
135+
CastError::NeedViaThinPtr => "a thin pointer",
133136
CastError::NeedViaInt => "an integer",
134137
CastError::NeedViaUsize => "a usize",
135138
_ => unreachable!()
@@ -324,7 +327,7 @@ impl<'tcx> CastCheck<'tcx> {
324327
if fcx.type_is_known_to_be_sized(m_expr.ty, self.span) {
325328
Ok(CastKind::PtrAddrCast)
326329
} else {
327-
Err(CastError::NeedViaPtr)
330+
Err(CastError::NeedViaThinPtr)
328331
}
329332
}
330333

branches/tmp/src/test/compile-fail/cast-rfc0401.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn main()
9696
let _ = &f as *const f64; //~ ERROR casting
9797
let _ = fat_v as usize;
9898
//~^ ERROR casting
99-
//~^^ HELP through a raw pointer first
99+
//~^^ HELP through a thin pointer first
100100

101101
let a : *const str = "hello";
102102
let _ = a as *const Foo;

branches/tmp/src/test/compile-fail/fat-ptr-cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn main() {
2121
b as usize; //~ ERROR non-scalar cast
2222
p as usize;
2323
//~^ ERROR casting
24-
//~^^ HELP cast through a raw pointer
24+
//~^^ HELP cast through a thin pointer
2525

2626
// #22955
2727
q as *const [i32]; //~ ERROR casting

0 commit comments

Comments
 (0)