Skip to content

Commit 6b59e8f

Browse files
committed
---
yaml --- r: 145375 b: refs/heads/try2 c: a47cdc0 h: refs/heads/master i: 145373: 250278c 145371: c5d4fc3 145367: 7d1080a 145359: 7f9cd7a 145343: fab5c5c v: v3
1 parent 300533f commit 6b59e8f

File tree

13 files changed

+24
-176
lines changed

13 files changed

+24
-176
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: 97053995046636c0e11d23c4f0523d278a4210c9
8+
refs/heads/try2: a47cdc0f87162083a5ba22262826f90b05a1e096
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/RELEASES.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Version 0.8 (October 2013)
3131
* `ref` bindings in irrefutable patterns work correctly now.
3232
* `char` is now prevented from containing invalid code points.
3333
* Casting to `bool` is no longer allowed.
34-
* `\0` is now accepted as an escape in chars and strings.
3534
* `yield` is a reserved keyword.
3635
* `typeof` is a reserved keyword.
3736
* Crates may be imported by URL with `extern mod foo = "url";`.
@@ -112,9 +111,6 @@ Version 0.8 (October 2013)
112111
the `MutableSet` and `MutableMap` traits. `Container::is_empty`,
113112
`Map::contains_key`, `MutableMap::insert`, and `MutableMap::remove` have
114113
default implementations.
115-
* std: Various `from_str` functions were removed in favor of a generic
116-
`from_str` which is available in the prelude.
117-
* std: `util::unreachable` removed in favor of the `unreachable!` macro.
118114
* extra: `dlist`, the doubly-linked list was modernized.
119115
* extra: Added a `hex` module with `ToHex` and `FromHex` traits.
120116
* extra: Added `glob` module, replacing `std::os::glob`.
@@ -129,9 +125,6 @@ Version 0.8 (October 2013)
129125
* extra: `semver` updated to SemVer 2.0.0.
130126
* extra: `term` handles more terminals correctly.
131127
* extra: `dbg` module removed.
132-
* extra: `par` module removed.
133-
* extra: `future` was cleaned up, with some method renames.
134-
* extra: Most free functions in `getopts` were converted to methods.
135128

136129
* Other
137130
* rustc's debug info generation (`-Z debug-info`) is greatly improved.
@@ -212,7 +205,6 @@ Version 0.7 (July 2013)
212205
* std: Many old internal vector and string iterators,
213206
incl. `any`, `all`. removed.
214207
* std: The `finalize` method of `Drop` renamed to `drop`.
215-
* std: The `drop` method now takes `&mut self` instead of `&self`.
216208
* std: The prelude no longer reexports any modules, only types and traits.
217209
* std: Prelude additions: `print`, `println`, `FromStr`, `ApproxEq`, `Equiv`,
218210
`Iterator`, `IteratorUtil`, many numeric traits, many tuple traits.

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

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,6 +2416,11 @@ pub fn create_entry_wrapper(ccx: @mut CrateContext,
24162416
unsafe {
24172417
llvm::LLVMPositionBuilderAtEnd(bld, llbb);
24182418

2419+
let crate_map = ccx.crate_map;
2420+
let opaque_crate_map = do "crate_map".with_c_str |buf| {
2421+
llvm::LLVMBuildPointerCast(bld, crate_map, Type::i8p().to_ref(), buf)
2422+
};
2423+
24192424
let (start_fn, args) = if use_start_lang_item {
24202425
let start_def_id = match ccx.tcx.lang_items.require(StartFnLangItem) {
24212426
Ok(id) => id,
@@ -2438,7 +2443,8 @@ pub fn create_entry_wrapper(ccx: @mut CrateContext,
24382443
C_null(Type::opaque_box(ccx).ptr_to()),
24392444
opaque_rust_main,
24402445
llvm::LLVMGetParam(llfn, 0),
2441-
llvm::LLVMGetParam(llfn, 1)
2446+
llvm::LLVMGetParam(llfn, 1),
2447+
opaque_crate_map
24422448
]
24432449
};
24442450
(start_fn, args)
@@ -2447,7 +2453,8 @@ pub fn create_entry_wrapper(ccx: @mut CrateContext,
24472453
let args = ~[
24482454
C_null(Type::opaque_box(ccx).ptr_to()),
24492455
llvm::LLVMGetParam(llfn, 0 as c_uint),
2450-
llvm::LLVMGetParam(llfn, 1 as c_uint)
2456+
llvm::LLVMGetParam(llfn, 1 as c_uint),
2457+
opaque_crate_map
24512458
];
24522459

24532460
(rust_main, args)
@@ -2628,16 +2635,13 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
26282635
}
26292636
ast::foreign_item_static(*) => {
26302637
let ident = foreign::link_name(ccx, ni);
2631-
unsafe {
2632-
let g = do ident.with_c_str |buf| {
2638+
let g = do ident.with_c_str |buf| {
2639+
unsafe {
26332640
let ty = type_of(ccx, ty);
26342641
llvm::LLVMAddGlobal(ccx.llmod, ty.to_ref(), buf)
2635-
};
2636-
if attr::contains_name(ni.attrs, "weak_linkage") {
2637-
lib::llvm::SetLinkage(g, lib::llvm::ExternalWeakLinkage);
26382642
}
2639-
g
2640-
}
2643+
};
2644+
g
26412645
}
26422646
}
26432647
}
@@ -2955,14 +2959,7 @@ pub fn decl_crate_map(sess: session::Session, mapmeta: LinkMeta,
29552959
llvm::LLVMAddGlobal(llmod, maptype.to_ref(), buf)
29562960
}
29572961
};
2958-
// On windows we'd like to export the toplevel cratemap
2959-
// such that we can find it from libstd.
2960-
if targ_cfg.os == session::OsWin32 && "toplevel" == mapname {
2961-
lib::llvm::SetLinkage(map, lib::llvm::DLLExportLinkage);
2962-
} else {
2963-
lib::llvm::SetLinkage(map, lib::llvm::ExternalLinkage);
2964-
}
2965-
2962+
lib::llvm::SetLinkage(map, lib::llvm::ExternalLinkage);
29662963
return map;
29672964
}
29682965

@@ -3117,26 +3114,6 @@ pub fn trans_crate(sess: session::Session,
31173114

31183115
decl_gc_metadata(ccx, llmod_id);
31193116
fill_crate_map(ccx, ccx.crate_map);
3120-
3121-
// NOTE win32: wart with exporting crate_map symbol
3122-
// We set the crate map (_rust_crate_map_toplevel) to use dll_export
3123-
// linkage but that ends up causing the linker to look for a
3124-
// __rust_crate_map_toplevel symbol (extra underscore) which it will
3125-
// subsequently fail to find. So to mitigate that we just introduce
3126-
// an alias from the symbol it expects to the one that actually exists.
3127-
if ccx.sess.targ_cfg.os == session::OsWin32 &&
3128-
!*ccx.sess.building_library {
3129-
3130-
let maptype = val_ty(ccx.crate_map).to_ref();
3131-
3132-
do "__rust_crate_map_toplevel".with_c_str |buf| {
3133-
unsafe {
3134-
llvm::LLVMAddAlias(ccx.llmod, maptype,
3135-
ccx.crate_map, buf);
3136-
}
3137-
}
3138-
}
3139-
31403117
glue::emit_tydescs(ccx);
31413118
write_abi_version(ccx);
31423119
if ccx.sess.opts.debuginfo {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,8 @@ fn check_start_fn_ty(ccx: &CrateCtxt,
402402
bound_lifetime_names: opt_vec::Empty,
403403
inputs: ~[
404404
ty::mk_int(),
405-
ty::mk_imm_ptr(tcx, ty::mk_imm_ptr(tcx, ty::mk_u8()))
405+
ty::mk_imm_ptr(tcx, ty::mk_imm_ptr(tcx, ty::mk_u8())),
406+
ty::mk_imm_ptr(tcx, ty::mk_u8())
406407
],
407408
output: ty::mk_int()
408409
}

branches/try2/src/librustpkg/tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,7 @@ fn no_rebuilding_dep() {
985985
}
986986
987987
#[test]
988+
#[ignore]
988989
fn do_rebuild_dep_dates_change() {
989990
let p_id = PkgId::new("foo");
990991
let dep_id = PkgId::new("bar");
@@ -1001,6 +1002,7 @@ fn do_rebuild_dep_dates_change() {
10011002
}
10021003
10031004
#[test]
1005+
#[ignore]
10041006
fn do_rebuild_dep_only_contents_change() {
10051007
let p_id = PkgId::new("foo");
10061008
let dep_id = PkgId::new("bar");

branches/try2/src/libstd/rt/crate_map.rs

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,7 @@ use vec;
1616
use hashmap::HashSet;
1717
use container::MutableSet;
1818

19-
// Need to tell the linker on OS X to not barf on undefined symbols
20-
// and instead look them up at runtime, which we need to resolve
21-
// the crate_map properly.
22-
#[cfg(target_os = "macos")]
23-
#[link_args = "-undefined dynamic_lookup"]
24-
extern {}
25-
26-
#[cfg(not(stage0), not(windows))]
27-
extern {
28-
#[weak_linkage]
29-
#[link_name = "_rust_crate_map_toplevel"]
30-
static CRATE_MAP: CrateMap;
31-
}
32-
33-
pub struct ModEntry {
19+
pub struct ModEntry{
3420
name: *c_char,
3521
log_level: *mut u32
3622
}
@@ -48,30 +34,6 @@ struct CrateMap {
4834
children: [*CrateMap, ..1]
4935
}
5036

51-
#[cfg(not(stage0), not(windows))]
52-
pub fn get_crate_map() -> *CrateMap {
53-
&'static CRATE_MAP as *CrateMap
54-
}
55-
56-
#[cfg(not(stage0), windows)]
57-
#[fixed_stack_segment]
58-
#[inline(never)]
59-
pub fn get_crate_map() -> *CrateMap {
60-
use c_str::ToCStr;
61-
use unstable::dynamic_lib::dl;
62-
63-
let sym = unsafe {
64-
let module = dl::open_internal();
65-
let sym = do "__rust_crate_map_toplevel".with_c_str |buf| {
66-
dl::symbol(module, buf)
67-
};
68-
dl::close(module);
69-
sym
70-
};
71-
72-
sym as *CrateMap
73-
}
74-
7537
unsafe fn version(crate_map: *CrateMap) -> i32 {
7638
match (*crate_map).version {
7739
1 => return 1,

branches/try2/src/libstd/rt/logging.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use libc::{uintptr_t, exit, STDERR_FILENO};
1212
use option::{Some, None, Option};
1313
use rt::util::dumb_println;
1414
use rt::crate_map::{ModEntry, iter_crate_map};
15-
#[cfg(not(stage0))] use rt::crate_map::get_crate_map;
1615
use str::StrSlice;
1716
use str::raw::from_c_str;
1817
use u32;
@@ -212,7 +211,6 @@ impl Logger for StdErrLogger {
212211
/// Configure logging by traversing the crate map and setting the
213212
/// per-module global logging flags based on the logging spec
214213
#[fixed_stack_segment] #[inline(never)]
215-
#[cfg(stage0)]
216214
pub fn init(crate_map: *u8) {
217215
use os;
218216

@@ -226,22 +224,6 @@ pub fn init(crate_map: *u8) {
226224
}
227225
}
228226
}
229-
#[cfg(not(stage0))]
230-
pub fn init() {
231-
use os;
232-
233-
let crate_map = get_crate_map() as *u8;
234-
235-
let log_spec = os::getenv("RUST_LOG");
236-
match log_spec {
237-
Some(spec) => {
238-
update_log_settings(crate_map, spec);
239-
}
240-
None => {
241-
update_log_settings(crate_map, ~"");
242-
}
243-
}
244-
}
245227

246228
#[fixed_stack_segment] #[inline(never)]
247229
pub fn console_on() { unsafe { rust_log_console_on() } }

branches/try2/src/libstd/rt/mod.rs

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,11 @@ pub mod borrowck;
172172
///
173173
/// * `argc` & `argv` - The argument vector. On Unix this information is used
174174
/// by os::args.
175+
/// * `crate_map` - Runtime information about the executing crate, mostly for logging
175176
///
176177
/// # Return value
177178
///
178179
/// The return value is used as the process return code. 0 on success, 101 on error.
179-
#[cfg(stage0)]
180180
pub fn start(argc: int, argv: **u8, crate_map: *u8, main: ~fn()) -> int {
181181

182182
init(argc, argv, crate_map);
@@ -185,44 +185,25 @@ pub fn start(argc: int, argv: **u8, crate_map: *u8, main: ~fn()) -> int {
185185

186186
return exit_code;
187187
}
188-
#[cfg(not(stage0))]
189-
pub fn start(argc: int, argv: **u8, main: ~fn()) -> int {
190-
191-
init(argc, argv);
192-
let exit_code = run(main);
193-
cleanup();
194-
195-
return exit_code;
196-
}
197188

198189
/// Like `start` but creates an additional scheduler on the current thread,
199190
/// which in most cases will be the 'main' thread, and pins the main task to it.
200191
///
201192
/// This is appropriate for running code that must execute on the main thread,
202193
/// such as the platform event loop and GUI.
203-
#[cfg(stage0)]
204194
pub fn start_on_main_thread(argc: int, argv: **u8, crate_map: *u8, main: ~fn()) -> int {
205195
init(argc, argv, crate_map);
206196
let exit_code = run_on_main_thread(main);
207197
cleanup();
208198

209199
return exit_code;
210200
}
211-
#[cfg(not(stage0))]
212-
pub fn start_on_main_thread(argc: int, argv: **u8, main: ~fn()) -> int {
213-
init(argc, argv);
214-
let exit_code = run_on_main_thread(main);
215-
cleanup();
216-
217-
return exit_code;
218-
}
219201

220202
/// One-time runtime initialization.
221203
///
222204
/// Initializes global state, including frobbing
223205
/// the crate's logging flags, registering GC
224206
/// metadata, and storing the process arguments.
225-
#[cfg(stage0)]
226207
pub fn init(argc: int, argv: **u8, crate_map: *u8) {
227208
// XXX: Derefing these pointers is not safe.
228209
// Need to propagate the unsafety to `start`.
@@ -232,16 +213,6 @@ pub fn init(argc: int, argv: **u8, crate_map: *u8) {
232213
logging::init(crate_map);
233214
}
234215
}
235-
#[cfg(not(stage0))]
236-
pub fn init(argc: int, argv: **u8) {
237-
// XXX: Derefing these pointers is not safe.
238-
// Need to propagate the unsafety to `start`.
239-
unsafe {
240-
args::init(argc, argv);
241-
env::init();
242-
logging::init();
243-
}
244-
}
245216

246217
/// One-time runtime cleanup.
247218
pub fn cleanup() {

branches/try2/src/libstd/unstable/dynamic_lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ mod test {
138138
#[cfg(target_os = "android")]
139139
#[cfg(target_os = "macos")]
140140
#[cfg(target_os = "freebsd")]
141-
pub mod dl {
141+
mod dl {
142142
use c_str::ToCStr;
143143
use libc;
144144
use path;
@@ -207,7 +207,7 @@ pub mod dl {
207207
}
208208

209209
#[cfg(target_os = "win32")]
210-
pub mod dl {
210+
mod dl {
211211
use os;
212212
use libc;
213213
use path;

branches/try2/src/libstd/unstable/lang.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ pub unsafe fn check_not_borrowed(a: *u8,
9393
borrowck::check_not_borrowed(a, file, line)
9494
}
9595

96-
#[cfg(stage0)]
9796
#[lang="start"]
9897
pub fn start(main: *u8, argc: int, argv: **c_char,
9998
crate_map: *u8) -> int {
@@ -106,16 +105,3 @@ pub fn start(main: *u8, argc: int, argv: **c_char,
106105
};
107106
}
108107
}
109-
110-
#[cfg(not(stage0))]
111-
#[lang="start"]
112-
pub fn start(main: *u8, argc: int, argv: **c_char) -> int {
113-
use rt;
114-
115-
unsafe {
116-
return do rt::start(argc, argv as **u8) {
117-
let main: extern "Rust" fn() = transmute(main);
118-
main();
119-
};
120-
}
121-
}

branches/try2/src/test/run-pass/attr-start.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
//xfail-fast
1212

1313
#[start]
14-
#[cfg(stage0)]
1514
fn start(_argc: int, _argv: **u8, _crate_map: *u8) -> int {
1615
return 0;
1716
}
18-
#[start]
19-
#[cfg(not(stage0))]
20-
fn start(_argc: int, _argv: **u8) -> int {
21-
return 0;
22-
}

0 commit comments

Comments
 (0)