Skip to content

Commit 476a8eb

Browse files
committed
---
yaml --- r: 95544 b: refs/heads/dist-snap c: 8a60caa h: refs/heads/master v: v3
1 parent ad84aa1 commit 476a8eb

File tree

35 files changed

+535
-229
lines changed

35 files changed

+535
-229
lines changed

[refs]

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

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ extern mod this(name = "rustpkg");
1414
#[cfg(rustdoc)]
1515
extern mod this(name = "rustdoc");
1616

17-
#[cfg(rusti)]
18-
extern mod this(name = "rusti");
19-
20-
#[cfg(rust)]
21-
extern mod this(name = "rust");
22-
2317
#[cfg(rustc)]
2418
extern mod this(name = "rustc");
2519

branches/dist-snap/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/dist-snap/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_passess(fpm, mpm, llmod, OptLevel);
300+
populate_llvm_passes(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_passess(fpm: lib::llvm::PassManagerRef,
426-
mpm: lib::llvm::PassManagerRef,
427-
llmod: ModuleRef,
428-
opt: lib::llvm::CodeGenOptLevel) {
425+
unsafe fn populate_llvm_passes(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/dist-snap/src/librustc/front/feature_gate.rs

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

3839
// These are used to test this portion of the compiler, they don't actually
3940
// mean anything
@@ -108,26 +109,29 @@ impl Visitor<()> for Context {
108109
}
109110
}
110111

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-
125112
_ => {}
126113
}
127114

128115
visit::walk_item(self, i, ());
129116
}
130117

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+
131135
fn visit_ty(&mut self, t: &ast::Ty, _: ()) {
132136
match t.node {
133137
ast::ty_closure(closure) if closure.onceness == ast::Once => {

branches/dist-snap/src/librustc/middle/privacy.rs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,20 @@ impl<'self> PrivacyVisitor<'self> {
563563
}
564564
}
565565
};
566+
let check_struct = |def: &@ast::struct_def| {
567+
for f in def.fields.iter() {
568+
match f.node.kind {
569+
ast::named_field(_, ast::public) => {
570+
tcx.sess.span_err(f.span, "unnecessary `pub` \
571+
visibility");
572+
}
573+
ast::named_field(_, ast::private) => {
574+
// Fields should really be private by default...
575+
}
576+
ast::named_field(*) | ast::unnamed_field => {}
577+
}
578+
}
579+
};
566580
match item.node {
567581
// implementations of traits don't need visibility qualifiers because
568582
// that's controlled by having the trait in scope.
@@ -610,24 +624,16 @@ impl<'self> PrivacyVisitor<'self> {
610624
}
611625
ast::inherited => {}
612626
}
613-
}
614-
}
615627

616-
ast::item_struct(ref def, _) => {
617-
for f in def.fields.iter() {
618-
match f.node.kind {
619-
ast::named_field(_, ast::public) => {
620-
tcx.sess.span_err(f.span, "unnecessary `pub` \
621-
visibility");
622-
}
623-
ast::named_field(_, ast::private) => {
624-
// Fields should really be private by default...
625-
}
626-
ast::named_field(*) | ast::unnamed_field => {}
628+
match v.node.kind {
629+
ast::struct_variant_kind(ref s) => check_struct(s),
630+
ast::tuple_variant_kind(*) => {}
627631
}
628632
}
629633
}
630634

635+
ast::item_struct(ref def, _) => check_struct(def),
636+
631637
ast::item_trait(_, _, ref methods) => {
632638
for m in methods.iter() {
633639
match *m {

branches/dist-snap/src/librustc/middle/trans/base.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,13 +2797,23 @@ 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+
28002803
ifn!(intrinsics, "llvm.floor.f32",[Type::f32()], Type::f32());
28012804
ifn!(intrinsics, "llvm.floor.f64",[Type::f64()], Type::f64());
28022805
ifn!(intrinsics, "llvm.ceil.f32", [Type::f32()], Type::f32());
28032806
ifn!(intrinsics, "llvm.ceil.f64", [Type::f64()], Type::f64());
28042807
ifn!(intrinsics, "llvm.trunc.f32",[Type::f32()], Type::f32());
28052808
ifn!(intrinsics, "llvm.trunc.f64",[Type::f64()], Type::f64());
28062809

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+
28072817
ifn!(intrinsics, "llvm.ctpop.i8", [Type::i8()], Type::i8());
28082818
ifn!(intrinsics, "llvm.ctpop.i16",[Type::i16()], Type::i16());
28092819
ifn!(intrinsics, "llvm.ctpop.i32",[Type::i32()], Type::i32());

branches/dist-snap/src/librustc/middle/trans/intrinsic.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,12 +460,20 @@ 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),
463465
"floorf32" => simple_llvm_intrinsic(bcx, "llvm.floor.f32", 1),
464466
"floorf64" => simple_llvm_intrinsic(bcx, "llvm.floor.f64", 1),
465467
"ceilf32" => simple_llvm_intrinsic(bcx, "llvm.ceil.f32", 1),
466468
"ceilf64" => simple_llvm_intrinsic(bcx, "llvm.ceil.f64", 1),
467469
"truncf32" => simple_llvm_intrinsic(bcx, "llvm.trunc.f32", 1),
468470
"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),
469477
"ctpop8" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i8", 1),
470478
"ctpop16" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i16", 1),
471479
"ctpop32" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i32", 1),

branches/dist-snap/src/librustc/middle/typeck/check/mod.rs

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3807,29 +3807,37 @@ 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-
"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()),
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()),
38333841

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

branches/dist-snap/src/librustpkg/conditions.rs

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

50-
condition! {
51-
pub not_a_workspace: (~str) -> Path;
52-
}
53-
5450
condition! {
5551
pub failed_to_create_temp_dir: (~str) -> Path;
5652
}

branches/dist-snap/src/librustpkg/package_source.rs

Lines changed: 19 additions & 3 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};
23-
use path_util::{target_build_dir, versionize};
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};
2424
use util::{compile_crate, DepMap};
2525
use workcache_support;
2626
use workcache_support::crate_tag;
@@ -197,7 +197,23 @@ impl PkgSrc {
197197
match ok_d {
198198
Some(d) => d,
199199
None => {
200-
if use_rust_path_hack {
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 {
201217
match find_dir_using_rust_path_hack(&id) {
202218
Some(d) => d,
203219
None => {

branches/dist-snap/src/librustpkg/path_util.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,11 @@ 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+
417422
fn dir_has_file(dir: &Path, file: &str) -> bool {
418423
assert!(dir.is_absolute());
419424
os::path_exists(&dir.join(file))
@@ -427,8 +432,7 @@ pub fn find_dir_using_rust_path_hack(p: &PkgId) -> Option<Path> {
427432
// has a name that's a single component
428433
if dir.ends_with_path(&p.path) || dir.ends_with_path(&versionize(&p.path, &p.version)) {
429434
debug2!("In find_dir_using_rust_path_hack: checking dir {}", dir.display());
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") {
435+
if dir_has_crate_file(dir) {
432436
debug2!("Did find id {} in dir {}", p.to_str(), dir.display());
433437
return Some(dir.clone());
434438
}

0 commit comments

Comments
 (0)