Skip to content

Commit 5ccb340

Browse files
committed
---
yaml --- r: 105055 b: refs/heads/snap-stage3 c: 7e7a5e3 h: refs/heads/master i: 105053: c8c11a2 105051: a6791d3 105047: 0feba2b 105039: 2337d62 105023: 77318ae v: v3
1 parent f294669 commit 5ccb340

Some content is hidden

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

111 files changed

+1719
-2644
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 62f1d68439dcfd509eaca29887afa97f22938373
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: a1cb2f5d8c4ce807b27b09344b5ef7d9cd94c04d
4+
refs/heads/snap-stage3: 7e7a5e3d3eabe0ee46474b0eb701c159a45b490f
55
refs/heads/try: db814977d07bd798feb24f6b74c00800ef458a13
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ let mut y = ~5; // mutable
13951395
In contrast with
13961396
owned boxes, where the holder of an owned box is the owner of the pointed-to
13971397
memory, references never imply ownership - they are "borrowed".
1398-
A reference can be borrowed to
1398+
You can borrow a reference to
13991399
any object, and the compiler verifies that it cannot outlive the lifetime of
14001400
the object.
14011401

branches/snap-stage3/src/libarena/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ struct Chunk {
5353
}
5454
impl Chunk {
5555
fn capacity(&self) -> uint {
56-
self.data.deref().borrow().get().capacity()
56+
self.data.borrow().capacity()
5757
}
5858

5959
unsafe fn as_ptr(&self) -> *u8 {
60-
self.data.deref().borrow().get().as_ptr()
60+
self.data.borrow().as_ptr()
6161
}
6262
}
6363

branches/snap-stage3/src/librustc/back/archive.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,8 @@ impl<'a> Archive<'a> {
206206

207207
let mut rustpath = filesearch::rust_path();
208208
rustpath.push(self.sess.filesearch().get_target_lib_path());
209-
let addl_lib_search_paths = self.sess
210-
.opts
211-
.addl_lib_search_paths
212-
.borrow();
213-
let path = addl_lib_search_paths.get().iter();
214-
for path in path.chain(rustpath.iter()) {
209+
let search = self.sess.opts.addl_lib_search_paths.borrow();
210+
for path in search.iter().chain(rustpath.iter()) {
215211
debug!("looking for {} inside {}", name, path.display());
216212
let test = path.join(oslibname.as_slice());
217213
if test.exists() { return test }

branches/snap-stage3/src/librustc/back/link.rs

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,8 @@ pub mod write {
209209
// Emit the bytecode if we're either saving our temporaries or
210210
// emitting an rlib. Whenever an rlib is created, the bytecode is
211211
// inserted into the archive in order to allow LTO against it.
212-
let crate_types = sess.crate_types.borrow();
213212
if sess.opts.cg.save_temps ||
214-
(crate_types.get().contains(&session::CrateTypeRlib) &&
213+
(sess.crate_types.borrow().contains(&session::CrateTypeRlib) &&
215214
sess.opts.output_types.contains(&OutputTypeExe)) {
216215
output.temp_path(OutputTypeBitcode).with_c_str(|buf| {
217216
llvm::LLVMWriteBitcodeToFile(llmod, buf);
@@ -550,15 +549,14 @@ fn symbol_hash(tcx: &ty::ctxt, symbol_hasher: &mut Sha256,
550549
}
551550

552551
fn get_symbol_hash(ccx: &CrateContext, t: ty::t) -> ~str {
553-
match ccx.type_hashcodes.borrow().get().find(&t) {
552+
match ccx.type_hashcodes.borrow().find(&t) {
554553
Some(h) => return h.to_str(),
555554
None => {}
556555
}
557556

558-
let mut type_hashcodes = ccx.type_hashcodes.borrow_mut();
559557
let mut symbol_hasher = ccx.symbol_hasher.borrow_mut();
560-
let hash = symbol_hash(ccx.tcx(), symbol_hasher.get(), t, &ccx.link_meta);
561-
type_hashcodes.get().insert(t, hash.clone());
558+
let hash = symbol_hash(ccx.tcx(), &mut *symbol_hasher, t, &ccx.link_meta);
559+
ccx.type_hashcodes.borrow_mut().insert(t, hash.clone());
562560
hash
563561
}
564562

@@ -779,8 +777,7 @@ pub fn link_binary(sess: &Session,
779777
outputs: &OutputFilenames,
780778
id: &CrateId) -> Vec<Path> {
781779
let mut out_filenames = Vec::new();
782-
let crate_types = sess.crate_types.borrow();
783-
for &crate_type in crate_types.get().iter() {
780+
for &crate_type in sess.crate_types.borrow().iter() {
784781
let out_file = link_binary_output(sess, trans, crate_type, outputs, id);
785782
out_filenames.push(out_file);
786783
}
@@ -887,9 +884,7 @@ fn link_rlib<'a>(sess: &'a Session,
887884
out_filename: &Path) -> Archive<'a> {
888885
let mut a = Archive::create(sess, out_filename, obj_filename);
889886

890-
let used_libraries = sess.cstore.get_used_libraries();
891-
let used_libraries = used_libraries.borrow();
892-
for &(ref l, kind) in used_libraries.get().iter() {
887+
for &(ref l, kind) in sess.cstore.get_used_libraries().borrow().iter() {
893888
match kind {
894889
cstore::NativeStatic => {
895890
a.add_native_library(l.as_slice()).unwrap();
@@ -1227,9 +1222,7 @@ fn link_args(sess: &Session,
12271222
// Finally add all the linker arguments provided on the command line along
12281223
// with any #[link_args] attributes found inside the crate
12291224
args.push_all(sess.opts.cg.link_args.as_slice());
1230-
let used_link_args = sess.cstore.get_used_link_args();
1231-
let used_link_args = used_link_args.borrow();
1232-
for arg in used_link_args.get().iter() {
1225+
for arg in sess.cstore.get_used_link_args().borrow().iter() {
12331226
args.push(arg.clone());
12341227
}
12351228
return args;
@@ -1247,8 +1240,7 @@ fn link_args(sess: &Session,
12471240
// in the current crate. Upstream crates with native library dependencies
12481241
// may have their native library pulled in above.
12491242
fn add_local_native_libraries(args: &mut Vec<~str>, sess: &Session) {
1250-
let addl_lib_search_paths = sess.opts.addl_lib_search_paths.borrow();
1251-
for path in addl_lib_search_paths.get().iter() {
1243+
for path in sess.opts.addl_lib_search_paths.borrow().iter() {
12521244
// FIXME (#9639): This needs to handle non-utf8 paths
12531245
args.push("-L" + path.as_str().unwrap().to_owned());
12541246
}
@@ -1259,9 +1251,7 @@ fn add_local_native_libraries(args: &mut Vec<~str>, sess: &Session) {
12591251
args.push("-L" + path.as_str().unwrap().to_owned());
12601252
}
12611253

1262-
let used_libraries = sess.cstore.get_used_libraries();
1263-
let used_libraries = used_libraries.borrow();
1264-
for &(ref l, kind) in used_libraries.get().iter() {
1254+
for &(ref l, kind) in sess.cstore.get_used_libraries().borrow().iter() {
12651255
match kind {
12661256
cstore::NativeUnknown | cstore::NativeStatic => {
12671257
args.push("-l" + *l);

branches/snap-stage3/src/librustc/back/lto.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ pub fn run(sess: &session::Session, llmod: ModuleRef,
2727
}
2828

2929
// Make sure we actually can run LTO
30-
let crate_types = sess.crate_types.borrow();
31-
for crate_type in crate_types.get().iter() {
30+
for crate_type in sess.crate_types.borrow().iter() {
3231
match *crate_type {
3332
session::CrateTypeExecutable | session::CrateTypeStaticlib => {}
3433
_ => {

branches/snap-stage3/src/librustc/driver/driver.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,7 @@ fn write_out_deps(sess: &Session,
512512
let file = outputs.path(*output_type);
513513
match *output_type {
514514
link::OutputTypeExe => {
515-
let crate_types = sess.crate_types.borrow();
516-
for output in crate_types.get().iter() {
515+
for output in sess.crate_types.borrow().iter() {
517516
let p = link::filename_for_input(sess, *output, &id, &file);
518517
out_filenames.push(p);
519518
}
@@ -542,10 +541,10 @@ fn write_out_deps(sess: &Session,
542541

543542
// Build a list of files used to compile the output and
544543
// write Makefile-compatible dependency rules
545-
let files: Vec<~str> = sess.codemap().files.borrow().get()
544+
let files: Vec<~str> = sess.codemap().files.borrow()
546545
.iter().filter_map(|fmap| {
547-
if fmap.deref().is_real_file() {
548-
Some(fmap.deref().name.clone())
546+
if fmap.is_real_file() {
547+
Some(fmap.name.clone())
549548
} else {
550549
None
551550
}
@@ -683,7 +682,7 @@ pub fn pretty_print_input(sess: Session,
683682
};
684683

685684
let src_name = source_name(input);
686-
let src = sess.codemap().get_filemap(src_name).deref().src.as_bytes().to_owned();
685+
let src = sess.codemap().get_filemap(src_name).src.as_bytes().to_owned();
687686
let mut rdr = MemReader::new(src);
688687

689688
match ppm {

branches/snap-stage3/src/librustc/driver/session.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,11 @@ impl Session {
253253
sp: Span,
254254
msg: ~str) {
255255
let mut lints = self.lints.borrow_mut();
256-
match lints.get().find_mut(&id) {
256+
match lints.find_mut(&id) {
257257
Some(arr) => { arr.push((lint, sp, msg)); return; }
258258
None => {}
259259
}
260-
lints.get().insert(id, vec!((lint, sp, msg)));
260+
lints.insert(id, vec!((lint, sp, msg)));
261261
}
262262
pub fn next_node_id(&self) -> ast::NodeId {
263263
self.reserve_node_ids(1)

branches/snap-stage3/src/librustc/front/test.rs

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ impl<'a> fold::Folder for TestHarnessGenerator<'a> {
8888
}
8989

9090
fn fold_item(&mut self, i: @ast::Item) -> SmallVector<@ast::Item> {
91-
{
92-
let mut path = self.cx.path.borrow_mut();
93-
path.get().push(i.ident);
94-
}
91+
self.cx.path.borrow_mut().push(i.ident);
9592
debug!("current path: {}",
9693
ast_util::path_name_i(self.cx.path.get().as_slice()));
9794

@@ -112,21 +109,15 @@ impl<'a> fold::Folder for TestHarnessGenerator<'a> {
112109
ignore: is_ignored(&self.cx, i),
113110
should_fail: should_fail(i)
114111
};
115-
{
116-
let mut testfns = self.cx.testfns.borrow_mut();
117-
testfns.get().push(test);
118-
}
112+
self.cx.testfns.borrow_mut().push(test);
119113
// debug!("have {} test/bench functions",
120114
// cx.testfns.len());
121115
}
122116
}
123117
}
124118

125119
let res = fold::noop_fold_item(i, self);
126-
{
127-
let mut path = self.cx.path.borrow_mut();
128-
path.get().pop();
129-
}
120+
self.cx.path.borrow_mut().pop();
130121
res
131122
}
132123

@@ -414,12 +405,9 @@ fn is_test_crate(krate: &ast::Crate) -> bool {
414405

415406
fn mk_test_descs(cx: &TestCtxt) -> @ast::Expr {
416407
let mut descs = Vec::new();
417-
{
418-
let testfns = cx.testfns.borrow();
419-
debug!("building test vector from {} tests", testfns.get().len());
420-
for test in testfns.get().iter() {
421-
descs.push(mk_test_desc_and_fn_rec(cx, test));
422-
}
408+
debug!("building test vector from {} tests", cx.testfns.borrow().len());
409+
for test in cx.testfns.borrow().iter() {
410+
descs.push(mk_test_desc_and_fn_rec(cx, test));
423411
}
424412

425413
let inner_expr = @ast::Expr {

branches/snap-stage3/src/librustc/lib/llvm.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,13 +1831,11 @@ impl TypeNames {
18311831
}
18321832

18331833
pub fn associate_type(&self, s: &str, t: &Type) {
1834-
let mut named_types = self.named_types.borrow_mut();
1835-
assert!(named_types.get().insert(s.to_owned(), t.to_ref()));
1834+
assert!(self.named_types.borrow_mut().insert(s.to_owned(), t.to_ref()));
18361835
}
18371836

18381837
pub fn find_type(&self, s: &str) -> Option<Type> {
1839-
let named_types = self.named_types.borrow();
1840-
named_types.get().find_equiv(&s).map(|x| Type::from_ref(*x))
1838+
self.named_types.borrow().find_equiv(&s).map(|x| Type::from_ref(*x))
18411839
}
18421840

18431841
pub fn type_to_str(&self, ty: Type) -> ~str {

branches/snap-stage3/src/librustc/metadata/creader.rs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ pub fn read_crates(sess: &Session,
5151
};
5252
visit_crate(&e, krate);
5353
visit::walk_crate(&mut e, krate, ());
54-
let crate_cache = e.crate_cache.borrow();
55-
dump_crates(crate_cache.get().as_slice());
54+
dump_crates(e.crate_cache.borrow().as_slice());
5655
warn_if_multiple_versions(&mut e,
5756
sess.diagnostic(),
58-
crate_cache.get().as_slice());
57+
e.crate_cache.borrow().as_slice());
5958
}
6059

6160
impl<'a> visit::Visitor<()> for Env<'a> {
@@ -268,8 +267,7 @@ fn visit_item(e: &Env, i: &ast::Item) {
268267

269268
fn existing_match(e: &Env, crate_id: &CrateId,
270269
hash: Option<&Svh>) -> Option<ast::CrateNum> {
271-
let crate_cache = e.crate_cache.borrow();
272-
for c in crate_cache.get().iter() {
270+
for c in e.crate_cache.borrow().iter() {
273271
if !crate_id.matches(&c.crate_id) { continue }
274272
match hash {
275273
Some(hash) if *hash != c.hash => {}
@@ -309,15 +307,12 @@ fn resolve_crate(e: &mut Env,
309307

310308
// Claim this crate number and cache it
311309
let cnum = e.next_crate_num;
312-
{
313-
let mut crate_cache = e.crate_cache.borrow_mut();
314-
crate_cache.get().push(cache_entry {
315-
cnum: cnum,
316-
span: span,
317-
hash: hash,
318-
crate_id: crate_id,
319-
});
320-
}
310+
e.crate_cache.borrow_mut().push(cache_entry {
311+
cnum: cnum,
312+
span: span,
313+
hash: hash,
314+
crate_id: crate_id,
315+
});
321316
e.next_crate_num += 1;
322317

323318
// Maintain a reference to the top most crate.

0 commit comments

Comments
 (0)