Skip to content

Commit 3105bcf

Browse files
committed
librustc: De-export driver. rs=deexport
1 parent b070590 commit 3105bcf

File tree

6 files changed

+221
-242
lines changed

6 files changed

+221
-242
lines changed

src/librustc/back/link.rs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ pub fn WriteOutputFile(sess: Session,
9494
}
9595

9696
pub mod jit {
97-
#[legacy_exports];
98-
9997
use back::link::llvm_err;
10098
use lib::llvm::llvm;
10199
use lib::llvm::{ModuleRef, PassManagerRef, mk_target_data};
@@ -109,21 +107,20 @@ pub mod jit {
109107

110108
#[nolink]
111109
#[abi = "rust-intrinsic"]
112-
extern mod rusti {
113-
#[legacy_exports];
114-
fn morestack_addr() -> *();
110+
pub extern mod rusti {
111+
pub fn morestack_addr() -> *();
115112
}
116113

117-
struct Closure {
114+
pub struct Closure {
118115
code: *(),
119116
env: *(),
120117
}
121118

122-
fn exec(sess: Session,
123-
pm: PassManagerRef,
124-
m: ModuleRef,
125-
opt: c_int,
126-
stacks: bool) {
119+
pub fn exec(sess: Session,
120+
pm: PassManagerRef,
121+
m: ModuleRef,
122+
opt: c_int,
123+
stacks: bool) {
127124
unsafe {
128125
let manager = llvm::LLVMRustPrepareJIT(rusti::morestack_addr());
129126

@@ -174,8 +171,6 @@ pub mod jit {
174171
}
175172

176173
mod write {
177-
#[legacy_exports];
178-
179174
use back::link::jit;
180175
use back::link::{ModuleRef, WriteOutputFile, output_type};
181176
use back::link::{output_type_assembly, output_type_bitcode};
@@ -193,15 +188,15 @@ mod write {
193188
use core::str;
194189
use core::vec;
195190

196-
fn is_object_or_assembly_or_exe(ot: output_type) -> bool {
191+
pub fn is_object_or_assembly_or_exe(ot: output_type) -> bool {
197192
if ot == output_type_assembly || ot == output_type_object ||
198193
ot == output_type_exe {
199194
return true;
200195
}
201196
return false;
202197
}
203198

204-
fn run_passes(sess: Session, llmod: ModuleRef, output: &Path) {
199+
pub fn run_passes(sess: Session, llmod: ModuleRef, output: &Path) {
205200
unsafe {
206201
let opts = sess.opts;
207202
if sess.time_llvm_passes() { llvm::LLVMRustEnableTimePasses(); }

src/librustc/back/rpath.rs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,6 @@ fn minimize_rpaths(rpaths: &[Path]) -> ~[Path] {
208208

209209
#[cfg(unix)]
210210
mod test {
211-
#[legacy_exports];
212-
213211
use core::prelude::*;
214212

215213
use back::rpath::{get_absolute_rpath, get_install_prefix_rpath};
@@ -221,14 +219,14 @@ mod test {
221219
use core::str;
222220

223221
#[test]
224-
fn test_rpaths_to_flags() {
222+
pub fn test_rpaths_to_flags() {
225223
let flags = rpaths_to_flags(~[Path("path1"),
226224
Path("path2")]);
227225
assert flags == ~[~"-Wl,-rpath,path1", ~"-Wl,-rpath,path2"];
228226
}
229227

230228
#[test]
231-
fn test_prefix_rpath() {
229+
pub fn test_prefix_rpath() {
232230
let res = get_install_prefix_rpath("triple");
233231
let d = Path(env!("CFG_PREFIX"))
234232
.push_rel(&Path("lib/rustc/triple/lib"));
@@ -239,21 +237,21 @@ mod test {
239237
}
240238

241239
#[test]
242-
fn test_prefix_rpath_abs() {
240+
pub fn test_prefix_rpath_abs() {
243241
let res = get_install_prefix_rpath("triple");
244242
assert res.is_absolute;
245243
}
246244

247245
#[test]
248-
fn test_minimize1() {
246+
pub fn test_minimize1() {
249247
let res = minimize_rpaths([Path("rpath1"),
250248
Path("rpath2"),
251249
Path("rpath1")]);
252250
assert res == ~[Path("rpath1"), Path("rpath2")];
253251
}
254252

255253
#[test]
256-
fn test_minimize2() {
254+
pub fn test_minimize2() {
257255
let res = minimize_rpaths(~[Path("1a"), Path("2"), Path("2"),
258256
Path("1a"), Path("4a"),Path("1a"),
259257
Path("2"), Path("3"), Path("4a"),
@@ -262,63 +260,63 @@ mod test {
262260
}
263261

264262
#[test]
265-
fn test_relative_to1() {
263+
pub fn test_relative_to1() {
266264
let p1 = Path("/usr/bin/rustc");
267265
let p2 = Path("/usr/lib/mylib");
268266
let res = get_relative_to(&p1, &p2);
269267
assert res == Path("../lib");
270268
}
271269

272270
#[test]
273-
fn test_relative_to2() {
271+
pub fn test_relative_to2() {
274272
let p1 = Path("/usr/bin/rustc");
275273
let p2 = Path("/usr/bin/../lib/mylib");
276274
let res = get_relative_to(&p1, &p2);
277275
assert res == Path("../lib");
278276
}
279277

280278
#[test]
281-
fn test_relative_to3() {
279+
pub fn test_relative_to3() {
282280
let p1 = Path("/usr/bin/whatever/rustc");
283281
let p2 = Path("/usr/lib/whatever/mylib");
284282
let res = get_relative_to(&p1, &p2);
285283
assert res == Path("../../lib/whatever");
286284
}
287285

288286
#[test]
289-
fn test_relative_to4() {
287+
pub fn test_relative_to4() {
290288
let p1 = Path("/usr/bin/whatever/../rustc");
291289
let p2 = Path("/usr/lib/whatever/mylib");
292290
let res = get_relative_to(&p1, &p2);
293291
assert res == Path("../lib/whatever");
294292
}
295293

296294
#[test]
297-
fn test_relative_to5() {
295+
pub fn test_relative_to5() {
298296
let p1 = Path("/usr/bin/whatever/../rustc");
299297
let p2 = Path("/usr/lib/whatever/../mylib");
300298
let res = get_relative_to(&p1, &p2);
301299
assert res == Path("../lib");
302300
}
303301

304302
#[test]
305-
fn test_relative_to6() {
303+
pub fn test_relative_to6() {
306304
let p1 = Path("/1");
307305
let p2 = Path("/2/3");
308306
let res = get_relative_to(&p1, &p2);
309307
assert res == Path("2");
310308
}
311309

312310
#[test]
313-
fn test_relative_to7() {
311+
pub fn test_relative_to7() {
314312
let p1 = Path("/1/2");
315313
let p2 = Path("/3");
316314
let res = get_relative_to(&p1, &p2);
317315
assert res == Path("..");
318316
}
319317

320318
#[test]
321-
fn test_relative_to8() {
319+
pub fn test_relative_to8() {
322320
let p1 = Path("/home/brian/Dev/rust/build/").push_rel(
323321
&Path("stage2/lib/rustc/i686-unknown-linux-gnu/lib/librustc.so"));
324322
let p2 = Path("/home/brian/Dev/rust/build/stage2/bin/..").push_rel(
@@ -333,7 +331,7 @@ mod test {
333331
#[test]
334332
#[cfg(target_os = "linux")]
335333
#[cfg(target_os = "andorid")]
336-
fn test_rpath_relative() {
334+
pub fn test_rpath_relative() {
337335
let o = session::os_linux;
338336
let res = get_rpath_relative_to_output(o,
339337
&Path("bin/rustc"), &Path("lib/libstd.so"));
@@ -342,7 +340,7 @@ mod test {
342340

343341
#[test]
344342
#[cfg(target_os = "freebsd")]
345-
fn test_rpath_relative() {
343+
pub fn test_rpath_relative() {
346344
let o = session::os_freebsd;
347345
let res = get_rpath_relative_to_output(o,
348346
&Path("bin/rustc"), &Path("lib/libstd.so"));
@@ -351,7 +349,7 @@ mod test {
351349

352350
#[test]
353351
#[cfg(target_os = "macos")]
354-
fn test_rpath_relative() {
352+
pub fn test_rpath_relative() {
355353
// this is why refinements would be nice
356354
let o = session::os_macos;
357355
let res = get_rpath_relative_to_output(o,
@@ -361,7 +359,7 @@ mod test {
361359
}
362360

363361
#[test]
364-
fn test_get_absolute_rpath() {
362+
pub fn test_get_absolute_rpath() {
365363
let res = get_absolute_rpath(&Path("lib/libstd.so"));
366364
debug!("test_get_absolute_rpath: %s vs. %s",
367365
res.to_str(),

0 commit comments

Comments
 (0)