Skip to content

Commit 4e14691

Browse files
committed
---
yaml --- r: 137077 b: refs/heads/release-prep c: 7c9db32 h: refs/heads/master i: 137075: ea3b9be v: v3
1 parent 04bb2f4 commit 4e14691

File tree

2 files changed

+2
-2
lines changed
  • branches/release-prep/src/librustc/middle/typeck/check

2 files changed

+2
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2929
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
3030
refs/heads/libuv-update-temp-branch: 6ed22c618766f1f2a2e108eef8ce3f51be0f70b7
3131
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
32-
refs/heads/release-prep: 293b57701b7bcdd88e44ce8f671511ba35cac13e
32+
refs/heads/release-prep: 7c9db32f828729a415f4c334cb69f485e3b84d3d

branches/release-prep/src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ fn check_cast(fcx: &FnCtxt,
14681468
// casts to scalars other than `char` and `bare fn` are trivial
14691469
let t_1_is_trivial = t_1_is_scalar && !t_1_is_char && !t_1_is_bare_fn;
14701470
if ty::type_is_c_like_enum(fcx.tcx(), t_e) && t_1_is_trivial {
1471-
if t_1_is_float {
1471+
if t_1_is_float || ty::type_is_unsafe_ptr(t_1) {
14721472
fcx.type_error_message(span, |actual| {
14731473
format!("illegal cast; cast through an \
14741474
integer first: `{}` as `{}`",

0 commit comments

Comments
 (0)