Skip to content

Commit 6ec8493

Browse files
committed
---
yaml --- r: 146392 b: refs/heads/try2 c: b5c1b48 h: refs/heads/master v: v3
1 parent ac84db7 commit 6ec8493

File tree

19 files changed

+242
-126
lines changed

19 files changed

+242
-126
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: 0ce1b2f04d5b1a427f966ed70b09e95ae882947e
8+
refs/heads/try2: b5c1b48048cc911c3caa07ada776239123a97b50
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/Makefile.in

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ endef
249249
# by $(2) with a space character prefix, which invalidates the
250250
# construction $(1)$(2).
251251
define CHECK_FOR_OLD_GLOB_MATCHES_EXCEPT
252-
$(Q)MATCHES="$(filter-out %$(3),$(wildcard $(1)/$(2)))"; if [ -n "$$MATCHES" ] ; then echo "Warning: there are previous" \'$(2)\' "libraries:" $$MATCHES; fi
252+
$(Q)MATCHES="$(filter-out %$(3),$(wildcard $(1)/$(2)))"; if [ -n "$$MATCHES" ] ; then echo "warning: there are previous" \'$(2)\' "libraries:" $$MATCHES; fi
253253
endef
254254

255255
# Same interface as above, but deletes rather than just listing the files.
256256
define REMOVE_ALL_OLD_GLOB_MATCHES_EXCEPT
257-
$(Q)MATCHES="$(filter-out %$(3),$(wildcard $(1)/$(2)))"; if [ -n "$$MATCHES" ] ; then echo "Warning: removing previous" \'$(2)\' "libraries:" $$MATCHES; rm $$MATCHES ; fi
257+
$(Q)MATCHES="$(filter-out %$(3),$(wildcard $(1)/$(2)))"; if [ -n "$$MATCHES" ] ; then echo "warning: removing previous" \'$(2)\' "libraries:" $$MATCHES; rm $$MATCHES ; fi
258258
endef
259259

260260
# We use a different strategy for LIST_ALL_OLD_GLOB_MATCHES_EXCEPT
@@ -265,7 +265,7 @@ endef
265265
# be run at the outset of a command list in a rule.)
266266
ifdef VERBOSE
267267
define LIST_ALL_OLD_GLOB_MATCHES_EXCEPT
268-
@echo "Info: now are following matches for" '$(2)' "libraries:"
268+
@echo "info: now are following matches for" '$(2)' "libraries:"
269269
@( cd $(1) && ( ls $(2) 2>/dev/null || true ) | grep -v $(3) || true )
270270
endef
271271
else
@@ -677,12 +677,6 @@ ifneq ($(findstring clean,$(MAKECMDGOALS)),)
677677
endif
678678

679679
ifneq ($(findstring install,$(MAKECMDGOALS)),)
680-
ifdef DESTDIR
681-
CFG_INFO := $(info cfg: setting CFG_PREFIX via DESTDIR, $(DESTDIR)/$(CFG_PREFIX))
682-
CFG_PREFIX:=$(DESTDIR)/$(CFG_PREFIX)
683-
export CFG_PREFIX
684-
endif
685-
686680
CFG_INFO := $(info cfg: including install rules)
687681
include $(CFG_SRC_DIR)mk/install.mk
688682
endif

branches/try2/configure

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,12 +463,14 @@ then
463463
# extract the first 2 version fields, ignore everything else
464464
sed 's/pandoc \([0-9]*\)\.\([0-9]*\).*/\1 \2/')
465465

466+
MIN_PV_MAJOR="1"
467+
MIN_PV_MINOR="9"
466468
# these patterns are shell globs, *not* regexps
467469
PV_MAJOR=${PV_MAJOR_MINOR% *}
468470
PV_MINOR=${PV_MAJOR_MINOR#* }
469-
if [ "$PV_MAJOR" -lt "1" ] || [ "$PV_MINOR" -lt "8" ]
471+
if [ "$PV_MAJOR" -lt "$MIN_PV_MAJOR" ] || [ "$PV_MINOR" -lt "$MIN_PV_MINOR" ]
470472
then
471-
step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. disabling"
473+
step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. Need at least $MIN_PV_MAJOR.$MIN_PV_MINOR. Disabling"
472474
BAD_PANDOC=1
473475
fi
474476
fi

branches/try2/mk/install.mk

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@
1818
# $(2) is the destination directory
1919
# $(3) is the filename/libname-glob
2020
ifdef VERBOSE
21-
INSTALL = install -m755 $(1)/$(3) $(2)/$(3)
21+
INSTALL = install -m755 $(1)/$(3) $(DESTDIR)$(2)/$(3)
2222
else
23-
INSTALL = $(Q)$(call E, install: $(2)/$(3)) && install -m755 $(1)/$(3) $(2)/$(3)
23+
INSTALL = $(Q)$(call E, install: $(DESTDIR)$(2)/$(3)) && install -m755 $(1)/$(3) $(DESTDIR)$(2)/$(3)
2424
endif
2525

2626
# For MK_INSTALL_DIR
2727
# $(1) is the directory to create
28-
MK_INSTALL_DIR = (umask 022 && mkdir -p $(1))
28+
MK_INSTALL_DIR = (umask 022 && mkdir -p $(DESTDIR)$(1))
2929

3030
# For INSTALL_LIB,
3131
# Target-specific $(LIB_SOURCE_DIR) is the source directory
3232
# Target-specific $(LIB_DESTIN_DIR) is the destination directory
3333
# $(1) is the filename/libname-glob
3434
ifdef VERBOSE
35-
DO_INSTALL_LIB = install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(LIB_DESTIN_DIR)/
35+
DO_INSTALL_LIB = install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(DESTDIR)$(LIB_DESTIN_DIR)/
3636
else
37-
DO_INSTALL_LIB = $(Q)$(call E, install_lib: $(LIB_DESTIN_DIR)/$(1)) && \
38-
install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(LIB_DESTIN_DIR)/
37+
DO_INSTALL_LIB = $(Q)$(call E, install_lib: $(DESTDIR)$(LIB_DESTIN_DIR)/$(1)) && \
38+
install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(DESTDIR)$(LIB_DESTIN_DIR)/
3939
endif
4040

4141
# Target-specific $(LIB_SOURCE_DIR) is the source directory
@@ -50,7 +50,7 @@ define INSTALL_LIB
5050
MATCHES="$(filter-out %$(notdir $(lastword $(wildcard $(LIB_SOURCE_DIR)/$(1)))),\
5151
$(wildcard $(LIB_DESTIN_DIR)/$(1)))"; \
5252
if [ -n "$$MATCHES" ]; then \
53-
echo "Warning, one or libraries matching Rust library '$(1)'" && \
53+
echo "warning: one or libraries matching Rust library '$(1)'" && \
5454
echo " (other than '$$LIB_NAME' itself) already present" && \
5555
echo " at destination $(LIB_DESTIN_DIR):" && \
5656
echo $$MATCHES ; \
@@ -152,9 +152,9 @@ install-host: $(CSREQ$(ISTAGE)_T_$(CFG_BUILD_)_H_$(CFG_BUILD_))
152152
$(Q)$(call INSTALL_LIB,$(LIBRUSTDOC_GLOB_$(CFG_BUILD)))
153153
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_RUNTIME_$(CFG_BUILD)))
154154
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_RUSTLLVM_$(CFG_BUILD)))
155-
$(Q)$(call INSTALL,$(S)/man, $(CFG_MANDIR)/man1,rustc.1)
156-
$(Q)$(call INSTALL,$(S)/man, $(CFG_MANDIR)/man1,rustdoc.1)
157-
$(Q)$(call INSTALL,$(S)/man, $(CFG_MANDIR)/man1,rustpkg.1)
155+
$(Q)$(call INSTALL,$(S)/man,$(CFG_MANDIR)/man1,rustc.1)
156+
$(Q)$(call INSTALL,$(S)/man,$(CFG_MANDIR)/man1,rustdoc.1)
157+
$(Q)$(call INSTALL,$(S)/man,$(CFG_MANDIR)/man1,rustpkg.1)
158158

159159
install-targets: $(INSTALL_TARGET_RULES)
160160

branches/try2/src/libextra/extra.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ pub mod extra {
118118
pub use std::clone;
119119
pub use std::condition;
120120
pub use std::cmp;
121-
// NOTE: Remove import after next snapshot
122-
#[cfg(stage0)]
123-
pub use std::sys;
124121
pub use std::unstable;
125122
pub use std::str;
126123
pub use std::os;

branches/try2/src/librustc/middle/lint.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -951,10 +951,9 @@ impl Visitor<()> for MissingDocLintVisitor {
951951
// trait (which was already linted)
952952
ast::item_impl(_, Some(*), _, _) => return,
953953

954-
ast::item_trait(*) if it.vis == ast::public => {
955-
self.check_attrs(it.attrs, it.id, it.span,
956-
~"missing documentation for a trait");
957-
}
954+
ast::item_trait(*) if it.vis != ast::public => return,
955+
ast::item_trait(*) => self.check_attrs(it.attrs, it.id, it.span,
956+
~"missing documentation for a trait"),
958957

959958
ast::item_fn(*) if it.vis == ast::public => {
960959
self.check_attrs(it.attrs, it.id, it.span,

branches/try2/src/librustc/middle/reachable.rs

Lines changed: 68 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ fn item_might_be_inlined(item: @ast::item) -> bool {
5050
}
5151

5252
match item.node {
53+
ast::item_impl(ref generics, _, _, _) |
5354
ast::item_fn(_, _, _, ref generics, _) => {
5455
generics_require_inlining(generics)
5556
}
@@ -64,6 +65,25 @@ fn ty_method_might_be_inlined(ty_method: &ast::TypeMethod) -> bool {
6465
generics_require_inlining(&ty_method.generics)
6566
}
6667

68+
fn method_might_be_inlined(tcx: ty::ctxt, method: &ast::method,
69+
impl_src: ast::DefId) -> bool {
70+
if attributes_specify_inlining(method.attrs) ||
71+
generics_require_inlining(&method.generics) {
72+
return true
73+
}
74+
if is_local(impl_src) {
75+
match tcx.items.find(&impl_src.node) {
76+
Some(&ast_map::node_item(item, _)) => item_might_be_inlined(item),
77+
Some(*) | None => {
78+
tcx.sess.span_bug(method.span, "impl did is not an item")
79+
}
80+
}
81+
} else {
82+
tcx.sess.span_bug(method.span, "found a foreign impl as a parent of a \
83+
local method")
84+
}
85+
}
86+
6787
// Returns true if the given trait method must be inlined because it may be
6888
// monomorphized or it was marked with `#[inline]`.
6989
fn trait_method_might_be_inlined(trait_method: &ast::trait_method) -> bool {
@@ -100,50 +120,54 @@ impl Visitor<()> for MarkSymbolVisitor {
100120

101121
fn visit_expr(&mut self, expr:@ast::Expr, _:()) {
102122

103-
match expr.node {
104-
ast::ExprPath(_) => {
105-
let def = match self.tcx.def_map.find(&expr.id) {
106-
Some(&def) => def,
107-
None => {
108-
self.tcx.sess.span_bug(expr.span,
109-
"def ID not in def map?!")
110-
}
111-
};
123+
match expr.node {
124+
ast::ExprPath(_) => {
125+
let def = match self.tcx.def_map.find(&expr.id) {
126+
Some(&def) => def,
127+
None => {
128+
self.tcx.sess.span_bug(expr.span,
129+
"def ID not in def map?!")
130+
}
131+
};
112132

113-
let def_id = def_id_of_def(def);
133+
let def_id = def_id_of_def(def);
134+
if ReachableContext::
135+
def_id_represents_local_inlined_item(self.tcx, def_id) {
136+
self.worklist.push(def_id.node)
137+
}
138+
self.reachable_symbols.insert(def_id.node);
139+
}
140+
ast::ExprMethodCall(*) => {
141+
match self.method_map.find(&expr.id) {
142+
Some(&typeck::method_map_entry {
143+
origin: typeck::method_static(def_id),
144+
_
145+
}) => {
114146
if ReachableContext::
115-
def_id_represents_local_inlined_item(self.tcx,
116-
def_id) {
117-
self.worklist.push(def_id.node)
118-
}
147+
def_id_represents_local_inlined_item(
148+
self.tcx,
149+
def_id) {
150+
self.worklist.push(def_id.node)
151+
}
119152
self.reachable_symbols.insert(def_id.node);
120153
}
121-
ast::ExprMethodCall(*) => {
122-
match self.method_map.find(&expr.id) {
123-
Some(&typeck::method_map_entry {
124-
origin: typeck::method_static(def_id),
125-
_
126-
}) => {
127-
if ReachableContext::
128-
def_id_represents_local_inlined_item(
129-
self.tcx,
130-
def_id) {
131-
self.worklist.push(def_id.node)
132-
}
133-
self.reachable_symbols.insert(def_id.node);
134-
}
135-
Some(_) => {}
136-
None => {
137-
self.tcx.sess.span_bug(expr.span,
138-
"method call expression \
154+
Some(_) => {}
155+
None => {
156+
self.tcx.sess.span_bug(expr.span,
157+
"method call expression \
139158
not in method map?!")
140-
}
141-
}
142159
}
143-
_ => {}
144160
}
161+
}
162+
_ => {}
163+
}
145164

146-
visit::walk_expr(self, expr, ())
165+
visit::walk_expr(self, expr, ())
166+
}
167+
168+
fn visit_item(&mut self, _item: @ast::item, _: ()) {
169+
// Do not recurse into items. These items will be added to the worklist
170+
// and recursed into manually if necessary.
147171
}
148172
}
149173

@@ -263,8 +287,11 @@ impl ReachableContext {
263287
Some(&ast_map::node_item(item, _)) => {
264288
match item.node {
265289
ast::item_fn(_, _, _, _, ref search_block) => {
266-
visit::walk_block(&mut visitor, search_block, ())
290+
if item_might_be_inlined(item) {
291+
visit::walk_block(&mut visitor, search_block, ())
292+
}
267293
}
294+
268295
// Our recursion into modules involves looking up their
269296
// public reexports and the destinations of those
270297
// exports. Privacy will put them in the worklist, but
@@ -331,8 +358,10 @@ impl ReachableContext {
331358
}
332359
}
333360
}
334-
Some(&ast_map::node_method(ref method, _, _)) => {
335-
visit::walk_block(&mut visitor, &method.body, ())
361+
Some(&ast_map::node_method(method, did, _)) => {
362+
if method_might_be_inlined(self.tcx, method, did) {
363+
visit::walk_block(&mut visitor, &method.body, ())
364+
}
336365
}
337366
// Nothing to recurse on for these
338367
Some(&ast_map::node_foreign_item(*)) |
@@ -378,17 +407,6 @@ pub fn find_reachable(tcx: ty::ctxt,
378407
exp_map2: resolve::ExportMap2,
379408
exported_items: &privacy::ExportedItems)
380409
-> @mut HashSet<ast::NodeId> {
381-
// XXX(pcwalton): We only need to mark symbols that are exported. But this
382-
// is more complicated than just looking at whether the symbol is `pub`,
383-
// because it might be the target of a `pub use` somewhere. For now, I
384-
// think we are fine, because you can't `pub use` something that wasn't
385-
// exported due to the bug whereby `use` only looks through public
386-
// modules even if you're inside the module the `use` appears in. When
387-
// this bug is fixed, however, this code will need to be updated. Probably
388-
// the easiest way to fix this (although a conservative overapproximation)
389-
// is to have the name resolution pass mark all targets of a `pub use` as
390-
// "must be reachable".
391-
392410
let reachable_context = ReachableContext::new(tcx, method_map, exp_map2);
393411

394412
// Step 1: Seed the worklist with all nodes which were found to be public as

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2471,7 +2471,7 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
24712471
match val {
24722472
Some(v) => v,
24732473
None => {
2474-
let mut exprt = false;
2474+
let mut foreign = false;
24752475
let item = ccx.tcx.items.get_copy(&id);
24762476
let val = match item {
24772477
ast_map::node_item(i, pth) => {
@@ -2584,7 +2584,6 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
25842584
get_item_val()");
25852585
}
25862586
ast::provided(m) => {
2587-
exprt = true;
25882587
register_method(ccx, id, pth, m)
25892588
}
25902589
}
@@ -2596,7 +2595,7 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
25962595

25972596
ast_map::node_foreign_item(ni, abis, _, pth) => {
25982597
let ty = ty::node_id_to_type(ccx.tcx, ni.id);
2599-
exprt = true;
2598+
foreign = true;
26002599

26012600
match ni.node {
26022601
ast::foreign_item_fn(*) => {
@@ -2690,7 +2689,10 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
26902689
}
26912690
};
26922691

2693-
if !exprt && !ccx.reachable.contains(&id) {
2692+
// foreign items (extern fns and extern statics) don't have internal
2693+
// linkage b/c that doesn't quite make sense. Otherwise items can
2694+
// have internal linkage if they're not reachable.
2695+
if !foreign && !ccx.reachable.contains(&id) {
26942696
lib::llvm::SetLinkage(val, lib::llvm::InternalLinkage);
26952697
}
26962698

branches/try2/src/librustc/middle/trans/debuginfo.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,8 @@ fn basic_type_metadata(cx: &mut CrateContext, t: ty::t) -> DIType {
10151015
debug!("basic_type_metadata: {:?}", ty::get(t));
10161016

10171017
let (name, encoding) = match ty::get(t).sty {
1018-
ty::ty_nil | ty::ty_bot => (~"uint", DW_ATE_unsigned),
1018+
ty::ty_nil => (~"()", DW_ATE_unsigned),
1019+
ty::ty_bot => (~"!", DW_ATE_unsigned),
10191020
ty::ty_bool => (~"bool", DW_ATE_boolean),
10201021
ty::ty_char => (~"char", DW_ATE_unsigned_char),
10211022
ty::ty_int(int_ty) => match int_ty {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,11 @@ impl DocFolder for Cache {
622622
}
623623
None
624624
}
625+
// Private modules may survive the strip-private pass if
626+
// they contain impls for public types, but those will get
627+
// stripped here
628+
clean::Item { inner: clean::ModuleItem(ref m), _ }
629+
if m.items.len() == 0 => None,
625630
i => Some(i),
626631
}
627632
}

branches/try2/src/libstd/char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ pub fn is_digit_radix(c: char, radix: uint) -> bool {
187187
#[inline]
188188
pub fn to_digit(c: char, radix: uint) -> Option<uint> {
189189
if radix > 36 {
190-
fail!("to_digit: radix {} is to high (maximum 36)", radix);
190+
fail!("to_digit: radix {} is too high (maximum 36)", radix);
191191
}
192192
let val = match c {
193193
'0' .. '9' => c as uint - ('0' as uint),

branches/try2/src/libstd/std.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,6 @@ pub mod os;
181181
pub mod path;
182182
pub mod rand;
183183
pub mod run;
184-
// NOTE: Remove module after next snapshot
185-
#[cfg(stage0)]
186-
pub mod sys;
187184
pub mod cast;
188185
pub mod fmt;
189186
pub mod repr;
@@ -229,9 +226,6 @@ mod std {
229226
pub use os;
230227
pub use rt;
231228
pub use str;
232-
// NOTE: Remove import after next snapshot
233-
#[cfg(stage0)]
234-
pub use sys;
235229
pub use to_bytes;
236230
pub use to_str;
237231
pub use unstable;

0 commit comments

Comments
 (0)