Skip to content

Commit 15ee2b4

Browse files
committed
---
yaml --- r: 93684 b: refs/heads/try c: bc698ba h: refs/heads/master v: v3
1 parent 78a62d4 commit 15ee2b4

File tree

5 files changed

+6
-39
lines changed

5 files changed

+6
-39
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: af62adfad0d0c055ba82c93bbaad4b8ed6ce274c
5+
refs/heads/try: bc698ba3ef17cdd0e51f3389421a5ecf85a23ffc
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/doc/tutorial.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2550,18 +2550,21 @@ fn main() {
25502550
~~~~
25512551

25522552
And here an example with multiple files:
2553+
25532554
~~~{.ignore}
25542555
// a.rs - crate root
25552556
use b::foo;
25562557
mod b;
25572558
fn main() { foo(); }
25582559
~~~
2560+
25592561
~~~{.ignore}
25602562
// b.rs
25612563
use b::c::bar;
25622564
pub mod c;
25632565
pub fn foo() { bar(); }
25642566
~~~
2567+
25652568
~~~
25662569
// c.rs
25672570
pub fn bar() { println("Baz!"); }

branches/try/src/librustc/middle/ty.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2423,13 +2423,6 @@ pub fn type_is_char(ty: t) -> bool {
24232423
}
24242424
}
24252425

2426-
pub fn type_is_bare_fn(ty: t) -> bool {
2427-
match get(ty).sty {
2428-
ty_bare_fn(*) => true,
2429-
_ => false
2430-
}
2431-
}
2432-
24332426
pub fn type_is_fp(ty: t) -> bool {
24342427
match get(ty).sty {
24352428
ty_infer(FloatVar(_)) | ty_float(_) => true,

branches/try/src/librustc/middle/typeck/check/mod.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3022,13 +3022,10 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
30223022

30233023
let t1 = structurally_resolved_type(fcx, e.span, t_1);
30243024
let te = structurally_resolved_type(fcx, e.span, t_e);
3025-
let t_1_is_scalar = type_is_scalar(fcx, expr.span, t_1);
30263025
let t_1_is_char = type_is_char(fcx, expr.span, t_1);
3027-
let t_1_is_bare_fn = type_is_bare_fn(fcx, expr.span, t_1);
30283026

3029-
// casts to scalars other than `char` and `bare fn` are trivial
3030-
let t_1_is_trivial = t_1_is_scalar &&
3031-
!t_1_is_char && !t_1_is_bare_fn;
3027+
// casts to scalars other than `char` are allowed
3028+
let t_1_is_trivial = type_is_scalar(fcx, expr.span, t_1) && !t_1_is_char;
30323029

30333030
if type_is_c_like_enum(fcx, expr.span, t_e) && t_1_is_trivial {
30343031
// casts from C-like enums are allowed
@@ -3828,11 +3825,6 @@ pub fn type_is_char(fcx: @mut FnCtxt, sp: Span, typ: ty::t) -> bool {
38283825
return ty::type_is_char(typ_s);
38293826
}
38303827

3831-
pub fn type_is_bare_fn(fcx: @mut FnCtxt, sp: Span, typ: ty::t) -> bool {
3832-
let typ_s = structurally_resolved_type(fcx, sp, typ);
3833-
return ty::type_is_bare_fn(typ_s);
3834-
}
3835-
38363828
pub fn type_is_unsafe_ptr(fcx: @mut FnCtxt, sp: Span, typ: ty::t) -> bool {
38373829
let typ_s = structurally_resolved_type(fcx, sp, typ);
38383830
return ty::type_is_unsafe_ptr(typ_s);

branches/try/src/test/compile-fail/cast-to-bare-fn.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)