Commit Graph

27039 Commits

Author SHA1 Message Date
bors
87e3b5fe7f auto merge of #12441 : kud1ing/rust/backticks, r=brson
Not all of those messages are covered by tests. I am not sure how to trigger them and where to put those tests.

Also some message patterns in the existing tests are not complete.
For example, i find `error: mismatched types: expected "i32" but found "char" (expected i32 but found char)` a bit repetitive, but as i can see there is no test covering that.
2014-02-22 09:11:47 -08:00
bors
52755b717e auto merge of #12439 : cmr/rust/rustdoc-reset, r=thestinger
rustdoc: web: don't reset the search bar
2014-02-22 07:56:47 -08:00
Eduard Bopp
9982de6397 Warn about unnecessary parentheses upon assignment
Closes #12366.

Parentheses around assignment statements such as

    let mut a = (0);
    a = (1);
    a += (2);

are not necessary and therefore an unnecessary_parens warning is raised when
statements like this occur.

The warning mechanism was refactored along the way to allow for code reuse
between the routines for checking expressions and statements.

Code had to be adopted throughout the compiler and standard libraries to comply
with this modification of the lint.
2014-02-22 16:32:48 +01:00
bors
51676b21d6 auto merge of #12437 : alexcrichton/rust/travis-yml, r=brson
Travis CI provides an easy-to-use continuous integration infrastructure for
github repos to use. Travis will automatically test all PRs which are opened
against the rust repository, informing PR owners of the test results.

I believe that this will be a very convenient piece of infrastructure as we'll
be able to reduce the load on bors quite a bit. In theory all PRs opened have
had the full test suite run against them, but unfortunately this is rarely the
case (I'm a prime suspect). Travis will be able to provide easy and relatively
quick (~30min) feedback for PRs. By ensuring fewer failures on bors, we can
hopefully feed more successful jobs to bors.

Overall, I expect this to be very helpful for new contributors as well as
regular contributors as it's another layer of tests being run which will
hopefully catch things sooner. One of the most convenient parts about using
Travis is that there's very little burden in terms of maintenance, and if things
go wrong we can easily turn travis completely off.

Note that this is *not* the metric by which a PR will be merged with. Using
travis will purely be another source for running tests, we will continue to gate
all PRs on bors.
2014-02-22 06:41:48 -08:00
bors
f764d477eb auto merge of #12433 : alexcrichton/rust/fix-some-config-things, r=brson
These are mostly centered around using an external LLVM (notably 3.5)
2014-02-22 05:16:51 -08:00
bors
c48babe546 auto merge of #12427 : alexcrichton/rust/snapshots, r=brson
This contains the fix for #4252 so we can start using methods in destructors.
2014-02-22 03:21:52 -08:00
Huon Wilson
abde5ed011 mk: restore check-notidy.
tidy has some limitations (e.g. the "checked in binaries" check doesn't
and can't actually check git), and so it's useful to run tests without
running tidy occasionally.
2014-02-22 20:18:29 +11:00
bors
d22099ca44 auto merge of #12462 : kballard/rust/restore-llvm-from-12407, r=brson
PR #12407 was accidentally reverted by PR #12411. Restore the correct
version of LLVM that PR #12407 introduced.
2014-02-22 01:11:50 -08:00
Kevin Ballard
e61c7fd3e2 Restore LLVM to the correct revision
PR #12407 was accidentally reverted by PR #12411. Restore the correct
version of LLVM that PR #12407 introduced.
2014-02-21 23:59:58 -08:00
bors
068781e5aa auto merge of #12422 : alexcrichton/rust/buffered-default, r=brson
One of the most common ways to use the stdin stream is to read it line by line
for a small program. In order to facilitate this common usage pattern, this
commit changes the stdin() function to return a BufferedReader by default. A new
`stdin_raw()` method was added to get access to the raw unbuffered stream.

I have not changed the stdout or stderr methods because they are currently
unable to flush in their destructor, but #12403 should have just fixed that.
2014-02-21 23:56:47 -08:00
Brian Anderson
623e475146 test: 'ratcher' is not a word 2014-02-21 23:53:37 -08:00
Daniel Micay
4687e1d67d remove the TyDesc from TypedArena
This prevents generating visit glue when using a TypedArena. The problem
still exists for the untyped Arena.
2014-02-22 02:04:25 -05:00
Erick Tryzelaar
d223dd1e57 std: rewrite Hash to make it more generic
This patch merges IterBytes and Hash traits, which clears up the
confusion of using `#[deriving(IterBytes)]` to support hashing.
Instead, it now is much easier to use the new `#[deriving(Hash)]`
for making a type hashable with a stream hash.

Furthermore, it supports custom non-stream-based hashers, such as
if a value's hash was cached in a database.

This does not yet replace the old IterBytes-hash with this new
version.
2014-02-21 21:33:23 -08:00
bors
698042de23 auto merge of #12421 : Hywan/rust/api_doc, r=alexcrichton
I was reading the code and saw this. Not the best contribution of my life ;-).
2014-02-21 21:26:49 -08:00
Erick Tryzelaar
0135b521ad syntax: add syntax extension helper to make simple view items 2014-02-21 19:57:03 -08:00
Erick Tryzelaar
bb8721da69 syntax: Allow syntax extensions to have attributes 2014-02-21 19:57:02 -08:00
Erick Tryzelaar
87f936f193 std: minor whitespace cleanup 2014-02-21 19:57:02 -08:00
Erick Tryzelaar
8b81510481 extra: rename Uuid::to_bytes() to as_bytes() 2014-02-21 19:57:02 -08:00
bors
56cf237ee2 auto merge of #12411 : Arcterus/rust/time, r=alexcrichton
More work towards finishing #8784.
2014-02-21 19:46:51 -08:00
bors
d2f73abf10 auto merge of #12382 : bjz/rust/fmt-int, r=alexcrichton
This is PR is the beginning of a complete rewrite and ultimate removal of the `std::num::strconv` module (see #6220), and the removal of the `ToStrRadix` trait in favour of using the `std::fmt` functionality directly. This should make for a cleaner API, encourage less allocation, and make the implementation more comprehensible .

The `Formatter::{pad_integral, with_padding}` methods have also been refactored make things easier to understand.

The formatting tests for integers have been moved out of `run-pass/ifmt.rs` in order to provide more immediate feedback when building using `make check-stage2-std NO_REBUILD=1`.

Arbitrary radixes are now easier to use in format strings. For example:

~~~rust
assert_eq!(format!("{:04}", radix(3, 2)), ~"0011");
~~~

The benchmarks have been standardised between `std::num::strconv` and `std::num::fmt` to make it easier to compare the performance of the different implementations.

~~~
 type | radix | std::num::strconv      | std::num::fmt
======|=======|========================|======================
 int  | bin   | 1748 ns/iter (+/- 150) | 321 ns/iter (+/- 25)
 int  | oct   |  706 ns/iter (+/- 53)  | 179 ns/iter (+/- 22)
 int  | dec   |  640 ns/iter (+/- 59)  | 207 ns/iter (+/- 10)
 int  | hex   |  637 ns/iter (+/- 77)  | 205 ns/iter (+/- 19)
 int  | 36    |  446 ns/iter (+/- 30)  | 309 ns/iter (+/- 20)
------|-------|------------------------|----------------------
 uint | bin   | 1724 ns/iter (+/- 159) | 322 ns/iter (+/- 13)
 uint | oct   |  663 ns/iter (+/- 25)  | 175 ns/iter (+/- 7)
 uint | dec   |  613 ns/iter (+/- 30)  | 186 ns/iter (+/- 6)
 uint | hex   |  519 ns/iter (+/- 44)  | 207 ns/iter (+/- 20)
 uint | 36    |  418 ns/iter (+/- 16)  | 308 ns/iter (+/- 32)
~~~
2014-02-21 16:36:52 -08:00
Alex Crichton
e26ba3605a mk: Get "make check" passing with --disable-rpath
This involves passing through LD_LIBRARY_PATH through more places, specifically
in the compiletest, run-make, and doctest runners.
2014-02-21 16:35:05 -08:00
bors
87c7e1542c auto merge of #12362 : liigo/rust/update-rust-manual, r=alexcrichton
change `extern mod` to `extern crate`, `package id` to `crate id`, and some lines wrapping fix, etc.
2014-02-21 13:56:49 -08:00
Edward Wang
7607332805 Represent lifetimes as Names instead of Idents
Closes #7743.
2014-02-22 04:05:33 +08:00
bors
78d4bf851c auto merge of #12253 : pcwalton/rust/more-vec-ng, r=alexcrichton
r? @brson
2014-02-21 11:41:51 -08:00
Flavio Percoco
7d94de2b04 Test nested proc can access outer owned data
Fixes #10682
2014-02-21 20:40:24 +01:00
Alex Crichton
3cf0b9bd11 mk: Don't install host rlibs
You rarely want to statically link against librustc and friends, so there's no
real reason to install the rlib version of these libraries, especially because
the rlibs are massive.
2014-02-21 10:55:30 -08:00
Patrick Walton
03b791095d libstd: Implement some convenience methods on vectors 2014-02-21 10:54:14 -08:00
Alex Crichton
991d466c18 rustc: Compress bytecode files in rlibs
These are only ever used with LTO, so there's no need for reading them to be
speedy.
2014-02-21 10:54:00 -08:00
bors
b5995b4e93 auto merge of #12326 : bjz/rust/integer, r=alexcrichton
This is part of the effort to simplify `std::num`, as tracked in issue #10387.
2014-02-21 09:46:49 -08:00
Brendan Zabarauskas
6943acd1a5 Reduce reliance on to_str_radix
This is in preparation to remove the implementations of ToStrRadix in integers, and to remove the associated logic from `std::num::strconv`.

The parts that still need to be liberated are:

- `std::fmt::Formatter::runplural`
- `num::{bigint, complex, rational}`
2014-02-22 03:56:16 +11:00
Brendan Zabarauskas
e37327bfee Decouple integer formatting from std::num::strconv
This works towards a complete rewrite and ultimate removal of the `std::num::strconv` module (see #6220), and the removal of the `ToStrRadix` trait in favour of using the `std::fmt` functionality directly. This should make for a cleaner API, encourage less allocation, and make the implementation far more comprehensible.

The `Formatter::pad_integral` method has also been refactored make it easier to understand.

The formatting tests for integers have been moved out of `run-pass/ifmt.rs` in order to provide more immediate feedback when building using `make check-stage2-std NO_REBUILD=1`.

The benchmarks have been standardised between std::num::strconv and std::num::fmt to make it easier to compare the performance of the different implementations.

Arbitrary radixes are now easier to use in format strings. For example:

~~~
assert_eq!(format!("{:04}", radix(3, 2)), ~"0011");
~~~
2014-02-22 03:56:16 +11:00
Brendan Zabarauskas
9abff54d61 Add Pod trait bound to std::num::Primitive 2014-02-22 03:51:56 +11:00
bors
f8893ed5d9 auto merge of #12420 : pnkfelix/rust/fsk-improve-doc-for-ptr-offset, r=alexcrichton
ptr::RawPtr, spell out units used for the `offset` argument.

spell out units used for the `offset` argument, so that callers do not
try to scale to byte units themselves.

(this was originally landed in PR #11002 for the stand-alone functions, but that PR did not modify the `RawPtr` methods, since that had no doc at all at the time.  Now `RawPtr` has the *only* documentation for `offset`, since the stand-alone functions went away in PR #12167 / PR #12248.)
2014-02-21 08:26:50 -08:00
Arcterus
66f93291ec Move time out of extra (cc #8784) 2014-02-21 07:44:11 -08:00
bors
c6aaf2c7bd auto merge of #12419 : huonw/rust/compiler-unsafe, r=alexcrichton
Previously an `unsafe` block created by the compiler (like those in the
formatting macros) would be "ignored" if surrounded by `unsafe`, that
is, the internal unsafety would be being legitimised by the external
block:

    unsafe { println!("...") } =(expansion)=> unsafe { ... unsafe { ... } }

And the code in the inner block would be using the outer block, making
it considered used (and the inner one considered unused).

This patch forces the compiler to create a new unsafe context for
compiler generated blocks, so that their internal unsafety doesn't
escape to external blocks.

Fixes #12418.
2014-02-21 07:06:51 -08:00
Brendan Zabarauskas
3a9eca3a7b Move std::num::Integer to libnum 2014-02-22 01:45:29 +11:00
bors
2fa7d6b44f auto merge of #12415 : HeroesGrave/rust/move-enum-set, r=alexcrichton
Part of #8784

Also removed the one glob import.
2014-02-21 05:26:58 -08:00
bors
c9864cec2b auto merge of #12410 : DaGenix/rust/fix-incorrect-comment, r=alexcrichton
The comments say that the prelude imports std::io::println since it would
be annoying to have to import it in every program that uses it. However,
the prelude doesn't actually import that function anymore. So, update the
comments to better match reality.
2014-02-21 04:01:57 -08:00
Liigo Zhuang
4e9df9a656 insignificant fix to rust manual and tutorial 2014-02-21 17:48:36 +08:00
bors
37903cbf4d auto merge of #12290 : mrshu/rust/lint-warn-by-default, r=alexcrichton
This first part of my attempts to fix #11432.

In this one I only set NonCamelCaseTypes to warn by default and tried to fix errors that were reported by `make check`.

Please feel free to let me know if I missed something or didn't do it the right way.

Thanks.
2014-02-21 00:56:58 -08:00
kud1ing
766e138aa2 backticks 2014-02-21 08:26:20 +01:00
bors
ca41bbb2e3 auto merge of #12407 : alexcrichton/rust/up-llvm, r=sfackler
This updates the LLVM submodule to the `rust-llvm-2014-02-19` tag which is the
old one with https://github.com/rust-lang/llvm/pull/4 cherry-picked on top.

Awesome job by @neykov for this!
2014-02-20 23:16:57 -08:00
Corey Richardson
c9713ffe81 rustdoc: web: don't reset the search bar 2014-02-21 02:15:08 -05:00
mr.Shu
70319f7b25 Changed NonCamelCaseTypes lint to warn by default
Added allow(non_camel_case_types) to librustc where necesary

Tried to fix problems with non_camel_case_types outside rustc

fixed failing tests

Docs updated

Moved #[allow(non_camel_case_types)] a level higher.

markdown.rs reverted

Fixed timer that was failing tests

Fixed another timer
2014-02-21 08:11:52 +01:00
Alex Crichton
5bb204ffdb Add a Travis-CI configuration for the repo
Travis CI provides an easy-to-use continuous integration infrastructure for
github repos to use. Travis will automatically test all PRs which are opened
against the rust repository, informing PR owners of the test results.

I believe that this will be a very convenient piece of infrastructure as we'll
be able to reduce the load on bors quite a bit. In theory all PRs opened have
had the full test suite run against them, but unfortunately this is rarely the
case (I'm a prime suspect). Travis will be able to provide easy and relatively
quick (~30min) feedback for PRs. By ensuring fewer failures on bors, we can
hopefully feed more successful jobs to bors.

Overall, I expect this to be very helpful for new contributors as well as
regular contributors as it's another layer of tests being run which will
hopefully catch things sooner. One of the most convenient parts about using
Travis is that there's very little burden in terms of maintenance, and if things
go wrong we can easily turn travis completely off.

Note that this is *not* the metric by which a PR will be merged with. Using
travis will purely be another source for running tests, we will continue to gate
all PRs on bors.
2014-02-20 21:43:25 -08:00
Alex Crichton
ccd25e572d mk: Fix --llvm-root finding tools
LLVM's tools are not contained in the local directory if --llvm-root is used by
the ./configure script. This fixes the installation path to be the root provided
by --llvm-root.
2014-02-20 21:22:48 -08:00
Alex Crichton
e97bb92457 configure: Accept LLVM 3.5 for building rust
This is the current head of LLVM, and we can indeed build with 3.5
2014-02-20 21:22:47 -08:00
bors
d70f909fa3 auto merge of #12164 : alexcrichton/rust/rlibs-and-dylibs, r=cmr
The first commit improves error messages during linking, and the second commit improves error messages during crate-loading time.

Closes #12297
Closes #12377
2014-02-20 18:51:57 -08:00
Alex Crichton
6d79ed1915 mk: Fix --llvm-root finding tools
LLVM's tools are not contained in the local directory if --llvm-root is used by
the ./configure script. This fixes the installation path to be the root provided
by --llvm-root.
2014-02-20 18:07:33 -08:00
Alex Crichton
ea72398adf configure: Accept LLVM 3.5 for building rust
This is the current head of LLVM, and we can indeed build with 3.5
2014-02-20 18:07:08 -08:00