Commit graph

223 commits

Author SHA1 Message Date
Erick Tryzelaar
6fcf2ee8e3 std: Transform.find_ -> .find 2013-08-10 07:33:22 -07:00
Erick Tryzelaar
f9dee04aaa std: Iterator.len_ -> .len 2013-08-10 07:33:22 -07:00
Erick Tryzelaar
68f40d215e std: Rename Iterator.transform -> .map
cc #5898
2013-08-10 07:33:21 -07:00
Erick Tryzelaar
fad7857c7b Mass rename of .consume{,_iter}() to .move_iter()
cc #7887
2013-08-10 07:01:07 -07:00
Erick Tryzelaar
ee59aacac4 Merge remote-tracking branch 'remotes/origin/master' into remove-str-trailing-nulls 2013-08-09 18:48:01 -07:00
Tim Chevalier
37fd8f03fd rustpkg: Simplify the PkgId struct
Get rid of special cases for names beginning with "rust-" or
containing hyphens, and just store a Path in a package ID. The Rust-identifier
for the crate is none of rustpkg's business.
2013-08-09 14:11:55 -07:00
Tim Chevalier
96fd606ddd std/rustc/rustpkg/syntax: Support the extern mod = ... form
This commit allows you to write:

 extern mod x = "a/b/c";

which means rustc will search in the RUST_PATH for a package with
ID a/b/c, and bind it to the name `x` if it's found.

Incidentally, move get_relative_to from back::rpath into std::path
2013-08-09 14:11:50 -07:00
Erick Tryzelaar
cab6d46e58 rustpkg: another fix for windows 2013-08-09 14:06:03 -07:00
Erick Tryzelaar
56730c094c Merge remote-tracking branch 'remotes/origin/master' into remove-str-trailing-nulls 2013-08-08 19:27:03 -07:00
Tim Chevalier
7c1eb83052 rustpkg: Eliminate a copy 2013-08-08 15:17:28 -07:00
Brian Anderson
84d17445f8 rustpkg: Disable test_uninstall
Seems to not work
2013-08-07 15:40:27 -07:00
Erick Tryzelaar
5eaa4d1d2f Merge remote-tracking branch 'remotes/origin/master' into remove-str-trailing-nulls 2013-08-06 16:21:02 -07:00
Marvin Löbel
0ac7a219f0 Updated std::Option, std::Either and std::Result
- Made naming schemes consistent between Option, Result and Either
- Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None)
- Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-08-05 22:42:21 +02:00
Erick Tryzelaar
3c94b5044c Merge remote-tracking branch 'remotes/origin/master' into str-remove-null 2013-08-04 16:23:41 -07:00
Erick Tryzelaar
3102b1797e std: replace str::as_c_str with std::c_str 2013-08-04 14:13:17 -07:00
Daniel Micay
1008945528 remove obsolete foreach keyword
this has been replaced by `for`
2013-08-03 22:48:02 -04:00
Daniel Micay
b3ad685f7f replace all remaining for with foreach or do 2013-08-03 03:00:42 -04:00
Daniel Micay
1fc4db2d08 migrate many for loops to foreach 2013-08-01 05:34:55 -04:00
Daniel Micay
dabd476203 make in and foreach get treated as keywords 2013-08-01 00:21:13 -04:00
bors
2830d7d013 auto merge of #8032 : catamorphism/rust/rustpkg-tags, r=graydon
r? @graydon    Package IDs can now be of the form a/b/c#FOO, where (if a/b/c is
    a git repository) FOO is any tag in the repository. Non-numeric
    tags only match against package IDs with the same tag, and aren't
    compared linearly like numeric versions.
    
 While I was at it, refactored the code that calls `git clone`,  and segregated build output properly for different packages.
2013-07-29 11:04:25 -07:00
Erick Tryzelaar
2a68c719f4 to_either + fixes 2013-07-27 23:41:09 -07:00
Graydon Hoare
413446c85b rustc: reorganize driver, replace compile_upto with multiple more-obvious functions. 2013-07-27 00:48:05 -07:00
Tim Chevalier
c8780511b9 rustpkg: Don't assume a non-numeric refspec is a tag
Just pass it directly to git, without prefixing it with tags/
2013-07-26 12:31:53 -07:00
Tim Chevalier
bfac584a03 rustpkg: Handle non-numeric versions; some cleanup
Package IDs can now be of the form a/b/c#FOO, where (if a/b/c is
a git repository) FOO is any tag in the repository. Non-numeric
tags only match against package IDs with the same tag, and aren't
compared linearly like numeric versions.

While I was at it, refactored the code that calls `git clone`,
and segregated build output properly for different packages.
2013-07-24 18:42:14 -07:00
Tim Chevalier
d7c4a10fba rustpkg: Clean up usage messages for install 2013-07-24 18:39:25 -07:00
bors
330378d1a1 auto merge of #7996 : erickt/rust/cleanup-strs, r=erickt
This is a cleanup pull request that does:

* removes `os::as_c_charp`
* moves `str::as_buf` and `str::as_c_str` into `StrSlice`
* converts some functions from `StrSlice::as_buf` to `StrSlice::as_c_str`
* renames `StrSlice::as_buf` to `StrSlice::as_imm_buf` (and adds `StrSlice::as_mut_buf` to match `vec.rs`.
* renames `UniqueStr::as_bytes_with_null_consume` to `UniqueStr::to_bytes`
* and other misc cleanups and minor optimizations
2013-07-24 13:25:36 -07:00
Daniel Micay
254339fd39 fix fmt! usage 2013-07-24 09:45:20 -04:00
Birunthan Mohanathas
d047cf1ec6 Change 'print(fmt!(...))' to printf!/printfln! in src/lib* 2013-07-24 09:45:20 -04:00
Erick Tryzelaar
cf75330807 std: add test for str::as_c_str 2013-07-23 16:56:22 -07:00
Erick Tryzelaar
7af56bb921 std: move StrUtil::as_c_str into StrSlice 2013-07-23 16:56:22 -07:00
Brian Anderson
6174f9a4d9 std: Move change_dir_locked to unstable. #7870 2013-07-22 14:16:52 -07:00
bors
2f7d86f9a8 auto merge of #7942 : Dretch/rust/os-listdir-path-no-squiggle, r=brson 2013-07-22 12:01:41 -07:00
Michael Woerister
4bd1424622 Ast spanned<T> refactoring, renaming: crate, local, blk, crate_num, crate_cfg.
`crate => Crate`
`local => Local`
`blk => Block`
`crate_num => CrateNum`
`crate_cfg => CrateConfig`

Also, Crate and Local are not wrapped in spanned<T> anymore.
2013-07-22 15:35:28 +02:00
Daniel Micay
f51e2ad435 temporarily disable 3 rustpkg tests
Re-enabling these when the ephemeral failures are fixed is filed as
issue #7956.
2013-07-22 01:09:56 -04:00
Gareth Smith
a6263694ff Remove what appears to be redundant indirection from
os::list_dir_path.
2013-07-21 18:33:29 +01:00
bors
d029ebfc5f auto merge of #7902 : huonw/rust/attr++, r=cmr,pcwalton
This does a number of things, but especially dramatically reduce the
number of allocations performed for operations involving attributes/
meta items:

- Converts ast::meta_item & ast::attribute and other associated enums
  to CamelCase.
- Converts several standalone functions in syntax::attr into methods,
  defined on two traits AttrMetaMethods & AttributeMethods. The former
  is common to both MetaItem and Attribute since the latter is a thin
  wrapper around the former.
- Deletes functions that are unnecessary due to iterators.
- Converts other standalone functions to use iterators and the generic
  AttrMetaMethods rather than allocating a lot of new vectors (e.g. the
  old code would have to allocate a new vector to use functions that
  operated on &[meta_item] on &[attribute].)
- Moves the core algorithm of the #[cfg] matching to syntax::attr,
  similar to find_inline_attr and find_linkage_metas.

This doesn't have much of an effect on the speed of #[cfg] stripping,
despite hugely reducing the number of allocations performed; presumably
most of the time is spent in the ast folder rather than doing attribute
checks.

Also fixes the Eq instance of MetaItem_ to correctly ignore spans, so
that `rustc --cfg 'foo(bar)'` now works.
2013-07-20 20:25:31 -07:00
Huon Wilson
cc760a647a syntax: modernise attribute handling in syntax::attr.
This does a number of things, but especially dramatically reduce the
number of allocations performed for operations involving attributes/
meta items:

- Converts ast::meta_item & ast::attribute and other associated enums
  to CamelCase.
- Converts several standalone functions in syntax::attr into methods,
  defined on two traits AttrMetaMethods & AttributeMethods. The former
  is common to both MetaItem and Attribute since the latter is a thin
  wrapper around the former.
- Deletes functions that are unnecessary due to iterators.
- Converts other standalone functions to use iterators and the generic
  AttrMetaMethods rather than allocating a lot of new vectors (e.g. the
  old code would have to allocate a new vector to use functions that
  operated on &[meta_item] on &[attribute].)
- Moves the core algorithm of the #[cfg] matching to syntax::attr,
  similar to find_inline_attr and find_linkage_metas.

This doesn't have much of an effect on the speed of #[cfg] stripping,
despite hugely reducing the number of allocations performed; presumably
most of the time is spent in the ast folder rather than doing attribute
checks.

Also fixes the Eq instance of MetaItem_ to correctly ignore spaces, so
that `rustc --cfg 'foo(bar)'` now works.
2013-07-20 01:06:16 +10:00
Tim Chevalier
e39ea2a5c8 rustpkg: Make rustpkg commands work without a package ID
`rustpkg build`, if executed in a package source directory inside
a workspace, will now build that package. By "inside a workspace"
I mean that the parent directory has to be called `src`, and rustpkg
will create a `build` directory in .. if there isn't already one.

Same goes for `rustpkg install` and `rustpkg clean`.

For the time being, `rustpkg build` (etc.) will still error out if
you run it inside a directory whose parent isn't called `src`.
I'm not sure whether or not it's desirable to have it do something
in a non-workspace directory.
2013-07-18 17:28:40 -07:00
Patrick Walton
3f8d548914 librustc: Remove some extra "copy" keywords that came in before this change merged. 2013-07-17 14:58:12 -07:00
Patrick Walton
2dbb3c3887 test: Fix tests. 2013-07-17 14:57:54 -07:00
Patrick Walton
e20549ff19 librustc: Remove all uses of the Copy bound. 2013-07-17 14:57:53 -07:00
Patrick Walton
99b33f7219 librustc: Remove all uses of "copy". 2013-07-17 14:57:51 -07:00
Patrick Walton
b4e674f6e6 librustc: Add a lint mode for unnecessary copy and remove a bunch of them. 2013-07-17 14:56:42 -07:00
Tim Chevalier
0fa9ad8673 rustpkg: Handle local git repositories
rustpkg can now build code from a local git repository. In the
case where the local repo is in a directory not in the RUST_PATH,
it checks out the repository into a directory in the first workspace
in the RUST_PATH.

The tests no longer try to connect to github.com, which should
solve some of the sporadic failures we've been seeing.
2013-07-15 12:59:48 -07:00
Tim Chevalier
563172a73b rustpkg: Address review comments from cmr 2013-07-13 13:48:55 -07:00
Tim Chevalier
1a46afb3be rustpkg: Implement uninstall and list commands 2013-07-13 13:36:50 -07:00
bors
a48ca3290d auto merge of #7262 : nikomatsakis/rust/ref-bindings-in-irrefut-patterns, r=catamorphism
Correct treatment of irrefutable patterns. The old code was wrong in many, many ways. `ref` bindings didn't work, it sometimes copied when it should have moved, the borrow checker didn't even look at such patterns at all, we weren't consistent about preventing values with destructors from being pulled apart, etc.

Fixes #3224.
Fixes #3225.
Fixes #3255.
Fixes #6225.
Fixes #6386.

r? @catamorphism
2013-07-08 18:49:46 -07:00
Niko Matsakis
682e7467dd Patch up some new errors from rustpkg 2013-07-08 13:55:10 -04:00
Brian Anderson
b0a9d8193f Bump version numbers to 0.8-pre 2013-07-08 10:25:45 -07:00
Daniel Micay
641aec7407 remove some method resolve workarounds 2013-07-07 19:51:13 -04:00