Skip to content

Commit 9d2a303

Browse files
committed
---
yaml --- r: 131774 b: refs/heads/dist-snap c: f26c31d h: refs/heads/master v: v3
1 parent 50cdf37 commit 9d2a303

Some content is hidden

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

48 files changed

+405
-983
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 457a3c991d79b971be07fce75f9d0c12848fb37c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: cdd6346f458084ef9f9e6e1b640225be4a8aca70
9+
refs/heads/dist-snap: f26c31d695666a6863f86bfeede2bea91f4ba942
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/man/rustc.1

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ This program is a compiler for the Rust language, available at
1111

1212
.SH OPTIONS
1313

14-
.TP
15-
\fB\-\-crate-name NAME\fR
16-
Specify the name of the crate being built
1714
.TP
1815
\fB\-\-crate-type=[bin|lib|dylib|rlib|staticlib]\fR
1916
Configure the flavor of rust crate that is generated (default `bin`)

branches/dist-snap/mk/install.mk

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@ else
1414
MAYBE_DISABLE_VERIFY=
1515
endif
1616

17-
install: dist-install-dir-$(CFG_BUILD)-with-target-libs | tmp/empty_dir
18-
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)"
17+
install: dist-install-dir-$(CFG_BUILD)-with-target-libs
18+
$(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)"
1919
# Remove tmp files while we can because they may have been created under sudo
2020
$(Q)rm -R tmp/dist
2121

22-
uninstall: dist-install-dir-$(CFG_BUILD)-with-target-libs | tmp/empty_dir
23-
$(Q)cd tmp/empty_dir && sh ../../tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
22+
uninstall: dist-install-dir-$(CFG_BUILD)-with-target-libs
23+
$(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
2424
# Remove tmp files while we can because they may have been created under sudo
2525
$(Q)rm -R tmp/dist
2626

27-
tmp/empty_dir:
28-
mkdir -p $@
2927

3028
######################################################################
3129
# Android remote installation

branches/dist-snap/src/etc/install.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -466,17 +466,6 @@ while read p; do
466466
# The manifest lists all files to install
467467
done < "${CFG_SRC_DIR}/${CFG_LIBDIR_RELATIVE}/rustlib/manifest.in"
468468

469-
# Run ldconfig to make dynamic libraries available to the linker
470-
if [ "$CFG_OSTYPE" = "Linux" ]
471-
then
472-
ldconfig
473-
if [ $? -ne 0 ]
474-
then
475-
warn "failed to run ldconfig."
476-
warn "this may happen when not installing as root and may be fine"
477-
fi
478-
fi
479-
480469
# Sanity check: can we run the installed binaries?
481470
#
482471
# As with the verification above, make sure the right LD_LIBRARY_PATH-equivalent
@@ -500,11 +489,13 @@ then
500489
err "${ERR}"
501490
else
502491
echo
503-
echo " Note: please ensure '${CFG_PREFIX}/lib' is added to ${CFG_LD_PATH_VAR}"
492+
echo " please ensure '${CFG_PREFIX}/lib' is added to ${CFG_LD_PATH_VAR}"
493+
echo
504494
fi
505495
fi
506496
fi
507497

498+
508499
echo
509500
echo " Rust is ready to roll."
510501
echo

branches/dist-snap/src/etc/zsh/_rust

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ _rustc_opts_switches=(
99
-c'[Compile and assemble, but do not link]'
1010
--cfg'[Configure the compilation environment]'
1111
--crate-id'[Output the crate id and exit]'
12-
--crate-file-name'[deprecated in favor of --print-file-name]'
13-
--crate-name'[Specify the name of the crate being built]'
14-
--crate-type'[Specify the type of crate to crate]'
15-
--debuginfo'[Emit DWARF debug info to the objects created: 0 = no debug info, 1 = line-tables only (for stacktraces and breakpoints), 2 = full debug info with variable and type information (same as -g)]'
12+
--crate-file-name'[Output the file(s) that would be written if compilation continued and exit]'
13+
--crate-name'[Output the crate name and exit]'
1614
--dep-info'[Output dependency info to <filename> after compiling]'
17-
-g'[Equivalent to --debuginfo=2]'
15+
--crate-type'[Specify the type of crate to crate]'
1816
{-h,--help}'[Display this message]'
1917
-L'[Add a directory to the library search path]'
2018
--linker'[Program to use for linking instead of the default.]'
@@ -31,8 +29,6 @@ _rustc_opts_switches=(
3129
--parse-only'[Parse only; do not compile, assemble, or link]'
3230
--passes'[Comma or space separated list of pass names to use]'
3331
--pretty'[Pretty-print the input instead of compiling]'
34-
--print-crate-name'[Output the crate name and exit]'
35-
--print-file-name'[Output the file(s) that would be written if compilation continued and exit]'
3632
--save-temps'[Write intermediate files (.bc, .opt.bc, .o) in addition to normal output]'
3733
--sysroot'[Override the system root]'
3834
--test'[Build a test harness]'

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl AtomicBool {
141141
///
142142
/// fn with_lock(spinlock: &Arc<AtomicBool>, f: || -> ()) {
143143
/// // CAS loop until we are able to replace `false` with `true`
144-
/// while spinlock.compare_and_swap(false, true, SeqCst) != false {
144+
/// while spinlock.compare_and_swap(false, true, SeqCst) == false {
145145
/// // Since tasks may not be preemptive (if they are green threads)
146146
/// // yield to the scheduler to let the other task run. Low level
147147
/// // concurrent code needs to take into account Rust's two threading

branches/dist-snap/src/libgreen/lib.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,10 @@
164164
//! possibly pinned to a particular scheduler thread:
165165
//!
166166
//! ```rust
167-
//! extern crate green;
168-
//! extern crate rustuv;
169-
//!
170-
//! # fn main() {
171167
//! use std::task::TaskBuilder;
172168
//! use green::{SchedPool, PoolConfig, GreenTaskBuilder};
173169
//!
174-
//! let mut config = PoolConfig::new();
175-
//!
176-
//! // Optional: Set the event loop to be rustuv's to allow I/O to work
177-
//! config.event_loop_factory = rustuv::event_loop;
178-
//!
170+
//! let config = PoolConfig::new();
179171
//! let mut pool = SchedPool::new(config);
180172
//!
181173
//! // Spawn tasks into the pool of schedulers
@@ -203,7 +195,6 @@
203195
//! // Required to shut down this scheduler pool.
204196
//! // The task will fail if `shutdown` is not called.
205197
//! pool.shutdown();
206-
//! # }
207198
//! ```
208199
209200
#![crate_name = "green"]

branches/dist-snap/src/libgreen/stack.rs

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

11-
use std::ptr;
1211
use std::sync::atomics;
1312
use std::os::{errno, page_size, MemoryMap, MapReadable, MapWritable,
14-
MapNonStandardFlags, getenv};
13+
MapNonStandardFlags, MapVirtual, getenv};
1514
use libc;
1615

1716
/// A task's stack. The name "Stack" is a vestige of segmented stacks.
1817
pub struct Stack {
19-
buf: Option<MemoryMap>,
18+
buf: MemoryMap,
2019
min_size: uint,
2120
valgrind_id: libc::c_uint,
2221
}
@@ -53,11 +52,11 @@ impl Stack {
5352
// guaranteed to be aligned properly.
5453
if !protect_last_page(&stack) {
5554
fail!("Could not memory-protect guard page. stack={}, errno={}",
56-
stack.data(), errno());
55+
stack.data, errno());
5756
}
5857

5958
let mut stk = Stack {
60-
buf: Some(stack),
59+
buf: stack,
6160
min_size: size,
6261
valgrind_id: 0
6362
};
@@ -72,23 +71,22 @@ impl Stack {
7271
/// Create a 0-length stack which starts (and ends) at 0.
7372
pub unsafe fn dummy_stack() -> Stack {
7473
Stack {
75-
buf: None,
74+
buf: MemoryMap { data: 0 as *mut u8, len: 0, kind: MapVirtual },
7675
min_size: 0,
7776
valgrind_id: 0
7877
}
7978
}
8079

8180
/// Point to the low end of the allocated stack
8281
pub fn start(&self) -> *const uint {
83-
self.buf.as_ref().map(|m| m.data() as *const uint)
84-
.unwrap_or(ptr::null())
82+
self.buf.data as *const uint
8583
}
8684

8785
/// Point one uint beyond the high end of the allocated stack
8886
pub fn end(&self) -> *const uint {
89-
self.buf.as_ref().map(|buf| unsafe {
90-
buf.data().offset(buf.len() as int) as *const uint
91-
}).unwrap_or(ptr::null())
87+
unsafe {
88+
self.buf.data.offset(self.buf.len as int) as *const uint
89+
}
9290
}
9391
}
9492

@@ -98,7 +96,7 @@ fn protect_last_page(stack: &MemoryMap) -> bool {
9896
// This may seem backwards: the start of the segment is the last page?
9997
// Yes! The stack grows from higher addresses (the end of the allocated
10098
// block) to lower addresses (the start of the allocated block).
101-
let last_page = stack.data() as *mut libc::c_void;
99+
let last_page = stack.data as *mut libc::c_void;
102100
libc::mprotect(last_page, page_size() as libc::size_t,
103101
libc::PROT_NONE) != -1
104102
}
@@ -108,7 +106,7 @@ fn protect_last_page(stack: &MemoryMap) -> bool {
108106
fn protect_last_page(stack: &MemoryMap) -> bool {
109107
unsafe {
110108
// see above
111-
let last_page = stack.data() as *mut libc::c_void;
109+
let last_page = stack.data as *mut libc::c_void;
112110
let mut old_prot: libc::DWORD = 0;
113111
libc::VirtualProtect(last_page, page_size() as libc::SIZE_T,
114112
libc::PAGE_NOACCESS,

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,6 @@ pub fn phase_2_configure_and_expand(sess: &Session,
270270
}
271271
);
272272

273-
// JBC: make CFG processing part of expansion to avoid this problem:
274-
275273
// strip again, in case expansion added anything with a #[cfg].
276274
krate = time(time_passes, "configuration 2", krate, |krate|
277275
front::config::strip_unconfigured_items(krate));
@@ -292,9 +290,6 @@ pub fn phase_2_configure_and_expand(sess: &Session,
292290
krate.encode(&mut json).unwrap();
293291
}
294292

295-
time(time_passes, "checking that all macro invocations are gone", &krate, |krate|
296-
syntax::ext::expand::check_for_macros(&sess.parse_sess, krate));
297-
298293
Some((krate, map))
299294
}
300295

@@ -307,14 +302,14 @@ pub struct CrateAnalysis {
307302
pub name: String,
308303
}
309304

310-
311305
/// Run the resolution, typechecking, region checking and other
312306
/// miscellaneous analysis passes on the crate. Return various
313307
/// structures carrying the results of the analysis.
314308
pub fn phase_3_run_analysis_passes(sess: Session,
315309
krate: &ast::Crate,
316310
ast_map: syntax::ast_map::Map,
317311
name: String) -> CrateAnalysis {
312+
318313
let time_passes = sess.time_passes();
319314

320315
time(time_passes, "external crate/lib resolution", (), |_|

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ use syntax::{ast, codemap};
2929
use std::os;
3030
use std::cell::{Cell, RefCell};
3131

32-
// Represents the data associated with a compilation
33-
// session for a single crate.
32+
3433
pub struct Session {
3534
pub targ_cfg: config::Config,
3635
pub opts: config::Options,

branches/dist-snap/src/librustc/front/config.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ use syntax::codemap;
1414

1515
use std::gc::{Gc, GC};
1616

17-
/// A folder that strips out items that do not belong in the current
18-
/// configuration.
1917
struct Context<'a> {
2018
in_cfg: |attrs: &[ast::Attribute]|: 'a -> bool,
2119
}
@@ -43,9 +41,6 @@ impl<'a> fold::Folder for Context<'a> {
4341
fn fold_expr(&mut self, expr: Gc<ast::Expr>) -> Gc<ast::Expr> {
4442
fold_expr(self, expr)
4543
}
46-
fn fold_mac(&mut self, mac: &ast::Mac) -> ast::Mac {
47-
fold::fold_mac(mac, self)
48-
}
4944
}
5045

5146
pub fn strip_items(krate: ast::Crate,

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ impl<'a> PluginMetadataReader<'a> {
446446
should_match_name: true,
447447
};
448448
let library = match load_ctxt.maybe_load_library_crate() {
449-
Some(l) => l,
449+
Some (l) => l,
450450
None if is_cross => {
451451
// try loading from target crates (only valid if there are
452452
// no syntax extensions)
@@ -473,14 +473,6 @@ impl<'a> PluginMetadataReader<'a> {
473473
let registrar = decoder::get_plugin_registrar_fn(library.metadata.as_slice()).map(|id| {
474474
decoder::get_symbol(library.metadata.as_slice(), id)
475475
});
476-
if library.dylib.is_none() && registrar.is_some() {
477-
let message = format!("plugin crate `{}` only found in rlib format, \
478-
but must be available in dylib format",
479-
info.ident);
480-
self.env.sess.span_err(krate.span, message.as_slice());
481-
// No need to abort because the loading code will just ignore this
482-
// empty dylib.
483-
}
484476
let pc = PluginMetadata {
485477
lib: library.dylib.clone(),
486478
macros: macros,

branches/dist-snap/src/librustc/metadata/encoder.rs

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -693,10 +693,6 @@ fn encode_info_for_struct(ecx: &EncodeContext,
693693
encode_name(ebml_w, nm);
694694
encode_type(ecx, ebml_w, node_id_to_type(tcx, id));
695695
encode_def_id(ebml_w, local_def(id));
696-
697-
let stab = stability::lookup(ecx.tcx, field.id);
698-
encode_stability(ebml_w, stab);
699-
700696
ebml_w.end_tag();
701697
}
702698
index
@@ -1588,25 +1584,37 @@ fn encode_plugin_registrar_fn(ecx: &EncodeContext, ebml_w: &mut Encoder) {
15881584
}
15891585
}
15901586

1591-
/// Given a span, write the text of that span into the output stream
1592-
/// as an exported macro
1593-
fn encode_macro_def(ecx: &EncodeContext,
1594-
ebml_w: &mut Encoder,
1595-
span: &syntax::codemap::Span) {
1596-
let def = ecx.tcx.sess.codemap().span_to_snippet(*span)
1597-
.expect("Unable to find source for macro");
1598-
ebml_w.start_tag(tag_macro_def);
1599-
ebml_w.wr_str(def.as_slice());
1600-
ebml_w.end_tag();
1587+
struct MacroDefVisitor<'a, 'b, 'c> {
1588+
ecx: &'a EncodeContext<'b>,
1589+
ebml_w: &'a mut Encoder<'c>
1590+
}
1591+
1592+
impl<'a, 'b, 'c> Visitor<()> for MacroDefVisitor<'a, 'b, 'c> {
1593+
fn visit_item(&mut self, item: &Item, _: ()) {
1594+
match item.node {
1595+
ItemMac(..) => {
1596+
let def = self.ecx.tcx.sess.codemap().span_to_snippet(item.span)
1597+
.expect("Unable to find source for macro");
1598+
self.ebml_w.start_tag(tag_macro_def);
1599+
self.ebml_w.wr_str(def.as_slice());
1600+
self.ebml_w.end_tag();
1601+
}
1602+
_ => {}
1603+
}
1604+
visit::walk_item(self, item, ());
1605+
}
16011606
}
16021607

1603-
/// Serialize the text of the exported macros
1604-
fn encode_macro_defs(ecx: &EncodeContext,
1605-
krate: &Crate,
1606-
ebml_w: &mut Encoder) {
1608+
fn encode_macro_defs<'a>(ecx: &'a EncodeContext,
1609+
krate: &Crate,
1610+
ebml_w: &'a mut Encoder) {
16071611
ebml_w.start_tag(tag_exported_macros);
1608-
for span in krate.exported_macros.iter() {
1609-
encode_macro_def(ecx, ebml_w, span);
1612+
{
1613+
let mut visitor = MacroDefVisitor {
1614+
ecx: ecx,
1615+
ebml_w: ebml_w,
1616+
};
1617+
visit::walk_crate(&mut visitor, krate, ());
16101618
}
16111619
ebml_w.end_tag();
16121620
}

0 commit comments

Comments
 (0)