Skip to content

Commit ed07158

Browse files
committed
---
yaml --- r: 54167 b: refs/heads/dist-snap c: 110a273 h: refs/heads/master i: 54165: 8e91971 54163: a969b6f 54159: 1996197 v: v3
1 parent 9925ed8 commit ed07158

File tree

24 files changed

+246
-300
lines changed

24 files changed

+246
-300
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: 3ca7c225e5e2c907393e7e87660509cf877bffc8
10+
refs/heads/dist-snap: 110a273e0d3a34540da2bc1c57027120d81c5e87
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/AUTHORS.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Aydin Kim <[email protected]>
2121
2222
Ben Alpert <[email protected]>
2323
24+
Ben Kelly <[email protected]>
2425
Ben Striegel <[email protected]>
2526
Benjamin Herr <[email protected]>
2627
Benjamin Jackman <[email protected]>
@@ -44,9 +45,12 @@ Daniel Brooks <[email protected]>
4445
Daniel Luz <[email protected]>
4546
Daniel Micay <[email protected]>
4647
Daniel Patterson <[email protected]>
48+
Daniel Ursache Dogariu <[email protected]>
4749
Dave Herman <[email protected]>
4850
David Forsythe <[email protected]>
51+
David Klein <[email protected]>
4952
David Rajchenbach-Teller <[email protected]>
53+
Dimitri Krassovski <[email protected]>
5054
Donovan Preston <[email protected]>
5155
Drew Willcoxon <[email protected]>
5256
Elliott Slaughter <[email protected]>
@@ -66,6 +70,7 @@ Gonçalo Cabrita <[email protected]>
6670
Graham Fawcett <[email protected]>
6771
Grahame Bowland <[email protected]>
6872
Haitao Li <[email protected]>
73+
6974
Huon Wilson <[email protected]>
7075
Ian D. Bollinger <[email protected]>
7176
Ilyong Cho <[email protected]>
@@ -80,11 +85,14 @@ Jeff Balogh <[email protected]>
8085
Jeff Muizelaar <[email protected]>
8186
Jeff Olson <[email protected]>
8287
Jeffrey Yasskin <[email protected]>
88+
Jeong YunWon <[email protected]>
8389
Jens Nockert <[email protected]>
8490
Jesse Jones <[email protected]>
8591
Jesse Ruderman <[email protected]>
92+
Jihyun Yu <[email protected]>
8693
Jim Blandy <[email protected]>
8794
95+
J. J. Weber <[email protected]>
8896
Joe Pletcher <[email protected]>
8997
John Clements <[email protected]>
9098
Jon Morton <[email protected]>
@@ -99,6 +107,7 @@ Kevin Atkinson <[email protected]>
99107
Kevin Cantu <[email protected]>
100108
Kyeongwoon Lee <[email protected]>
101109
Laurent Bonnans <[email protected]>
110+
Lawrence Velázquez <[email protected]>
102111
Lennart Kudling <[email protected]>
103112
Lindsey Kuper <[email protected]>
104113
Luca Bruno <[email protected]>
@@ -112,7 +121,9 @@ Mark Vian <[email protected]>
112121
Martin DeMello <[email protected]>
113122
Marvin Löbel <[email protected]>
114123
Matt Brubeck <[email protected]>
124+
Matthew McPherrin <[email protected]>
115125
Matthew O'Connor <[email protected]>
126+
Matthijs Hofstra <[email protected]>
116127
Max Penet <[email protected]>
117128
Michael Arntzenius <[email protected]>
118129
Michael Bebenita <[email protected]>
@@ -121,6 +132,7 @@ Michael Sullivan <[email protected]>
121132
Mikko Perttunen <[email protected]>
122133
Nick Desaulniers <[email protected]>
123134
Niko Matsakis <[email protected]>
135+
Olivier Saut <[email protected]>
124136
Or Brostovski <[email protected]>
125137
Orphée Lafond-Lummis <[email protected]>
126138
Patrick Walton <[email protected]>
@@ -140,14 +152,17 @@ Roy Frostig <[email protected]>
140152
Ryan Scheel <[email protected]>
141153
Sean Stangl <[email protected]>
142154
Sebastian N. Fernandez <[email protected]>
155+
Seth Pink <[email protected]>
143156
Seo Sanghyeon <[email protected]>
157+
144158
Simon Barber-Dueck <[email protected]>
145159
Simon Sapin <[email protected]>
146160
startling <[email protected]>
147161
Stefan Plantikow <[email protected]>
148162
Steve Klabnik <[email protected]>
149163
Taras Shpot <[email protected]>
150164
Ted Horst <[email protected]>
165+
Thad Guidry <[email protected]>
151166
Tim Chevalier <[email protected]>
152167
Tim Taubert <[email protected]>
153168
@@ -161,5 +176,6 @@ Vincent Belliard <[email protected]>
161176
Wade Mealing <[email protected]>
162177
William Ting <[email protected]>
163178
Yasuhiro Fujii <[email protected]>
179+
Young-il Choi <[email protected]>
164180
Youngsoo Son <[email protected]>
165181
Zack Corr <[email protected]>

branches/dist-snap/RELEASES.txt

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

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"?
4+
* ~2100 changes, numerous bugfixes
145

156
* Syntax changes
167
* The self type parameter in traits is now spelled `Self`
178
* The `self` parameter in trait and impl methods must now be explicitly
189
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
1912
* Replaced the `Durable` trait with the `'static` lifetime
2013
* The old closure type syntax with the trailing sigil has been
2114
removed in favor of the more consistent leading sigil
2215
* `super` is a keyword, and may be prefixed to paths
2316
* Trait bounds are separated with `+` instead of whitespace
2417
* Traits are implemented with `impl Trait for Type`
2518
instead of `impl Type: Trait`
19+
* Lifetime syntax is now `&'l foo` instead of `&l/foo`
2620
* The `export` keyword has finally been removed
2721
* The `move` keyword has been removed (see "Semantic changes")
2822
* The interior mutability qualifier on vectors, `[mut T]`, has been
@@ -41,9 +35,11 @@ Version 0.6 (March 2013)
4135
* Pattern matching over vectors improved and expanded
4236
* `const` renamed to `static` to correspond to lifetime name,
4337
and make room for future `static mut` unsafe mutable globals.
44-
* Replaced `#[deriving_eq]` with `#[deriving(Eq)]`
38+
* Replaced `#[deriving_eq]` with `#[deriving(Eq)]`, etc.
4539
* `Clone` implementations can be automatically generated with
4640
`#[deriving(Clone)]`
41+
* Casts to traits must use a pointer sigil, e.g. `@foo as @Bar`
42+
instead of `foo as Bar`.
4743

4844
* Semantic changes
4945
* Types with owned pointers or custom destructors move by default,
@@ -54,7 +50,11 @@ Version 0.6 (March 2013)
5450
* () has size 0
5551
* The name of the main function can be customized using #[main]
5652
* The default type of an inferred closure is &fn instead of @fn
57-
* Name resolution continues to be tweaked
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.
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,14 +78,15 @@ 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
8184

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

branches/dist-snap/src/libcore/gc.rs

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

11+
#[doc(hidden)];
12+
1113
/*! Precise garbage collector
1214
1315
The precise GC exposes two functions, gc and

branches/dist-snap/src/libcore/unstable/lang.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,8 @@ 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-
// 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-
}
102+
let a: *mut BoxRepr = transmute(a);
103+
(*a).header.ref_count &= !FROZEN_BIT;
108104
}
109105

110106
#[lang="check_not_borrowed"]

branches/dist-snap/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,17 +1579,7 @@ 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
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-
1582+
sp: Option<span>) -> fn_ctxt {
15931583
let llbbs = mk_standard_basic_blocks(llfndecl);
15941584
return @mut fn_ctxt_ {
15951585
llfn: llfndecl,

branches/dist-snap/src/librustc/middle/trans/callee.rs

Lines changed: 1 addition & 3 deletions
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_ref_with_vtables");
220+
let _icx = bcx.insn_ctxt("trans_fn_with_vtables");
221221
let ccx = bcx.ccx();
222222
let tcx = ccx.tcx;
223223

@@ -228,8 +228,6 @@ 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-
233231
// Polytype of the function item (may have type params)
234232
let fn_tpt = ty::lookup_item_type(tcx, def_id);
235233

branches/dist-snap/src/librustc/middle/trans/common.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -250,25 +250,13 @@ 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-
260253
pub fn param_substs_to_str(tcx: ty::ctxt, substs: &param_substs) -> ~str {
261254
fmt!("param_substs {tys:%?, vtables:%?, bounds:%?}",
262255
substs.tys.map(|t| ty_to_str(tcx, *t)),
263256
substs.vtables.map(|vs| vs.map(|v| v.to_str(tcx))),
264257
substs.bounds.map(|b| ty::param_bounds_to_str(tcx, *b)))
265258
}
266259

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-
272260
// Function context. Every LLVM function we create will have one of
273261
// these.
274262
pub struct fn_ctxt_ {
@@ -1379,13 +1367,6 @@ pub fn expr_ty_adjusted(bcx: block, ex: @ast::expr) -> ty::t {
13791367
pub fn node_id_type_params(bcx: block, id: ast::node_id) -> ~[ty::t] {
13801368
let tcx = bcx.tcx();
13811369
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-
13891370
match bcx.fcx.param_substs {
13901371
Some(substs) => {
13911372
do vec::map(params) |t| {
@@ -1442,7 +1423,7 @@ pub fn resolve_vtable_in_fn_ctxt(fcx: fn_ctxt, +vt: typeck::vtable_origin)
14421423
}
14431424
14441425
pub fn find_vtable(tcx: ty::ctxt, ps: &param_substs,
1445-
n_param: uint, n_bound: uint)
1426+
n_param: uint, n_bound: uint)
14461427
-> typeck::vtable_origin {
14471428
debug!("find_vtable_in_fn_ctxt(n_param=%u, n_bound=%u, ps=%?)",
14481429
n_param, n_bound, param_substs_to_str(tcx, ps));

branches/dist-snap/src/librustc/middle/trans/meth.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,6 @@ 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-
181178
// Replace method_self with method_static here.
182179
let mut origin = mentry.origin;
183180
match origin {
@@ -221,8 +218,6 @@ pub fn trans_method_callee(bcx: block,
221218
typeck::method_trait(*) => {}
222219
}
223220
224-
debug!("origin=%?", origin);
225-
226221
match origin {
227222
typeck::method_static(did) => {
228223
let callee_fn = callee::trans_fn_ref(bcx, did, callee_id);
@@ -327,7 +322,6 @@ pub fn trans_static_method_callee(bcx: block,
327322
328323
match vtbls[bound_index] {
329324
typeck::vtable_static(impl_did, ref rcvr_substs, rcvr_origins) => {
330-
fail_unless!(rcvr_substs.all(|t| !ty::type_needs_infer(*t)));
331325
332326
let mth_id = method_with_name(bcx.ccx(), impl_did, mname);
333327
let callee_substs = combine_impl_and_methods_tps(

branches/dist-snap/src/librustc/middle/trans/monomorphize.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ 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)));
5150
let _icx = ccx.insn_ctxt("monomorphic_fn");
5251
let mut must_cast = false;
5352
let substs = vec::map(real_substs, |t| {
@@ -68,11 +67,9 @@ pub fn monomorphic_fn(ccx: @CrateContext,
6867
must_cast = true;
6968
}
7069

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

branches/dist-snap/src/librustc/middle/typeck/astconv.rs

Lines changed: 9 additions & 5 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};
63+
use middle::typeck::{CrateCtxt, write_substs_to_tcx, write_ty_to_tcx};
6464

6565
use core::result;
6666
use core::vec;
@@ -186,15 +186,19 @@ 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-
-> ty_param_substs_and_ty
191-
{
189+
path: @ast::path,
190+
path_id: ast::node_id)
191+
-> ty_param_substs_and_ty {
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();
194195
let ty::ty_param_substs_and_ty {
195196
substs: substs,
196197
ty: ty
197198
} = 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+
198202
ty_param_substs_and_ty { substs: substs, ty: ty }
199203
}
200204

@@ -364,7 +368,7 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Copy + Durable>(
364368
};
365369
match a_def {
366370
ast::def_ty(did) | ast::def_struct(did) => {
367-
ast_path_to_ty(self, rscope, did, path).ty
371+
ast_path_to_ty(self, rscope, did, path, id).ty
368372
}
369373
ast::def_prim_ty(nty) => {
370374
match nty {

0 commit comments

Comments
 (0)