Skip to content

Commit 5d4d819

Browse files
committed
---
yaml --- r: 148197 b: refs/heads/try2 c: d578ecc h: refs/heads/master i: 148195: 2dcb62c v: v3
1 parent 302f0ce commit 5d4d819

File tree

13 files changed

+32
-138
lines changed

13 files changed

+32
-138
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: 01794cc993a1f00ca2bc82498b256a88556a4e83
8+
refs/heads/try2: d578ecc4072a0e0fade7d564f0ae6dac31c3fb45
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/docs.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ $(eval $(call libdoc,std,$(STDLIB_CRATE),$(CFG_BUILD)))
308308
$(eval $(call libdoc,extra,$(EXTRALIB_CRATE),$(CFG_BUILD)))
309309
$(eval $(call libdoc,native,$(LIBNATIVE_CRATE),$(CFG_BUILD)))
310310
$(eval $(call libdoc,green,$(LIBGREEN_CRATE),$(CFG_BUILD)))
311-
$(eval $(call libdoc,rustuv,$(LIBRUSTUV_CRATE),$(CFG_BUILD)))
312311

313312
$(eval $(call compiledoc,rustc,$(COMPILER_CRATE),$(CFG_BUILD)))
314313
$(eval $(call compiledoc,syntax,$(LIBSYNTAX_CRATE),$(CFG_BUILD)))

branches/try2/mk/install.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ uninstall:
194194
; \
195195
do rm -f $$i ; \
196196
done
197-
$(Q)rm -Rf $(PHL)/$(CFG_RUSTLIBDIR)
197+
$(Q)rm -Rf $(PHL)/rustc
198198
$(Q)rm -f $(CFG_MANDIR)/man1/rustc.1
199199
$(Q)rm -f $(CFG_MANDIR)/man1/rustdoc.1
200200
$(Q)rm -f $(CFG_MANDIR)/man1/rusti.1

branches/try2/src/libextra/workcache.rs

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -209,28 +209,11 @@ impl Drop for Database {
209209
}
210210
}
211211

212-
pub struct Logger {
213-
// FIXME #4432: Fill in
214-
priv a: ()
215-
}
216-
217-
impl Logger {
218-
219-
pub fn new() -> Logger {
220-
Logger { a: () }
221-
}
222-
223-
pub fn info(&self, i: &str) {
224-
info!("workcache: {}", i);
225-
}
226-
}
227-
228212
pub type FreshnessMap = TreeMap<~str,extern fn(&str,&str)->bool>;
229213

230214
#[deriving(Clone)]
231215
pub struct Context {
232216
db: RWArc<Database>,
233-
priv logger: RWArc<Logger>,
234217
priv cfg: Arc<json::Object>,
235218
/// Map from kinds (source, exe, url, etc.) to a freshness function.
236219
/// The freshness function takes a name (e.g. file path) and value
@@ -275,18 +258,15 @@ fn json_decode<T:Decodable<json::Decoder>>(s: &str) -> T {
275258
impl Context {
276259

277260
pub fn new(db: RWArc<Database>,
278-
lg: RWArc<Logger>,
279261
cfg: Arc<json::Object>) -> Context {
280-
Context::new_with_freshness(db, lg, cfg, Arc::new(TreeMap::new()))
262+
Context::new_with_freshness(db, cfg, Arc::new(TreeMap::new()))
281263
}
282264

283265
pub fn new_with_freshness(db: RWArc<Database>,
284-
lg: RWArc<Logger>,
285266
cfg: Arc<json::Object>,
286267
freshness: Arc<FreshnessMap>) -> Context {
287268
Context {
288269
db: db,
289-
logger: lg,
290270
cfg: cfg,
291271
freshness: freshness
292272
}
@@ -378,15 +358,11 @@ impl<'a> Prep<'a> {
378358
None => fail!("missing freshness-function for '{}'", kind),
379359
Some(f) => (*f)(name, val)
380360
};
381-
self.ctxt.logger.write(|lg| {
382-
if fresh {
383-
lg.info(format!("{} {}:{} is fresh",
384-
cat, kind, name));
385-
} else {
386-
lg.info(format!("{} {}:{} is not fresh",
387-
cat, kind, name))
388-
}
389-
});
361+
if fresh {
362+
info!("{} {}:{} is fresh", cat, kind, name);
363+
} else {
364+
info!("{} {}:{} is not fresh", cat, kind, name);
365+
}
390366
fresh
391367
}
392368

@@ -509,7 +485,6 @@ fn test() {
509485
let db_path = make_path(~"db.json");
510486

511487
let cx = Context::new(RWArc::new(Database::new(db_path)),
512-
RWArc::new(Logger::new()),
513488
Arc::new(TreeMap::new()));
514489

515490
let s = cx.with_prep("test1", |prep| {

branches/try2/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ use middle::moves;
2424
use middle::ty;
2525
use syntax::ast::{MutImmutable, MutMutable};
2626
use syntax::ast;
27-
use syntax::ast_map;
2827
use syntax::ast_util;
2928
use syntax::codemap::Span;
30-
use syntax::parse::token;
3129
use syntax::visit::Visitor;
3230
use syntax::visit;
3331
use util::ppaux::Repr;
@@ -79,7 +77,6 @@ pub fn check_loans(bccx: &BorrowckCtxt,
7977
clcx.visit_block(body, ());
8078
}
8179

82-
#[deriving(Eq)]
8380
enum MoveError {
8481
MoveOk,
8582
MoveWhileBorrowed(/*loan*/@LoanPath, /*loan*/Span)
@@ -128,9 +125,6 @@ impl<'a> CheckLoanCtxt<'a> {
128125
//! given `loan_path`
129126
130127
self.each_in_scope_loan(scope_id, |loan| {
131-
debug!("each_in_scope_restriction found loan: {:?}",
132-
loan.repr(self.tcx()));
133-
134128
let mut ret = true;
135129
for restr in loan.restrictions.iter() {
136130
if restr.loan_path == loan_path {
@@ -653,34 +647,22 @@ impl<'a> CheckLoanCtxt<'a> {
653647

654648
pub fn analyze_move_out_from(&self,
655649
expr_id: ast::NodeId,
656-
mut move_path: @LoanPath)
657-
-> MoveError {
650+
move_path: @LoanPath) -> MoveError {
658651
debug!("analyze_move_out_from(expr_id={:?}, move_path={})",
659-
ast_map::node_id_to_str(self.tcx().items,
660-
expr_id,
661-
token::get_ident_interner()),
662-
move_path.repr(self.tcx()));
663-
664-
// We must check every element of a move path. See
665-
// `borrowck-move-subcomponent.rs` for a test case.
666-
loop {
667-
// check for a conflicting loan:
668-
let mut ret = MoveOk;
669-
self.each_in_scope_restriction(expr_id, move_path, |loan, _| {
670-
// Any restriction prevents moves.
671-
ret = MoveWhileBorrowed(loan.loan_path, loan.span);
672-
false
673-
});
652+
expr_id, move_path.repr(self.tcx()));
674653

675-
if ret != MoveOk {
676-
return ret
677-
}
654+
// FIXME(#4384) inadequare if/when we permit `move a.b`
678655

679-
match *move_path {
680-
LpVar(_) => return MoveOk,
681-
LpExtend(subpath, _, _) => move_path = subpath,
682-
}
683-
}
656+
let mut ret = MoveOk;
657+
658+
// check for a conflicting loan:
659+
self.each_in_scope_restriction(expr_id, move_path, |loan, _| {
660+
// Any restriction prevents moves.
661+
ret = MoveWhileBorrowed(loan.loan_path, loan.span);
662+
false
663+
});
664+
665+
ret
684666
}
685667

686668
pub fn check_call(&self,

branches/try2/src/librustc/middle/borrowck/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -872,10 +872,7 @@ impl Repr for LoanPath {
872872
fn repr(&self, tcx: ty::ctxt) -> ~str {
873873
match self {
874874
&LpVar(id) => {
875-
format!("$({})",
876-
ast_map::node_id_to_str(tcx.items,
877-
id,
878-
token::get_ident_interner()))
875+
format!("$({:?})", id)
879876
}
880877

881878
&LpExtend(lp, _, LpDeref(_)) => {

branches/try2/src/librustdoc/html/render.rs

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ pub struct Cache {
157157
priv stack: ~[~str],
158158
priv parent_stack: ~[ast::NodeId],
159159
priv search_index: ~[IndexItem],
160-
priv privmod: bool,
161160
}
162161

163162
/// Helper struct to render all source code to HTML pages
@@ -242,7 +241,6 @@ pub fn run(mut crate: clean::Crate, dst: Path) {
242241
parent_stack: ~[],
243242
search_index: ~[],
244243
extern_locations: HashMap::new(),
245-
privmod: false,
246244
};
247245
cache.stack.push(crate.name.clone());
248246
crate = cache.fold_crate(crate);
@@ -457,16 +455,6 @@ impl<'a> SourceCollector<'a> {
457455

458456
impl DocFolder for Cache {
459457
fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
460-
// If this is a private module, we don't want it in the search index.
461-
let orig_privmod = match item.inner {
462-
clean::ModuleItem(..) => {
463-
let prev = self.privmod;
464-
self.privmod = prev || item.visibility != Some(ast::Public);
465-
prev
466-
}
467-
_ => self.privmod,
468-
};
469-
470458
// Register any generics to their corresponding string. This is used
471459
// when pretty-printing types
472460
match item.inner {
@@ -542,7 +530,7 @@ impl DocFolder for Cache {
542530
_ => Some((None, self.stack.as_slice()))
543531
};
544532
match parent {
545-
Some((parent, path)) if !self.privmod => {
533+
Some((parent, path)) => {
546534
self.search_index.push(IndexItem {
547535
ty: shortty(&item),
548536
name: s.to_owned(),
@@ -551,7 +539,7 @@ impl DocFolder for Cache {
551539
parent: parent,
552540
});
553541
}
554-
Some(..) | None => {}
542+
None => {}
555543
}
556544
}
557545
None => {}
@@ -624,12 +612,8 @@ impl DocFolder for Cache {
624612
// Private modules may survive the strip-private pass if
625613
// they contain impls for public types, but those will get
626614
// stripped here
627-
clean::Item { inner: clean::ModuleItem(ref m),
628-
visibility, .. }
629-
if (m.items.len() == 0 &&
630-
item.doc_value().is_none()) ||
631-
visibility != Some(ast::Public) => None,
632-
615+
clean::Item { inner: clean::ModuleItem(ref m), .. }
616+
if m.items.len() == 0 => None,
633617
i => Some(i),
634618
}
635619
}
@@ -638,7 +622,6 @@ impl DocFolder for Cache {
638622

639623
if pushed { self.stack.pop(); }
640624
if parent_pushed { self.parent_stack.pop(); }
641-
self.privmod = orig_privmod;
642625
return ret;
643626
}
644627
}
@@ -1203,7 +1186,7 @@ fn item_struct(w: &mut Writer, it: &clean::Item, s: &clean::Struct) {
12031186

12041187
document(w, it);
12051188
match s.struct_type {
1206-
doctree::Plain if s.fields.len() > 0 => {
1189+
doctree::Plain => {
12071190
write!(w, "<h2 class='fields'>Fields</h2>\n<table>");
12081191
for field in s.fields.iter() {
12091192
write!(w, "<tr><td id='structfield.{name}'>\

branches/try2/src/librustdoc/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ pub fn opts() -> ~[groups::OptGroup] {
8383
use extra::getopts::groups::*;
8484
~[
8585
optflag("h", "help", "show this help message"),
86-
optflag("", "version", "print rustdoc's version"),
8786
optopt("r", "input-format", "the input type of the specified file",
8887
"[rust|json]"),
8988
optopt("w", "output-format", "the output type to write",
@@ -120,9 +119,6 @@ pub fn main_args(args: &[~str]) -> int {
120119
if matches.opt_present("h") || matches.opt_present("help") {
121120
usage(args[0]);
122121
return 0;
123-
} else if matches.opt_present("version") {
124-
rustc::version(args[0]);
125-
return 0;
126122
}
127123

128124
if matches.free.len() == 0 {

branches/try2/src/librustdoc/passes.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ impl<'a> fold::DocFolder for Stripper<'a> {
136136
Some(i) => {
137137
match i.inner {
138138
// emptied modules/impls have no need to exist
139-
clean::ModuleItem(ref m)
140-
if m.items.len() == 0 &&
141-
i.doc_value().is_none() => None,
139+
clean::ModuleItem(ref m) if m.items.len() == 0 => None,
142140
clean::ImplItem(ref i) if i.methods.len() == 0 => None,
143141
_ => {
144142
self.retained.insert(i.id);

branches/try2/src/librustpkg/api.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub use source_control::{safe_git_clone, git_clone_url};
2525
use std::run;
2626
use extra::arc::{Arc,RWArc};
2727
use extra::workcache;
28-
use extra::workcache::{Database, Logger, FreshnessMap};
28+
use extra::workcache::{Database, FreshnessMap};
2929
use extra::treemap::TreeMap;
3030

3131
// A little sad -- duplicated from rustc::back::*
@@ -70,14 +70,13 @@ pub fn new_workcache_context(p: &Path) -> workcache::Context {
7070
let db_file = p.join("rustpkg_db.json"); // ??? probably wrong
7171
debug!("Workcache database file: {}", db_file.display());
7272
let db = RWArc::new(Database::new(db_file));
73-
let lg = RWArc::new(Logger::new());
7473
let cfg = Arc::new(TreeMap::new());
7574
let mut freshness: FreshnessMap = TreeMap::new();
7675
// Set up freshness functions for every type of dependency rustpkg
7776
// knows about
7877
freshness.insert(~"file", file_is_fresh);
7978
freshness.insert(~"binary", binary_is_fresh);
80-
workcache::Context::new_with_freshness(db, lg, cfg, Arc::new(freshness))
79+
workcache::Context::new_with_freshness(db, cfg, Arc::new(freshness))
8180
}
8281

8382
pub fn build_lib(sysroot: Path, root: Path, name: ~str, version: Version,

branches/try2/src/librustpkg/parse_args.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ pub struct ParseResult {
3636
/// Parses command line arguments of rustpkg.
3737
/// Returns a triplet (command, remaining_args, context)
3838
pub fn parse_args(args: &[~str]) -> Result<ParseResult, int> {
39-
let opts = ~[ getopts::optflag("h"), getopts::optflag("help"),
40-
getopts::optflag("no-link"),
39+
let opts = ~[ getopts::optflag("no-link"),
4140
getopts::optflag("no-trans"),
4241
// n.b. Ignores different --pretty options for now
4342
getopts::optflag("pretty"),
@@ -72,12 +71,6 @@ pub fn parse_args(args: &[~str]) -> Result<ParseResult, int> {
7271
let pretty = matches.opt_present("pretty");
7372
let emit_llvm = matches.opt_present("emit-llvm");
7473

75-
if matches.opt_present("h") ||
76-
matches.opt_present("help") {
77-
usage::general();
78-
return Err(0);
79-
}
80-
8174
if matches.opt_present("v") ||
8275
matches.opt_present("version") {
8376
version(args[0]);

branches/try2/src/librustpkg/tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use extra::arc::Arc;
2020
use extra::arc::RWArc;
2121
use extra::tempfile::TempDir;
2222
use extra::workcache;
23-
use extra::workcache::{Database, Logger};
23+
use extra::workcache::{Database};
2424
use extra::treemap::TreeMap;
2525
use extra::getopts::groups::getopts;
2626
use std::run::ProcessOutput;
@@ -46,7 +46,6 @@ use exit_codes::{BAD_FLAG_CODE, COPY_FAILED_CODE};
4646
fn fake_ctxt(sysroot: Path, workspace: &Path) -> BuildContext {
4747
let context = workcache::Context::new(
4848
RWArc::new(Database::new(workspace.join("rustpkg_db.json"))),
49-
RWArc::new(Logger::new()),
5049
Arc::new(TreeMap::new()));
5150
BuildContext {
5251
workcache_context: context,

branches/try2/src/test/compile-fail/borrowck-move-subcomponent.rs

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

0 commit comments

Comments
 (0)