Skip to content

Commit cffb644

Browse files
committed
---
yaml --- r: 49599 b: refs/heads/master c: 3ca7c22 h: refs/heads/master i: 49597: 7659929 49595: cd9fab3 49591: c319f7b 49583: f767494 49567: 82b04cb 49535: 1af62fd v: v3
1 parent 96e007d commit cffb644

File tree

23 files changed

+300
-230
lines changed

23 files changed

+300
-230
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 8cb165a764b7cf650791c0e0cb7cac4dd853fc5c
2+
refs/heads/master: 3ca7c225e5e2c907393e7e87660509cf877bffc8
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: f7a2371c176663d59062ec5158f39faecba45768
55
refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea

trunk/RELEASES.txt

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
Version 0.6 (March 2013)
22
---------------------------
33

4-
* ~2100 changes, numerous bugfixes
4+
* ~2000 changes, numerous bugfixes
5+
6+
* TODO:
7+
* Ord/Cmp
8+
* Lifetime changes
9+
* Remove `static` keyword
10+
* Static method syntax
11+
* `as Trait`
12+
* `copy` removed, replaced with `Clone`?
13+
* More details for "Name resolution continues to be tweaked"?
514

615
* Syntax changes
716
* The self type parameter in traits is now spelled `Self`
817
* The `self` parameter in trait and impl methods must now be explicitly
918
named (for example: `fn f(&self) { }`). Implicit self is deprecated.
10-
* Static methods no longer require the `static` keyword and instead
11-
are distinguished by the lack of a `self` parameter
1219
* Replaced the `Durable` trait with the `'static` lifetime
1320
* The old closure type syntax with the trailing sigil has been
1421
removed in favor of the more consistent leading sigil
1522
* `super` is a keyword, and may be prefixed to paths
1623
* Trait bounds are separated with `+` instead of whitespace
1724
* Traits are implemented with `impl Trait for Type`
1825
instead of `impl Type: Trait`
19-
* Lifetime syntax is now `&'l foo` instead of `&l/foo`
2026
* The `export` keyword has finally been removed
2127
* The `move` keyword has been removed (see "Semantic changes")
2228
* The interior mutability qualifier on vectors, `[mut T]`, has been
@@ -35,11 +41,9 @@ Version 0.6 (March 2013)
3541
* Pattern matching over vectors improved and expanded
3642
* `const` renamed to `static` to correspond to lifetime name,
3743
and make room for future `static mut` unsafe mutable globals.
38-
* Replaced `#[deriving_eq]` with `#[deriving(Eq)]`, etc.
44+
* Replaced `#[deriving_eq]` with `#[deriving(Eq)]`
3945
* `Clone` implementations can be automatically generated with
4046
`#[deriving(Clone)]`
41-
* Casts to traits must use a pointer sigil, e.g. `@foo as @Bar`
42-
instead of `foo as Bar`.
4347

4448
* Semantic changes
4549
* Types with owned pointers or custom destructors move by default,
@@ -50,11 +54,7 @@ Version 0.6 (March 2013)
5054
* () has size 0
5155
* The name of the main function can be customized using #[main]
5256
* The default type of an inferred closure is &fn instead of @fn
53-
* `use` statements may no longer be "chained" - they cannot import
54-
identifiers imported by previous `use` statements
55-
* `use` statements are crate relative, importing from the "top"
56-
of the crate by default. Paths may be prefixed with `super::`
57-
or `self::` to change the search behavior.
57+
* Name resolution continues to be tweaked
5858
* Method visibility is inherited from the implementation declaration
5959
* Structural records have been removed
6060
* Many more types can be used in static items, including enums
@@ -78,15 +78,14 @@ Version 0.6 (March 2013)
7878
* `std::deque` and `std::smallintmap` reimplemented as owned containers
7979
* `core::trie` added as a fast ordered map for integer keys
8080
* Set types added to `core::hashmap`, `core::trie` and `std::treemap`
81-
* `Ord` split into `Ord` and `TotalOrd`. `Ord` is still used to
82-
overload the comparison operators, whereas `TotalOrd` is used
83-
by certain container types
8481

85-
* Other
82+
* Tools
8683
* Replaced the 'cargo' package manager with 'rustpkg'
8784
* Added all-purpose 'rust' tool
8885
* `rustc --test` now supports benchmarks with the `#[bench]` attribute
89-
* rustc now *attempts* to offer spelling suggestions
86+
* rustc now attempts to offer spelling suggestions
87+
88+
* Misc
9089
* Improved support for ARM and Android
9190
* Preliminary MIPS backend
9291
* Improved foreign function ABI implementation for x86, x86_64

trunk/src/libcore/gc.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#[doc(hidden)];
12-
1311
/*! Precise garbage collector
1412
1513
The precise GC exposes two functions, gc and

trunk/src/libcore/unstable/lang.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,12 @@ pub unsafe fn borrow_as_imm(a: *u8) {
9999
#[lang="return_to_mut"]
100100
#[inline(always)]
101101
pub unsafe fn return_to_mut(a: *u8) {
102-
let a: *mut BoxRepr = transmute(a);
103-
(*a).header.ref_count &= !FROZEN_BIT;
102+
// Sometimes the box is null, if it is conditionally frozen.
103+
// See e.g. #4904.
104+
if !a.is_null() {
105+
let a: *mut BoxRepr = transmute(a);
106+
(*a).header.ref_count &= !FROZEN_BIT;
107+
}
104108
}
105109

106110
#[lang="check_not_borrowed"]

trunk/src/librustc/middle/trans/base.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,17 @@ pub fn new_fn_ctxt_w_id(ccx: @CrateContext,
15791579
id: ast::node_id,
15801580
impl_id: Option<ast::def_id>,
15811581
param_substs: Option<@param_substs>,
1582-
sp: Option<span>) -> fn_ctxt {
1582+
sp: Option<span>) -> fn_ctxt
1583+
{
1584+
for param_substs.each |p| { p.validate(); }
1585+
1586+
debug!("new_fn_ctxt_w_id(path=%s, id=%?, impl_id=%?, \
1587+
param_substs=%s",
1588+
path_str(ccx.sess, path),
1589+
id,
1590+
impl_id,
1591+
opt_param_substs_to_str(ccx.tcx, &param_substs));
1592+
15831593
let llbbs = mk_standard_basic_blocks(llfndecl);
15841594
return @mut fn_ctxt_ {
15851595
llfn: llfndecl,

trunk/src/librustc/middle/trans/callee.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ pub fn trans_fn_ref_with_vtables(
217217
// - `type_params`: values for each of the fn/method's type parameters
218218
// - `vtables`: values for each bound on each of the type parameters
219219

220-
let _icx = bcx.insn_ctxt("trans_fn_with_vtables");
220+
let _icx = bcx.insn_ctxt("trans_fn_ref_with_vtables");
221221
let ccx = bcx.ccx();
222222
let tcx = ccx.tcx;
223223

@@ -228,6 +228,8 @@ pub fn trans_fn_ref_with_vtables(
228228
vtables);
229229
let _indenter = indenter();
230230

231+
fail_unless!(type_params.all(|t| !ty::type_needs_infer(*t)));
232+
231233
// Polytype of the function item (may have type params)
232234
let fn_tpt = ty::lookup_item_type(tcx, def_id);
233235

trunk/src/librustc/middle/trans/common.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,25 @@ pub struct param_substs {
250250
self_ty: Option<ty::t>
251251
}
252252

253+
pub impl param_substs {
254+
fn validate(&self) {
255+
for self.tys.each |t| { fail_unless!(!ty::type_needs_infer(*t)); }
256+
for self.self_ty.each |t| { fail_unless!(!ty::type_needs_infer(*t)); }
257+
}
258+
}
259+
253260
pub fn param_substs_to_str(tcx: ty::ctxt, substs: &param_substs) -> ~str {
254261
fmt!("param_substs {tys:%?, vtables:%?, bounds:%?}",
255262
substs.tys.map(|t| ty_to_str(tcx, *t)),
256263
substs.vtables.map(|vs| vs.map(|v| v.to_str(tcx))),
257264
substs.bounds.map(|b| ty::param_bounds_to_str(tcx, *b)))
258265
}
259266

267+
pub fn opt_param_substs_to_str(tcx: ty::ctxt,
268+
substs: &Option<@param_substs>) -> ~str {
269+
substs.map_default(~"None", |&ps| param_substs_to_str(tcx, ps))
270+
}
271+
260272
// Function context. Every LLVM function we create will have one of
261273
// these.
262274
pub struct fn_ctxt_ {
@@ -1367,6 +1379,13 @@ pub fn expr_ty_adjusted(bcx: block, ex: @ast::expr) -> ty::t {
13671379
pub fn node_id_type_params(bcx: block, id: ast::node_id) -> ~[ty::t] {
13681380
let tcx = bcx.tcx();
13691381
let params = ty::node_id_to_type_params(tcx, id);
1382+
1383+
if !params.all(|t| !ty::type_needs_infer(*t)) {
1384+
bcx.sess().bug(
1385+
fmt!("Type parameters for node %d include inference types: %s",
1386+
id, str::connect(params.map(|t| bcx.ty_to_str(*t)), ",")));
1387+
}
1388+
13701389
match bcx.fcx.param_substs {
13711390
Some(substs) => {
13721391
do vec::map(params) |t| {
@@ -1423,7 +1442,7 @@ pub fn resolve_vtable_in_fn_ctxt(fcx: fn_ctxt, +vt: typeck::vtable_origin)
14231442
}
14241443
14251444
pub fn find_vtable(tcx: ty::ctxt, ps: &param_substs,
1426-
n_param: uint, n_bound: uint)
1445+
n_param: uint, n_bound: uint)
14271446
-> typeck::vtable_origin {
14281447
debug!("find_vtable_in_fn_ctxt(n_param=%u, n_bound=%u, ps=%?)",
14291448
n_param, n_bound, param_substs_to_str(tcx, ps));

trunk/src/librustc/middle/trans/meth.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ pub fn trans_method_callee(bcx: block,
175175
-> Callee {
176176
let _icx = bcx.insn_ctxt("impl::trans_method_callee");
177177
178+
debug!("trans_method_callee(callee_id=%?, self=%s, mentry=%?)",
179+
callee_id, bcx.expr_to_str(self), mentry);
180+
178181
// Replace method_self with method_static here.
179182
let mut origin = mentry.origin;
180183
match origin {
@@ -218,6 +221,8 @@ pub fn trans_method_callee(bcx: block,
218221
typeck::method_trait(*) => {}
219222
}
220223
224+
debug!("origin=%?", origin);
225+
221226
match origin {
222227
typeck::method_static(did) => {
223228
let callee_fn = callee::trans_fn_ref(bcx, did, callee_id);
@@ -322,6 +327,7 @@ pub fn trans_static_method_callee(bcx: block,
322327
323328
match vtbls[bound_index] {
324329
typeck::vtable_static(impl_did, ref rcvr_substs, rcvr_origins) => {
330+
fail_unless!(rcvr_substs.all(|t| !ty::type_needs_infer(*t)));
325331
326332
let mth_id = method_with_name(bcx.ccx(), impl_did, mname);
327333
let callee_substs = combine_impl_and_methods_tps(

trunk/src/librustc/middle/trans/monomorphize.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pub fn monomorphic_fn(ccx: @CrateContext,
4747
impl_did_opt: Option<ast::def_id>,
4848
ref_id: Option<ast::node_id>) ->
4949
(ValueRef, bool) {
50+
fail_unless!(real_substs.all(|t| !ty::type_needs_infer(*t)));
5051
let _icx = ccx.insn_ctxt("monomorphic_fn");
5152
let mut must_cast = false;
5253
let substs = vec::map(real_substs, |t| {
@@ -67,9 +68,11 @@ pub fn monomorphic_fn(ccx: @CrateContext,
6768
must_cast = true;
6869
}
6970

70-
debug!("monomorphic_fn(fn_id=%? (%s), real_substs=%?, substs=%?, \
71-
hash_id = %?",
71+
debug!("monomorphic_fn(fn_id=%? (%s), vtables=%?, \
72+
real_substs=%?, substs=%?, \
73+
hash_id = %?",
7274
fn_id, ty::item_path_str(ccx.tcx, fn_id),
75+
vtables,
7376
real_substs.map(|s| ty_to_str(ccx.tcx, *s)),
7477
substs.map(|s| ty_to_str(ccx.tcx, *s)), hash_id);
7578

trunk/src/librustc/middle/typeck/astconv.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ use middle::ty::{ty_param_substs_and_ty};
6060
use middle::ty;
6161
use middle::typeck::rscope::{in_binding_rscope};
6262
use middle::typeck::rscope::{region_scope, type_rscope, RegionError};
63-
use middle::typeck::{CrateCtxt, write_substs_to_tcx, write_ty_to_tcx};
63+
use middle::typeck::{CrateCtxt};
6464

6565
use core::result;
6666
use core::vec;
@@ -186,19 +186,15 @@ pub fn ast_path_to_ty<AC:AstConv,RS:region_scope + Copy + Durable>(
186186
self: &AC,
187187
rscope: &RS,
188188
did: ast::def_id,
189-
path: @ast::path,
190-
path_id: ast::node_id)
191-
-> ty_param_substs_and_ty {
189+
path: @ast::path)
190+
-> ty_param_substs_and_ty
191+
{
192192
// Look up the polytype of the item and then substitute the provided types
193193
// for any type/region parameters.
194-
let tcx = self.tcx();
195194
let ty::ty_param_substs_and_ty {
196195
substs: substs,
197196
ty: ty
198197
} = ast_path_to_substs_and_ty(self, rscope, did, path);
199-
write_ty_to_tcx(tcx, path_id, ty);
200-
write_substs_to_tcx(tcx, path_id, /*bad*/copy substs.tps);
201-
202198
ty_param_substs_and_ty { substs: substs, ty: ty }
203199
}
204200

@@ -368,7 +364,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Copy + Durable>(
368364
};
369365
match a_def {
370366
ast::def_ty(did) | ast::def_struct(did) => {
371-
ast_path_to_ty(self, rscope, did, path, id).ty
367+
ast_path_to_ty(self, rscope, did, path).ty
372368
}
373369
ast::def_prim_ty(nty) => {
374370
match nty {

0 commit comments

Comments
 (0)