Skip to content

Commit 435a2d0

Browse files
committed
---
yaml --- r: 151025 b: refs/heads/try2 c: f495723 h: refs/heads/master i: 151023: e1957bc v: v3
1 parent becd4b9 commit 435a2d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+3268
-2870
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 09bfb92fdc3ccff42dfcf91b0af368f88dc3e446
8+
refs/heads/try2: f49572373347b4110e7140fafbcb57db112712bd
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pleasant high-level features include:
3333
This is an introductory tutorial for the Rust programming language. It
3434
covers the fundamentals of the language, including the syntax, the
3535
type system and memory model, generics, and modules. [Additional
36-
tutorials](#what-next?) cover specific language features in greater
36+
tutorials](#what-next) cover specific language features in greater
3737
depth.
3838

3939
This tutorial assumes that the reader is already familiar with one or
@@ -2253,7 +2253,7 @@ defining one.
22532253
22542254
The type parameters bound by a trait are in scope in each of the
22552255
method declarations. So, re-declaring the type parameter
2256-
`T` as an explicit type parameter for `len`, in either the trait or
2256+
`T` as an explicit type parameter for `length`, in either the trait or
22572257
the impl, would be a compile-time error.
22582258
22592259
Within a trait definition, `Self` is a special type that you can think

branches/try2/src/libcollections/btree.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,13 +659,13 @@ impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for Branch<K, V> {
659659
}
660660
}
661661

662-
//A LeafElt contains no left child, but a key-value pair.
662+
//A LeafElt containts no left child, but a key-value pair.
663663
struct LeafElt<K, V> {
664664
key: K,
665665
value: V
666666
}
667667

668-
//A BranchElt has a left child in insertion to a key-value pair.
668+
//A BranchElt has a left child in insertition to a key-value pair.
669669
struct BranchElt<K, V> {
670670
left: ~Node<K, V>,
671671
key: K,

branches/try2/src/libcollections/hashmap.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ static INITIAL_LOAD_FACTOR: Fraction = (9, 10);
605605
//
606606
// > Why a load factor of 90%?
607607
//
608-
// In general, all the distances to initial buckets will converge on the mean.
608+
// In general, all the distances to inital buckets will converge on the mean.
609609
// At a load factor of α, the odds of finding the target bucket after k
610610
// probes is approximately 1-α^k. If we set this equal to 50% (since we converge
611611
// on the mean) and set k=8 (64-byte cache line / 8-byte hash), α=0.92. I round
@@ -618,7 +618,7 @@ static INITIAL_LOAD_FACTOR: Fraction = (9, 10);
618618
// > Wait, what? Where did you get 1-α^k from?
619619
//
620620
// On the first probe, your odds of a collision with an existing element is α.
621-
// The odds of doing this twice in a row is approximately α^2. For three times,
621+
// The odds of doing this twice in a row is approximatelly α^2. For three times,
622622
// α^3, etc. Therefore, the odds of colliding k times is α^k. The odds of NOT
623623
// colliding after k tries is 1-α^k.
624624
//
@@ -692,7 +692,7 @@ static INITIAL_LOAD_FACTOR: Fraction = (9, 10);
692692
/// let mut book_reviews = HashMap::new();
693693
///
694694
/// // review some books.
695-
/// book_reviews.insert("Adventures of Huckleberry Finn", "My favorite book.");
695+
/// book_reviews.insert("Adventures of Hucklebury Fin", "My favorite book.");
696696
/// book_reviews.insert("Grimms' Fairy Tales", "Masterpiece.");
697697
/// book_reviews.insert("Pride and Prejudice", "Very enjoyable.");
698698
/// book_reviews.insert("The Adventures of Sherlock Holmes", "Eye lyked it alot.");
@@ -782,7 +782,7 @@ impl<K: TotalEq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
782782
/// from its 'ideal' location.
783783
///
784784
/// In the cited blog posts above, this is called the "distance to
785-
/// initial bucket", or DIB.
785+
/// inital bucket", or DIB.
786786
fn bucket_distance(&self, index_of_elem: &table::FullIndex) -> uint {
787787
// where the hash of the element that happens to reside at
788788
// `index_of_elem` tried to place itself first.

branches/try2/src/libcollections/treemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ pub struct RevMutEntries<'a, K, V> {
308308
// (with many different `x`) below, so we need to optionally pass mut
309309
// as a tt, but the only thing we can do with a `tt` is pass them to
310310
// other macros, so this takes the `& <mutability> <operand>` token
311-
// sequence and forces their evaluation as an expression.
311+
// sequence and forces their evalutation as an expression.
312312
macro_rules! addr { ($e:expr) => { $e }}
313313
// putting an optional mut into type signatures
314314
macro_rules! item { ($i:item) => { $i }}

branches/try2/src/libcollections/trie.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl<T> TrieMap<T> {
141141
// (with many different `x`) below, so we need to optionally pass mut
142142
// as a tt, but the only thing we can do with a `tt` is pass them to
143143
// other macros, so this takes the `& <mutability> <operand>` token
144-
// sequence and forces their evaluation as an expression. (see also
144+
// sequence and forces their evalutation as an expression. (see also
145145
// `item!` below.)
146146
macro_rules! addr { ($e:expr) => { $e } }
147147

branches/try2/src/libnum/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ macro_rules! impl_integer_for_int {
171171
/// `other`.
172172
#[inline]
173173
fn lcm(&self, other: &$T) -> $T {
174-
// should not have to recalculate abs
174+
// should not have to recaluculate abs
175175
((*self * *other) / self.gcd(other)).abs()
176176
}
177177

branches/try2/src/librustc/back/link.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ fn link_args(sess: &Session,
11711171
// actually creates "invalid" objects [1] [2], but only for some
11721172
// introspection tools, not in terms of whether it can be loaded.
11731173
//
1174-
// Long story short, passing this flag forces the linker to *not*
1174+
// Long story shory, passing this flag forces the linker to *not*
11751175
// truncate section names (so we can find the metadata section after
11761176
// it's compiled). The real kicker is that rust compiled just fine on
11771177
// windows for quite a long time *without* this flag, so I have no idea
@@ -1491,7 +1491,7 @@ fn add_upstream_rust_crates(args: &mut Vec<~str>, sess: &Session,
14911491
}
14921492

14931493
// Link in all of our upstream crates' native dependencies. Remember that
1494-
// all of these upstream native dependencies are all non-static
1494+
// all of these upstream native depenencies are all non-static
14951495
// dependencies. We've got two cases then:
14961496
//
14971497
// 1. The upstream crate is an rlib. In this case we *must* link in the
@@ -1509,7 +1509,7 @@ fn add_upstream_rust_crates(args: &mut Vec<~str>, sess: &Session,
15091509
// be instantiated in the target crate, meaning that the native symbol must
15101510
// also be resolved in the target crate.
15111511
fn add_upstream_native_libraries(args: &mut Vec<~str>, sess: &Session) {
1512-
// Be sure to use a topological sorting of crates because there may be
1512+
// Be sure to use a topological sorting of crates becuase there may be
15131513
// interdependencies between native libraries. When passing -nodefaultlibs,
15141514
// for example, almost all native libraries depend on libc, so we have to
15151515
// make sure that's all the way at the right (liblibc is near the base of

branches/try2/src/librustc/back/svh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
//! such.
2121
//!
2222
//! The core of this problem is when an upstream dependency changes and
23-
//! downstream dependents are not recompiled. This causes compile errors because
23+
//! downstream dependants are not recompiled. This causes compile errors because
2424
//! the upstream crate's metadata has changed but the downstream crates are
2525
//! still referencing the older crate's metadata.
2626
//!

branches/try2/src/librustc/driver/driver.rs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ pub fn phase_3_run_analysis_passes(sess: Session,
299299
last_private_map: last_private_map
300300
} =
301301
time(time_passes, "resolution", (), |_|
302-
middle::resolve::resolve_crate(&sess, &lang_items, krate));
302+
middle::resolve::resolve_crate(&sess, lang_items, krate));
303303

304304
// Discard MTWT tables that aren't required past resolution.
305305
syntax::ext::mtwt::clear_tables();
@@ -316,7 +316,7 @@ pub fn phase_3_run_analysis_passes(sess: Session,
316316
sess.diagnostic(), krate)));
317317

318318
let freevars = time(time_passes, "freevar finding", (), |_|
319-
freevars::annotate_freevars(&def_map, krate));
319+
freevars::annotate_freevars(def_map, krate));
320320

321321
let region_map = time(time_passes, "region resolution", (), |_|
322322
middle::region::resolve_crate(&sess, krate));
@@ -328,7 +328,7 @@ pub fn phase_3_run_analysis_passes(sess: Session,
328328
freevars, region_map, lang_items);
329329

330330
// passes are timed inside typeck
331-
typeck::check_crate(&ty_cx, trait_map, krate);
331+
let (method_map, vtable_map) = typeck::check_crate(&ty_cx, trait_map, krate);
332332

333333
time(time_passes, "check static items", (), |_|
334334
middle::check_static::check_crate(&ty_cx, krate));
@@ -338,52 +338,56 @@ pub fn phase_3_run_analysis_passes(sess: Session,
338338
middle::const_eval::process_crate(krate, &ty_cx));
339339

340340
time(time_passes, "const checking", (), |_|
341-
middle::check_const::check_crate(krate, &ty_cx));
341+
middle::check_const::check_crate(krate, def_map, method_map, &ty_cx));
342342

343343
let maps = (external_exports, last_private_map);
344344
let (exported_items, public_items) =
345345
time(time_passes, "privacy checking", maps, |(a, b)|
346-
middle::privacy::check_crate(&ty_cx, &exp_map2, a, b, krate));
346+
middle::privacy::check_crate(&ty_cx, &method_map, &exp_map2,
347+
a, b, krate));
347348

348349
time(time_passes, "effect checking", (), |_|
349-
middle::effect::check_crate(&ty_cx, krate));
350+
middle::effect::check_crate(&ty_cx, method_map, krate));
350351

351352
let middle::moves::MoveMaps {moves_map, moved_variables_set,
352353
capture_map} =
353354
time(time_passes, "compute moves", (), |_|
354-
middle::moves::compute_moves(&ty_cx, krate));
355+
middle::moves::compute_moves(&ty_cx, method_map, krate));
355356

356357
time(time_passes, "match checking", (), |_|
357-
middle::check_match::check_crate(&ty_cx, &moves_map, krate));
358+
middle::check_match::check_crate(&ty_cx, method_map,
359+
&moves_map, krate));
358360

359361
time(time_passes, "liveness checking", (), |_|
360-
middle::liveness::check_crate(&ty_cx, &capture_map, krate));
362+
middle::liveness::check_crate(&ty_cx, method_map,
363+
&capture_map, krate));
361364

362365
let root_map =
363366
time(time_passes, "borrow checking", (), |_|
364-
middle::borrowck::check_crate(&ty_cx, &moves_map,
365-
&moved_variables_set,
367+
middle::borrowck::check_crate(&ty_cx, method_map,
368+
&moves_map, &moved_variables_set,
366369
&capture_map, krate));
367370

368371
drop(moves_map);
369372
drop(moved_variables_set);
370373

371374
time(time_passes, "kind checking", (), |_|
372-
kind::check_crate(&ty_cx, krate));
375+
kind::check_crate(&ty_cx, method_map, krate));
373376

374377
let reachable_map =
375378
time(time_passes, "reachability checking", (), |_|
376-
reachable::find_reachable(&ty_cx, &exported_items));
379+
reachable::find_reachable(&ty_cx, method_map, &exported_items));
377380

378381
time(time_passes, "death checking", (), |_| {
379382
middle::dead::check_crate(&ty_cx,
383+
method_map,
380384
&exported_items,
381385
&reachable_map,
382386
krate)
383387
});
384388

385389
time(time_passes, "lint checking", (), |_|
386-
lint::check_crate(&ty_cx, &exported_items, krate));
390+
lint::check_crate(&ty_cx, method_map, &exported_items, krate));
387391

388392
CrateAnalysis {
389393
exp_map2: exp_map2,
@@ -392,6 +396,8 @@ pub fn phase_3_run_analysis_passes(sess: Session,
392396
public_items: public_items,
393397
maps: astencode::Maps {
394398
root_map: root_map,
399+
method_map: method_map,
400+
vtable_map: vtable_map,
395401
capture_map: RefCell::new(capture_map)
396402
},
397403
reachable: reachable_map

branches/try2/src/librustc/lib/llvm.rs

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,23 +1882,37 @@ impl TypeNames {
18821882

18831883
/* Memory-managed interface to target data. */
18841884

1885-
pub struct TargetData {
1886-
pub lltd: TargetDataRef
1885+
pub struct target_data_res {
1886+
pub td: TargetDataRef,
18871887
}
18881888

1889-
impl Drop for TargetData {
1889+
impl Drop for target_data_res {
18901890
fn drop(&mut self) {
18911891
unsafe {
1892-
llvm::LLVMDisposeTargetData(self.lltd);
1892+
llvm::LLVMDisposeTargetData(self.td);
18931893
}
18941894
}
18951895
}
18961896

1897+
pub fn target_data_res(td: TargetDataRef) -> target_data_res {
1898+
target_data_res {
1899+
td: td
1900+
}
1901+
}
1902+
1903+
pub struct TargetData {
1904+
pub lltd: TargetDataRef,
1905+
dtor: @target_data_res
1906+
}
1907+
18971908
pub fn mk_target_data(string_rep: &str) -> TargetData {
1909+
let lltd = string_rep.with_c_str(|buf| {
1910+
unsafe { llvm::LLVMCreateTargetData(buf) }
1911+
});
1912+
18981913
TargetData {
1899-
lltd: string_rep.with_c_str(|buf| {
1900-
unsafe { llvm::LLVMCreateTargetData(buf) }
1901-
})
1914+
lltd: lltd,
1915+
dtor: @target_data_res(lltd)
19021916
}
19031917
}
19041918

@@ -1935,22 +1949,35 @@ impl Drop for ObjectFile {
19351949

19361950
/* Memory-managed interface to section iterators. */
19371951

1938-
pub struct SectionIter {
1939-
pub llsi: SectionIteratorRef
1952+
pub struct section_iter_res {
1953+
pub si: SectionIteratorRef,
19401954
}
19411955

1942-
impl Drop for SectionIter {
1956+
impl Drop for section_iter_res {
19431957
fn drop(&mut self) {
19441958
unsafe {
1945-
llvm::LLVMDisposeSectionIterator(self.llsi);
1959+
llvm::LLVMDisposeSectionIterator(self.si);
19461960
}
19471961
}
19481962
}
19491963

1964+
pub fn section_iter_res(si: SectionIteratorRef) -> section_iter_res {
1965+
section_iter_res {
1966+
si: si
1967+
}
1968+
}
1969+
1970+
pub struct SectionIter {
1971+
pub llsi: SectionIteratorRef,
1972+
dtor: @section_iter_res
1973+
}
1974+
19501975
pub fn mk_section_iter(llof: ObjectFileRef) -> SectionIter {
19511976
unsafe {
1977+
let llsi = llvm::LLVMGetSections(llof);
19521978
SectionIter {
1953-
llsi: llvm::LLVMGetSections(llof)
1979+
llsi: llsi,
1980+
dtor: @section_iter_res(llsi)
19541981
}
19551982
}
19561983
}

0 commit comments

Comments
 (0)