Skip to content

Commit 88e062c

Browse files
committed
---
yaml --- r: 146074 b: refs/heads/try2 c: 1dc3d0b h: refs/heads/master v: v3
1 parent 3213683 commit 88e062c

File tree

26 files changed

+172
-472
lines changed

26 files changed

+172
-472
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: ece5028a8be4183ccb203dac59e734f1ca753714
8+
refs/heads/try2: 1dc3d0bf86c7e3db3e9b1cb9cfb1f344f9420f0f
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libextra/glob.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,32 @@ pub struct GlobIterator {
3939
priv todo: ~[(Path,uint)]
4040
}
4141

42-
/**
43-
* Return an iterator that produces all the Paths that match the given pattern,
44-
* which may be absolute or relative to the current working directory.
45-
*
46-
* This method uses the default match options and is equivalent to calling
47-
* `glob_with(pattern, MatchOptions::new())`. Use `glob_with` directly if you
48-
* want to use non-default match options.
49-
*
50-
* # Example
51-
*
52-
* Consider a directory `/media/pictures` containing only the files `kittens.jpg`,
53-
* `puppies.jpg` and `hamsters.gif`:
54-
*
55-
* ```rust
56-
* for path in glob("/media/pictures/*.jpg") {
57-
* println(path.to_str());
58-
* }
59-
* ```
60-
*
61-
* The above code will print:
62-
*
63-
* ```
64-
* /media/pictures/kittens.jpg
65-
* /media/pictures/puppies.jpg
66-
* ```
67-
*/
42+
///
43+
/// Return an iterator that produces all the Paths that match the given pattern,
44+
/// which may be absolute or relative to the current working directory.
45+
///
46+
/// is method uses the default match options and is equivalent to calling
47+
/// `glob_with(pattern, MatchOptions::new())`. Use `glob_with` directly if you
48+
/// want to use non-default match options.
49+
///
50+
/// # Example
51+
///
52+
/// Consider a directory `/media/pictures` containing only the files `kittens.jpg`,
53+
/// `puppies.jpg` and `hamsters.gif`:
54+
///
55+
/// ```rust
56+
/// for path in glob("/media/pictures/*.jpg") {
57+
/// println(path.to_str());
58+
/// }
59+
/// ```
60+
///
61+
/// The above code will print:
62+
///
63+
/// ```
64+
/// /media/pictures/kittens.jpg
65+
/// /media/pictures/puppies.jpg
66+
/// ```
67+
///
6868
pub fn glob(pattern: &str) -> GlobIterator {
6969
glob_with(pattern, MatchOptions::new())
7070
}

branches/try2/src/librustc/back/link.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ pub mod write {
297297
if !sess.no_prepopulate_passes() {
298298
llvm::LLVMRustAddAnalysisPasses(tm, fpm, llmod);
299299
llvm::LLVMRustAddAnalysisPasses(tm, mpm, llmod);
300-
populate_llvm_passes(fpm, mpm, llmod, OptLevel);
300+
populate_llvm_passess(fpm, mpm, llmod, OptLevel);
301301
}
302302

303303
for pass in sess.opts.custom_passes.iter() {
@@ -422,10 +422,10 @@ pub mod write {
422422
}
423423
}
424424

425-
unsafe fn populate_llvm_passes(fpm: lib::llvm::PassManagerRef,
426-
mpm: lib::llvm::PassManagerRef,
427-
llmod: ModuleRef,
428-
opt: lib::llvm::CodeGenOptLevel) {
425+
unsafe fn populate_llvm_passess(fpm: lib::llvm::PassManagerRef,
426+
mpm: lib::llvm::PassManagerRef,
427+
llmod: ModuleRef,
428+
opt: lib::llvm::CodeGenOptLevel) {
429429
// Create the PassManagerBuilder for LLVM. We configure it with
430430
// reasonable defaults and prepare it to actually populate the pass
431431
// manager.

branches/try2/src/librustc/front/feature_gate.rs

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
3434
("macro_rules", Active),
3535
("struct_variant", Active),
3636
("once_fns", Active),
37-
("asm", Active),
3837

3938
// These are used to test this portion of the compiler, they don't actually
4039
// mean anything
@@ -109,29 +108,26 @@ impl Visitor<()> for Context {
109108
}
110109
}
111110

111+
ast::item_mac(ref mac) => {
112+
match mac.node {
113+
ast::mac_invoc_tt(ref path, _, _) => {
114+
let rules = self.sess.ident_of("macro_rules");
115+
if path.segments.last().identifier == rules {
116+
self.gate_feature("macro_rules", i.span,
117+
"macro definitions are not \
118+
stable enough for use and are \
119+
subject to change");
120+
}
121+
}
122+
}
123+
}
124+
112125
_ => {}
113126
}
114127

115128
visit::walk_item(self, i, ());
116129
}
117130

118-
fn visit_mac(&mut self, macro: &ast::mac, _: ()) {
119-
let ast::mac_invoc_tt(ref path, _, _) = macro.node;
120-
121-
if path.segments.last().identifier == self.sess.ident_of("macro_rules") {
122-
self.gate_feature("macro_rules", path.span, "macro definitions are \
123-
not stable enough for use and are subject to change");
124-
}
125-
126-
else if path.segments.last().identifier == self.sess.ident_of("asm") {
127-
// NOTE: remove the false once the ASM feature is in the next snapshot
128-
if false {
129-
self.gate_feature("asm", path.span, "inline assembly is not \
130-
stable enough for use and is subject to change");
131-
}
132-
}
133-
}
134-
135131
fn visit_ty(&mut self, t: &ast::Ty, _: ()) {
136132
match t.node {
137133
ast::ty_closure(closure) if closure.onceness == ast::Once => {

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,23 +2797,13 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
27972797

27982798
ifn!(intrinsics, "llvm.fabs.f32", [Type::f32()], Type::f32());
27992799
ifn!(intrinsics, "llvm.fabs.f64", [Type::f64()], Type::f64());
2800-
ifn!(intrinsics, "llvm.copysign.f32", [Type::f32(), Type::f32()], Type::f32());
2801-
ifn!(intrinsics, "llvm.copysign.f64", [Type::f64(), Type::f64()], Type::f64());
2802-
28032800
ifn!(intrinsics, "llvm.floor.f32",[Type::f32()], Type::f32());
28042801
ifn!(intrinsics, "llvm.floor.f64",[Type::f64()], Type::f64());
28052802
ifn!(intrinsics, "llvm.ceil.f32", [Type::f32()], Type::f32());
28062803
ifn!(intrinsics, "llvm.ceil.f64", [Type::f64()], Type::f64());
28072804
ifn!(intrinsics, "llvm.trunc.f32",[Type::f32()], Type::f32());
28082805
ifn!(intrinsics, "llvm.trunc.f64",[Type::f64()], Type::f64());
28092806

2810-
ifn!(intrinsics, "llvm.rint.f32", [Type::f32()], Type::f32());
2811-
ifn!(intrinsics, "llvm.rint.f64", [Type::f64()], Type::f64());
2812-
ifn!(intrinsics, "llvm.nearbyint.f32", [Type::f32()], Type::f32());
2813-
ifn!(intrinsics, "llvm.nearbyint.f64", [Type::f64()], Type::f64());
2814-
ifn!(intrinsics, "llvm.round.f32", [Type::f32()], Type::f32());
2815-
ifn!(intrinsics, "llvm.round.f64", [Type::f64()], Type::f64());
2816-
28172807
ifn!(intrinsics, "llvm.ctpop.i8", [Type::i8()], Type::i8());
28182808
ifn!(intrinsics, "llvm.ctpop.i16",[Type::i16()], Type::i16());
28192809
ifn!(intrinsics, "llvm.ctpop.i32",[Type::i32()], Type::i32());

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -460,20 +460,12 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
460460
"fmaf64" => simple_llvm_intrinsic(bcx, "llvm.fma.f64", 3),
461461
"fabsf32" => simple_llvm_intrinsic(bcx, "llvm.fabs.f32", 1),
462462
"fabsf64" => simple_llvm_intrinsic(bcx, "llvm.fabs.f64", 1),
463-
"copysignf32" => simple_llvm_intrinsic(bcx, "llvm.copysign.f32", 2),
464-
"copysignf64" => simple_llvm_intrinsic(bcx, "llvm.copysign.f64", 2),
465463
"floorf32" => simple_llvm_intrinsic(bcx, "llvm.floor.f32", 1),
466464
"floorf64" => simple_llvm_intrinsic(bcx, "llvm.floor.f64", 1),
467465
"ceilf32" => simple_llvm_intrinsic(bcx, "llvm.ceil.f32", 1),
468466
"ceilf64" => simple_llvm_intrinsic(bcx, "llvm.ceil.f64", 1),
469467
"truncf32" => simple_llvm_intrinsic(bcx, "llvm.trunc.f32", 1),
470468
"truncf64" => simple_llvm_intrinsic(bcx, "llvm.trunc.f64", 1),
471-
"rintf32" => simple_llvm_intrinsic(bcx, "llvm.rint.f32", 1),
472-
"rintf64" => simple_llvm_intrinsic(bcx, "llvm.rint.f64", 1),
473-
"nearbyintf32" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f32", 1),
474-
"nearbyintf64" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f64", 1),
475-
"roundf32" => simple_llvm_intrinsic(bcx, "llvm.round.f32", 1),
476-
"roundf64" => simple_llvm_intrinsic(bcx, "llvm.round.f64", 1),
477469
"ctpop8" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i8", 1),
478470
"ctpop16" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i16", 1),
479471
"ctpop32" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i32", 1),

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

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3807,37 +3807,29 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
38073807
~[ ty::mk_f64(), ty::mk_f64(), ty::mk_f64() ],
38083808
ty::mk_f64())
38093809
}
3810-
"fabsf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3811-
"fabsf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3812-
"copysignf32" => (0, ~[ ty::mk_f32(), ty::mk_f32() ], ty::mk_f32()),
3813-
"copysignf64" => (0, ~[ ty::mk_f64(), ty::mk_f64() ], ty::mk_f64()),
3814-
"floorf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3815-
"floorf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3816-
"ceilf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3817-
"ceilf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3818-
"truncf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3819-
"truncf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3820-
"rintf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3821-
"rintf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3822-
"nearbyintf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3823-
"nearbyintf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3824-
"roundf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3825-
"roundf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3826-
"ctpop8" => (0, ~[ ty::mk_i8() ], ty::mk_i8()),
3827-
"ctpop16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3828-
"ctpop32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3829-
"ctpop64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3830-
"ctlz8" => (0, ~[ ty::mk_i8() ], ty::mk_i8()),
3831-
"ctlz16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3832-
"ctlz32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3833-
"ctlz64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3834-
"cttz8" => (0, ~[ ty::mk_i8() ], ty::mk_i8()),
3835-
"cttz16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3836-
"cttz32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3837-
"cttz64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3838-
"bswap16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3839-
"bswap32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3840-
"bswap64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3810+
"fabsf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3811+
"fabsf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3812+
"floorf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3813+
"floorf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3814+
"ceilf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3815+
"ceilf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3816+
"truncf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3817+
"truncf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3818+
"ctpop8" => (0, ~[ ty::mk_i8() ], ty::mk_i8()),
3819+
"ctpop16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3820+
"ctpop32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3821+
"ctpop64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3822+
"ctlz8" => (0, ~[ ty::mk_i8() ], ty::mk_i8()),
3823+
"ctlz16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3824+
"ctlz32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3825+
"ctlz64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3826+
"cttz8" => (0, ~[ ty::mk_i8() ], ty::mk_i8()),
3827+
"cttz16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3828+
"cttz32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3829+
"cttz64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3830+
"bswap16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3831+
"bswap32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3832+
"bswap64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
38413833

38423834
"i8_add_with_overflow" | "i8_sub_with_overflow" | "i8_mul_with_overflow" =>
38433835
(0, ~[ty::mk_i8(), ty::mk_i8()],

branches/try2/src/librustpkg/conditions.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ condition! {
4747
pub no_rust_path: (~str) -> Path;
4848
}
4949

50+
condition! {
51+
pub not_a_workspace: (~str) -> Path;
52+
}
53+
5054
condition! {
5155
pub failed_to_create_temp_dir: (~str) -> Path;
5256
}

branches/try2/src/librustpkg/package_source.rs

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use crate::Crate;
1919
use messages::*;
2020
use source_control::{safe_git_clone, git_clone_url, DirToUse, CheckedOutSources};
2121
use source_control::make_read_only;
22-
use path_util::{find_dir_using_rust_path_hack, make_dir_rwx_recursive, default_workspace};
23-
use path_util::{target_build_dir, versionize, dir_has_crate_file};
22+
use path_util::{find_dir_using_rust_path_hack, make_dir_rwx_recursive};
23+
use path_util::{target_build_dir, versionize};
2424
use util::{compile_crate, DepMap};
2525
use workcache_support;
2626
use workcache_support::crate_tag;
@@ -197,23 +197,7 @@ impl PkgSrc {
197197
match ok_d {
198198
Some(d) => d,
199199
None => {
200-
// See if the sources are in $CWD
201-
let cwd = os::getcwd();
202-
if dir_has_crate_file(&cwd) {
203-
return PkgSrc {
204-
// In this case, source_workspace isn't really a workspace.
205-
// This data structure needs yet more refactoring.
206-
source_workspace: cwd.clone(),
207-
destination_workspace: default_workspace(),
208-
build_in_destination: true,
209-
start_dir: cwd,
210-
id: id,
211-
libs: ~[],
212-
mains: ~[],
213-
benchs: ~[],
214-
tests: ~[]
215-
}
216-
} else if use_rust_path_hack {
200+
if use_rust_path_hack {
217201
match find_dir_using_rust_path_hack(&id) {
218202
Some(d) => d,
219203
None => {

branches/try2/src/librustpkg/path_util.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,6 @@ pub fn uninstall_package_from(workspace: &Path, pkgid: &PkgId) {
414414

415415
}
416416

417-
pub fn dir_has_crate_file(dir: &Path) -> bool {
418-
dir_has_file(dir, "lib.rs") || dir_has_file(dir, "main.rs")
419-
|| dir_has_file(dir, "test.rs") || dir_has_file(dir, "bench.rs")
420-
}
421-
422417
fn dir_has_file(dir: &Path, file: &str) -> bool {
423418
assert!(dir.is_absolute());
424419
os::path_exists(&dir.join(file))
@@ -432,7 +427,8 @@ pub fn find_dir_using_rust_path_hack(p: &PkgId) -> Option<Path> {
432427
// has a name that's a single component
433428
if dir.ends_with_path(&p.path) || dir.ends_with_path(&versionize(&p.path, &p.version)) {
434429
debug2!("In find_dir_using_rust_path_hack: checking dir {}", dir.display());
435-
if dir_has_crate_file(dir) {
430+
if dir_has_file(dir, "lib.rs") || dir_has_file(dir, "main.rs")
431+
|| dir_has_file(dir, "test.rs") || dir_has_file(dir, "bench.rs") {
436432
debug2!("Did find id {} in dir {}", p.to_str(), dir.display());
437433
return Some(dir.clone());
438434
}

branches/try2/src/librustpkg/rustpkg.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use messages::{error, warn, note};
3838
use path_util::{build_pkg_id_in_workspace, built_test_in_workspace};
3939
use path_util::{U_RWX, in_rust_path};
4040
use path_util::{built_executable_in_workspace, built_library_in_workspace, default_workspace};
41-
use path_util::{target_executable_in_workspace, target_library_in_workspace, dir_has_crate_file};
41+
use path_util::{target_executable_in_workspace, target_library_in_workspace};
4242
use source_control::{CheckedOutSources, is_git_dir, make_read_only};
4343
use workspace::{each_pkg_parent_workspace, pkg_parent_workspaces, cwd_to_workspace};
4444
use workspace::determine_destination;
@@ -48,6 +48,7 @@ use context::{Context, BuildContext,
4848
use package_id::PkgId;
4949
use package_source::PkgSrc;
5050
use target::{WhatToBuild, Everything, is_lib, is_main, is_test, is_bench, Tests};
51+
// use workcache_support::{discover_outputs, digest_only_date};
5152
use workcache_support::digest_only_date;
5253
use exit_codes::{COPY_FAILED_CODE, BAD_FLAG_CODE};
5354

@@ -209,11 +210,10 @@ pub trait CtxMethods {
209210

210211
impl CtxMethods for BuildContext {
211212
fn build_args(&self, args: ~[~str], what: &WhatToBuild) -> Option<(PkgId, Path)> {
212-
let cwd = os::getcwd();
213-
214213
if args.len() < 1 {
215214
match cwd_to_workspace() {
216-
None if dir_has_crate_file(&cwd) => {
215+
None if self.context.use_rust_path_hack => {
216+
let cwd = os::getcwd();
217217
// FIXME (#9639): This needs to handle non-utf8 paths
218218
let pkgid = PkgId::new(cwd.filename_str().unwrap());
219219
let mut pkg_src = PkgSrc::new(cwd, default_workspace(), true, pkgid);
@@ -260,7 +260,6 @@ impl CtxMethods for BuildContext {
260260
}
261261
}
262262
fn run(&self, cmd: &str, args: ~[~str]) {
263-
let cwd = os::getcwd();
264263
match cmd {
265264
"build" => {
266265
self.build_args(args, &Everything);
@@ -279,6 +278,7 @@ impl CtxMethods for BuildContext {
279278
// The package id is presumed to be the first command-line
280279
// argument
281280
let pkgid = PkgId::new(args[0].clone());
281+
let cwd = os::getcwd();
282282
self.clean(&cwd, &pkgid); // tjc: should use workspace, not cwd
283283
}
284284
}
@@ -295,9 +295,9 @@ impl CtxMethods for BuildContext {
295295
"install" => {
296296
if args.len() < 1 {
297297
match cwd_to_workspace() {
298-
None if dir_has_crate_file(&cwd) => {
298+
None if self.context.use_rust_path_hack => {
299+
let cwd = os::getcwd();
299300
// FIXME (#9639): This needs to handle non-utf8 paths
300-
301301
let inferred_pkgid =
302302
PkgId::new(cwd.filename_str().unwrap());
303303
self.install(PkgSrc::new(cwd, default_workspace(),

0 commit comments

Comments
 (0)