Commit Graph

1208 Commits

Author SHA1 Message Date
Kevin Yap
3df2fbe18e Fix name of variable referenced in featureck.py 2015-02-05 20:13:08 -08:00
Brian Anderson
d0e82a68a9 Tidy fixes 2015-02-05 14:38:56 -08:00
Brian Anderson
3454c504cf Address review feedback 2015-02-05 14:37:17 -08:00
Brian Anderson
290b79c15d Clean up tidy scripts, coverage, performance
This restructures tidy.py to walk the tree itself,
and improves performance considerably by not loading entire
files into buffers for licenseck.

Splits build rules into 'tidy', 'tidy-basic', 'tidy-binaries',
'tidy-errors', 'tidy-features'.
2015-02-05 14:37:16 -08:00
Brian Anderson
0e16ad8c3f Polish errorck and featureck UI 2015-02-05 14:37:16 -08:00
bors
c3e1f77291 Auto merge of #21892 - huonw:deprecate-rand, r=alexcrichton
Use [`rand`](https://crates.io/crates/rand) and [`derive_rand`](https://crates.io/crates/derive_rand) from crates.io.

[breaking-change]
2015-02-04 08:47:27 +00:00
Huon Wilson
df1ac7aa63 Deprecate in-tree rand, std::rand and #[derive(Rand)].
Use the crates.io crate `rand` (version 0.1 should be a drop in
replacement for `std::rand`) and `rand_macros` (`#[derive_Rand]` should
be a drop-in replacement).

[breaking-change]
2015-02-04 09:39:40 +11:00
Alex Crichton
902abab144 rollup merge of #21787: alexcrichton/std-env
Conflicts:
	src/libstd/sys/unix/backtrace.rs
	src/libstd/sys/unix/os.rs
2015-02-02 10:58:01 -08:00
Alex Crichton
70ed3a48df std: Add a new env module
This is an implementation of [RFC 578][rfc] which adds a new `std::env` module
to replace most of the functionality in the current `std::os` module. More
details can be found in the RFC itself, but as a summary the following methods
have all been deprecated:

[rfc]: https://github.com/rust-lang/rfcs/pull/578

* `os::args_as_bytes`   => `env::args`
* `os::args`            => `env::args`
* `os::consts`          => `env::consts`
* `os::dll_filename`    => no replacement, use `env::consts` directly
* `os::page_size`       => `env::page_size`
* `os::make_absolute`   => use `env::current_dir` + `join` instead
* `os::getcwd`          => `env::current_dir`
* `os::change_dir`      => `env::set_current_dir`
* `os::homedir`         => `env::home_dir`
* `os::tmpdir`          => `env::temp_dir`
* `os::join_paths`      => `env::join_paths`
* `os::split_paths`     => `env::split_paths`
* `os::self_exe_name`   => `env::current_exe`
* `os::self_exe_path`   => use `env::current_exe` + `pop`
* `os::set_exit_status` => `env::set_exit_status`
* `os::get_exit_status` => `env::get_exit_status`
* `os::env`             => `env::vars`
* `os::env_as_bytes`    => `env::vars`
* `os::getenv`          => `env::var` or `env::var_string`
* `os::getenv_as_bytes` => `env::var`
* `os::setenv`          => `env::set_var`
* `os::unsetenv`        => `env::remove_var`

Many function signatures have also been tweaked for various purposes, but the
main changes were:

* `Vec`-returning APIs now all return iterators instead
* All APIs are now centered around `OsString` instead of `Vec<u8>` or `String`.
  There is currently on convenience API, `env::var_string`, which can be used to
  get the value of an environment variable as a unicode `String`.

All old APIs are `#[deprecated]` in-place and will remain for some time to allow
for migrations. The semantics of the APIs have been tweaked slightly with regard
to dealing with invalid unicode (panic instead of replacement).

The new `std::env` module is all contained within the `env` feature, so crates
must add the following to access the new APIs:

    #![feature(env)]

[breaking-change]
2015-02-01 11:08:15 -08:00
Sébastien Marie
fcb30a0b67 openbsd support 2015-02-01 14:41:38 +01:00
Alex Crichton
e2282f9cfb rollup merge of #21738: steveklabnik/move_out_editors
As we grow, these don't belong in-tree.

http://internals.rust-lang.org/t/moving-editor-highlighting-into-their-own-repos/1395

* https://github.com/rust-lang/rust.vim
* https://github.com/rust-lang/rust-mode
* https://github.com/rust-lang/gedit-config
* https://github.com/rust-lang/kate-config
* https://github.com/rust-lang/nano-config
* https://github.com/rust-lang/zsh-config
2015-01-30 12:03:26 -08:00
Steve Klabnik
017b3a5431 Pull configs out into individual repositories
As we grow, these don't belong in-tree.

http://internals.rust-lang.org/t/moving-editor-highlighting-into-their-own-repos/1395

* https://github.com/rust-lang/rust.vim
* https://github.com/rust-lang/rust-mode
* https://github.com/rust-lang/gedit-config
* https://github.com/rust-lang/kate-config
* https://github.com/rust-lang/nano-config
* https://github.com/rust-lang/zsh-config
2015-01-29 01:16:54 -05:00
Manish Goregaokar
092330c640 Rollup merge of 21643 - semarie:break-local_stage0, r=brson 2015-01-29 03:17:16 +05:30
Manish Goregaokar
c709ed2faf Merge remote-tracking branch 'origin/master' into rollup
Conflicts:
	src/libcollections/slice.rs
	src/libcore/nonzero.rs
	src/libcore/ops.rs
2015-01-28 23:31:03 +05:30
Manish Goregaokar
2ac91a382d Rollup merge of #21686 - richo:python-fixes, r=alexcrichton
While waiting on some builds I started cleaning up the various python bits and pieces.

I'm going to keep poking, want to ping me before the next rollup?
2015-01-28 04:34:40 +05:30
Manish Goregaokar
4af4b377a0 Rollup merge of #21624 - emanueLczirai:vim_syntastic_fix, r=sanxiyn
when saving .rs files under vim
do not fail to run the syntax checker
error: Unrecognized option: 'parse-only'.

due to this commit
953f294ea3
which removed the deprecated flag --parse-only
2015-01-27 22:24:04 +05:30
Richo Healey
7cabb2124e Fix PEP8 for tidy 2015-01-27 01:26:13 -08:00
Richo Healey
1db2039f52 Fix PEP8 in mirror-all-snapshots 2015-01-27 01:26:03 -08:00
Richo Healey
a4ab5e59a7 Fix PEP8 for latest-unix-snaps.py 2015-01-27 01:26:03 -08:00
Richo Healey
109a6bc86c Fix PEP8 for htmldocck 2015-01-27 01:26:03 -08:00
Richo Healey
bbb2871bfb Fix PEP8 for generate-keyword-tests 2015-01-27 01:26:03 -08:00
Richo Healey
888a149088 Fix PEP8 for extract_grammar 2015-01-27 01:26:03 -08:00
Richo Healey
7faffbef68 Fix PEP8 for errorck 2015-01-27 01:26:02 -08:00
Richo Healey
91928dd9e9 Fix PEP8 for check-summary.py 2015-01-27 01:26:02 -08:00
Richo Healey
f7509df8f9 Fix PEP8 in sugarise-doc-comments 2015-01-27 01:26:02 -08:00
Richo Healey
ab0081ae45 Fix PEP8 in snapshot.py 2015-01-27 01:26:02 -08:00
Richo Healey
58d03ad95d Fix PEP8 in maketest 2015-01-27 01:26:01 -08:00
Richo Healey
04408fadd3 Fix PEP8 in make-win-dist 2015-01-27 01:25:54 -08:00
Richo Healey
2822bc582c Fix PEP8 in lldb_rust_formatters.py 2015-01-27 01:25:54 -08:00
Richo Healey
f697a06da4 Fix PEP8 in lldb_batchmode.py 2015-01-27 01:25:54 -08:00
Richo Healey
958dea1745 make get-snapshot externally usable 2015-01-27 01:09:38 -08:00
Richo Healey
f230683b1a Fix PEP8 in get-snapshot 2015-01-27 01:09:38 -08:00
Richo Healey
6af36031e2 Fix PEP8 in gdb pretty printer 2015-01-27 01:09:38 -08:00
Sébastien Marie
d553ed66c7 shell 'case' statement don't need 'break'
the syntax of 'case' is:
`case word in [[(] pattern [| pattern] ...) list ;; ] ... esac`

`list` don't have to issue `break`. `break` is normally used to exit a
`for`, `until` or `while` loop.
2015-01-26 08:32:34 +01:00
Brian Anderson
d179ba3b8e Merge remote-tracking branch 'rust-lang/master'
Conflicts:
	src/libcore/cmp.rs
	src/libcore/fmt/mod.rs
	src/libcore/iter.rs
	src/libcore/marker.rs
	src/libcore/num/f32.rs
	src/libcore/num/f64.rs
	src/libcore/result.rs
	src/libcore/str/mod.rs
	src/librustc/lint/builtin.rs
	src/librustc/lint/context.rs
	src/libstd/sync/mpsc/mod.rs
	src/libstd/sync/poison.rs
2015-01-25 22:14:06 -08:00
Jorge Aparicio
bff462302b cleanup: s/impl Copy/#[derive(Copy)]/g 2015-01-25 11:20:38 -05:00
emanueLczirai
59c2de16df fix vim syntastic: --parse-only => -Z parse-only
when saving .rs files under vim
do not fail to run the syntax checker
error: Unrecognized option: 'parse-only'.

due to this commit
953f294ea3
which removed the deprecated flag --parse-only
2015-01-25 16:17:19 +01:00
Brian Anderson
de5498650a featurkck: Typo 2015-01-25 01:25:59 -08:00
Brian Anderson
63fcbcf3ce Merge remote-tracking branch 'rust-lang/master'
Conflicts:
	mk/tests.mk
	src/liballoc/arc.rs
	src/liballoc/boxed.rs
	src/liballoc/rc.rs
	src/libcollections/bit.rs
	src/libcollections/btree/map.rs
	src/libcollections/btree/set.rs
	src/libcollections/dlist.rs
	src/libcollections/ring_buf.rs
	src/libcollections/slice.rs
	src/libcollections/str.rs
	src/libcollections/string.rs
	src/libcollections/vec.rs
	src/libcollections/vec_map.rs
	src/libcore/any.rs
	src/libcore/array.rs
	src/libcore/borrow.rs
	src/libcore/error.rs
	src/libcore/fmt/mod.rs
	src/libcore/iter.rs
	src/libcore/marker.rs
	src/libcore/ops.rs
	src/libcore/result.rs
	src/libcore/slice.rs
	src/libcore/str/mod.rs
	src/libregex/lib.rs
	src/libregex/re.rs
	src/librustc/lint/builtin.rs
	src/libstd/collections/hash/map.rs
	src/libstd/collections/hash/set.rs
	src/libstd/sync/mpsc/mod.rs
	src/libstd/sync/mutex.rs
	src/libstd/sync/poison.rs
	src/libstd/sync/rwlock.rs
	src/libsyntax/feature_gate.rs
	src/libsyntax/test.rs
2015-01-25 01:20:55 -08:00
Brian Anderson
b7fe2c54b7 Fix bugs in featureck.py 2015-01-23 21:43:38 -08:00
Brian Anderson
9758c488a9 Deprecated attributes don't take 'feature' names and are paired with stable/unstable
Conflicts:
	src/libcore/atomic.rs
	src/libcore/finally.rs
	src/test/auxiliary/inherited_stability.rs
	src/test/auxiliary/lint_stability.rs
2015-01-23 15:50:03 -08:00
Kevin Yap
76c279a4cf Use a regex to perform license check 2015-01-22 23:04:14 -08:00
Kevin Yap
fc5bbdf70f Make make tidy Python scripts more idiomatic
Also makes errorck.py and tidy.py compatible with Python 3.
2015-01-22 23:04:07 -08:00
Brian Anderson
41278c5441 Remove 'since' from unstable attributes 2015-01-21 19:25:55 -08:00
Brian Anderson
0768892abe Minor fixes 2015-01-21 16:16:22 -08:00
Brian Anderson
11f4d62a06 Add a lint for library features
Does a sanity check of the version numbers.
2015-01-21 16:16:21 -08:00
Alex Crichton
b250d9a3c8 rollup merge of #21289: brson/errorcodes
This does the bare minimum to make registration of error codes work again. After this patch, every call to `span_err!` with an error code gets that error code validated against a list in that crate and a new tidy script `errorck.py` validates that no error codes are duplicated globally.

There are further improvements to be made yet, detailed in #19624.

r? @nikomatsakis
2015-01-21 09:13:46 -08:00
Alex Crichton
41890bfa46 rollup merge of #21274: estsauver/21270
The timezone of the server that builds rustc nightlies
appears to be in UTC. From what I can tell, it builds
the nightlies at 0300 UTC, which takes about ~15 minutes.
So, there were a couple options here for which offset to use.

UTC+3 would ensure that you always got the latest rust, but it
would mean the script is broken ~15/20 minutes a day. UTC+4
means users get a stale nightly for 45 minutes, but that feels
okay to me.

Ideally, buildbot would publish the "current" nightly, but
that seems unneeded relative to fixing it for all Timezones
quickly.

Fixes #21270
2015-01-21 09:13:43 -08:00
Alex Crichton
550255d986 rollup merge of #21138: mkpankov/master
When combined with '--save' and '--date', it uses previously saved
tarball, making possible to re-install in offline mode.
r?
2015-01-21 09:13:40 -08:00
Alex Crichton
83af23ea49 rollup merge of #19913: KOMON/rust-mode-emacs-indentation
I added an option to auto-indent method chains to line up along their '.' operators. Like so:

```
let input = io::stdin().readline()
                       .ok()
                       .expect("Failed to read line");
```

The old default would indent like so:
```
let input = io::stdin().readme()
    .ok()
    .expect("Failed to read line");
```

The Rust guide explicitly condones the former, so I thought it would be nice for the emacs mode to support it. It's off by default, you have to set ```rust-indent-method-chain``` to ```t``` via your .emacs or the customize menu
2015-01-21 09:13:36 -08:00
bors
6869645e86 Auto merge of #21242 - richo:no-perl, r=brson
There's only one build-critical path in which perl is used, and it was to do a text replacement trivially achievable with sed(1).

I ported the indenter script because it [appears to be used][indenter], but removed check links because it appears to be entirely out of date.

[indenter]: https://github.com/rust-lang/rust/blob/master/src/librustc/util/common.rs#L60-70
2015-01-21 11:07:31 +00:00
Daniel Raloff
8051bd0626 Changed rust-mode code for tabs -> spaces 2015-01-20 14:07:10 -08:00
Brian Anderson
953d6dfd7e Make error code registration work again. #19624 2015-01-20 11:27:14 -08:00
Barosl LEE
0225f9a380 Rollup merge of #21123 - visualfc:master, r=alexcrichton
example:
let m = "hello \
           world";
2015-01-21 02:16:51 +09:00
Barosl LEE
c5fd58d512 Rollup merge of #21377 - iKevinY:speedy-tidy, r=huonw
`x in y` is more Pythonic than `y.find(x) != -1`. I believe it runs quite a bit faster as well (though it's probably not a bottleneck of the Travis builds):

```bash
$ python -m timeit '"abc".find("a") != -1'
1000000 loops, best of 3: 0.218 usec per loop
$ python -m timeit '"a" in "abc"'
10000000 loops, best of 3: 0.0343 usec per loop
```
2015-01-21 02:16:50 +09:00
Barosl LEE
0efdda314a Rollup merge of #21369 - iKevinY:no-travis-notes, r=sanxiyn
Updated `tidy.py` to skip printing NOTEs if the [`TRAVIS`](http://docs.travis-ci.com/user/ci-environment/#Environment-variables) environment variable is set.
2015-01-21 02:16:49 +09:00
Barosl LEE
356c61da8d Rollup merge of #21326 - look:nano-syntax-highlighting, r=kmcallister
rust.nanorc provides syntax highlighting for Rust. An attempt has been made to make the syntax highlighting look good on both dark and light terminals. Issue #21286.

This PR is dedicated to @substars and nano-lovers everywhere.
2015-01-21 02:16:47 +09:00
Barosl LEE
1d8b917811 Rollup merge of #20998 - estsauver:20984, r=steveklabnik
There are a large number of places that incorrectly refer
to deriving in comments, instead of derives.

If someone could look at src/etc/generate-deriving-span-tests.py,
I'm not sure how those tests were passing before/if they were.
2015-01-21 02:16:45 +09:00
Earl St Sauver
c034f4a44a Make date of nightly in rustup match server TZ 2015-01-18 18:06:15 -08:00
Kevin Yap
21f4483de3 Use 'in' instead of 'find()' in tidy.py
'x in y' is more Pythonic and faster than 'y.find(x) != -1'.
2015-01-18 14:52:59 -08:00
Kevin Yap
d1b1b62ae8 Ignore NOTEs when Travis runs make tidy
Only print NOTE warnings if the 'TRAVIS' environment variable has not
been set. Addresses #21322.
2015-01-18 09:29:44 -08:00
Kang Seonghoon
2c1d1fbdf9 tests: Warn on the trailing backslash in the template. 2015-01-18 13:23:34 +09:00
Luke Francl
ac4baca72a Passable nano syntax highlighting
rust.nanorc provides syntax highlighting for Rust. An attempt has been made to
make the syntax highlighting look good on both dark and light terminals.
Issue #21286.
2015-01-17 13:59:49 -08:00
Earl St Sauver
6ab95bdd62 s/deriving/derives in Comments/Docs
There are a large number of places that incorrectly refer
to deriving in comments, instead of derives.

Fixes #20984
2015-01-17 11:08:02 -08:00
Kang Seonghoon
39e19ccdb6 tests: Tidy and allows multi-line htmldocck commands. 2015-01-18 03:23:52 +09:00
Kang Seonghoon
de6f520192 tests: Add htmldocck.py script for the use of Rustdoc tests.
The script is intended as a tool for doing every sort of verifications
amenable to Rustdoc's HTML output. For example, link checkers would go
to this script. It already parses HTML into a document tree form (with
a slight caveat), so future tests can make use of it.

As an example, relevant `rustdoc-*` run-make tests have been updated
to use `htmldocck.py` and got their `verify.sh` removed. In the future
they may go to a dedicated directory with htmldocck running by default.
The detailed explanation of test scripts is provided as a docstring of
htmldocck.

cc #19723
2015-01-18 02:42:15 +09:00
Michael Pankov
785176b7cc rustup: Don't attempt to download SHA if it exists
This way installer can work fully in offline mode.

Put pre-downloaded files
(rust-nightly-x86_64-unknown-linux-gnu.tar.gz and
 rust-nightly-x86_64-unknown-linux-gnu.tar.gz.sha256)
into the $HOME/.rustup/YYYY-MM-DD directory
as it would be done by script itself.

Specify --save and --date=YYYY-MM-DD when running.
Files will be picked up and used to install in offline mode.
2015-01-17 02:37:13 +03:00
Richo Healey
de3ea99ec5 Port indenter to python 2015-01-16 08:49:54 -08:00
Richo Healey
68372ae655 Remove unused script 2015-01-16 08:49:54 -08:00
visualfc
935b37a460 fix string multi line connector '\' for kate
example:
let m = "hello \
           world";
2015-01-14 09:45:41 +08:00
bors
3a44a19af2 auto merge of #20894 : swgillespie/rust/emacs-issue-20422, r=pnkfelix
rust-mode.el recently started highlighting keywords that were substrings of identifiers. Identifiers such as `xyz_type` would have `type` highlighted, which isn't normal. This patch re-introduces `_` as a word constituent, so that keywords following a `_` don't get syntax highlighted as keywords. Fixes issue #20422
2015-01-12 19:20:56 +00:00
Tim Brooks
4c78d28344 Remove range function 2015-01-11 14:37:24 +00:00
Tim Brooks
ed13698317 Remove old number literal suffixes from Vim syntax 2015-01-11 14:36:55 +00:00
Sean Gillespie
f82c75b0a7 Mark _ as a word constituent to avoid highlighting parts of identifiers as keywords 2015-01-09 23:58:34 -08:00
bors
2a8cb678e6 Merge pull request #20689 from huonw/editor-_size
Update editor syntax files for isize/usize.

Reviewed-by: nikomatsakis
2015-01-07 15:35:34 +00:00
Huon Wilson
6c7291ece4 Update editor syntax files for isize/usize.
Yay, syntax highlighting.
2015-01-07 20:19:58 +11:00
bors
a3a16e9610 auto merge of #20620 : brson/rust/relnotes, r=huonw
A whole lot happened this cycle. I tried to highlight the best stuff. Please review and note important stuff I'm missing or foolish mistakes.
2015-01-07 08:32:46 +00:00
Brian Anderson
93190b364b Bump some version numbers 2015-01-06 15:58:23 -08:00
Alex Crichton
e0f546a07e rollup merge of #20643: scialex/update-zsh 2015-01-06 15:25:02 -08:00
Alex Crichton
f358dbf1e7 rollup merge of #20557: cactorium/prettyprinters
As per https://github.com/rust-lang/rust/issues/20405. To be more precise, the changes just the processing of enums when the name is "RUST$ENCODED$ENUM$..." so it correctly parses when there is more than one number encoding the location of the field it's looking for to determine state of the enum
2015-01-06 15:24:52 -08:00
Alexander Light
570bda6657 update zsh rust completions 2015-01-06 12:15:41 -05:00
Alex Crichton
7975fd9cee rollup merge of #20482: kmcallister/macro-reform
Conflicts:
	src/libflate/lib.rs
	src/libstd/lib.rs
	src/libstd/macros.rs
	src/libsyntax/feature_gate.rs
	src/libsyntax/parse/parser.rs
	src/libsyntax/show_span.rs
	src/test/auxiliary/macro_crate_test.rs
	src/test/compile-fail/lint-stability.rs
	src/test/run-pass/intrinsics-math.rs
	src/test/run-pass/tcp-connect-timeouts.rs
2015-01-05 19:01:17 -08:00
Alex Crichton
4c549786fa rollup merge of #20583: csouth3/vim-syntax
The prelude has changed quite a bit since the list that Vim is aware of has been updated.  This pull request brings it up to date with `std::prelude`.
2015-01-05 18:42:06 -08:00
Keegan McAllister
c9f0ff3813 Reserve the keyword 'macro' 2015-01-05 18:21:14 -08:00
Chase Southwood
faf07b1365 Update reexports in vim syntax file 2015-01-05 12:21:47 -06:00
York Xiang
09c4e8fe96 kate syntax highlight: update keyword list 2015-01-05 15:11:54 +08:00
Kelvin Ly
22cae7e034 Pylinted and slightly better commented 2015-01-04 23:43:47 -05:00
Kelvin Ly
3d3670bc65 Added fix to LLDB formatter 2015-01-04 23:35:29 -05:00
Kelvin Ly
d009a76182 Fixed GDB pretty printer more 2015-01-04 21:39:07 -05:00
Kelvin Ly
56a5f3184d Fixed GDB pretty printer to work on enums correctly 2015-01-04 21:39:07 -05:00
bors
48c6c80795 Merge pull request #20452 from brson/rustup
Move rustup to the combined installer

Reviewed-by: brson
2015-01-04 21:36:35 +00:00
bors
0eb7da758d Merge pull request #20442 from csouth3/vim-syntax
Fix vim syntax highlighting for `derive`

Reviewed-by: alexcrichton
2015-01-04 21:36:34 +00:00
Brian Anderson
ebdf331133 Download from the combined installer 2015-01-03 15:54:37 -08:00
Brian Anderson
a7a57ca92d rustup: Long lines 2015-01-03 08:29:33 -08:00
bors
fc2ba13939 auto merge of #20456 : brson/rust/packaging2, r=alexcrichton 2015-01-03 05:35:17 +00:00
Brian Anderson
d30353c1d2 Remove .pkg and .exe installers 2015-01-02 20:44:07 -08:00
Brian Anderson
51a2feec7b rustup: Don't do verbose tarball extraction 2015-01-02 17:08:03 -08:00
Brian Anderson
83270ed546 rustup: Install from the combined installer 2015-01-02 15:15:15 -08:00
Brian Anderson
b32e0098ef Merge remote-tracking branch 'erickt/rustup' 2015-01-02 13:15:09 -08:00
Chase Southwood
c8fcbe7561 Fix vim syntax highlighting for derive 2015-01-02 15:06:13 -06:00