Commit Graph

25651 Commits

Author SHA1 Message Date
Simon Sapin
bada25e425 [std::vec] Rename .pop_opt() to .pop(), drop the old .pop() behavior 2014-01-21 15:48:47 -08:00
Simon Sapin
aa66b91767 [std::vec] Rename .last_opt() to .last(), drop the old .last() behavior 2014-01-21 15:48:46 -08:00
Simon Sapin
add8f9680e [std::vec] Rename .head_opt() to .head(), drop the old .head() behavior 2014-01-21 11:45:08 -08:00
Simon Sapin
d25334d63a [std::vec] Rename .get_opt() to .get() 2014-01-21 11:44:13 -08:00
bors
232d8e5605 auto merge of #11665 : alexcrichton/rust/zed-cleanup, r=brson
* Stop using hardcoded numbers that have to all get updated when something changes (inevitable errors and rebase conflicts) as well as removes some unneeded -Z options (obsoleted over time).
* Remove `std::rt::borrowck`
2014-01-21 10:06:18 -08:00
Alex Crichton
d84c3369f7 Remove no-debug-borrows from the makefiles 2014-01-21 10:02:48 -08:00
Alex Crichton
254e35c268 Capitalize debugging opts and make them u64 2014-01-21 09:23:56 -08:00
Alex Crichton
a8807771b2 Purge borrowck from libstd
This hasn't been in use since `@mut` was removed
2014-01-21 09:23:56 -08:00
Alex Crichton
57f8073b5e Remove obsoleted -Z options
* borrowck_note_pure - unused
* borrowck_note_loan - unused
* no_debug_borrows - unused
* lint_llvm - equivalent to -Z no-prepopulate-passes + --llvm-passes lint
2014-01-21 09:23:56 -08:00
Alex Crichton
eca980be57 Stop using hardcoded numbers for -Z options
Instead use a macro and generate them!
2014-01-21 09:23:54 -08:00
bors
43cffe9d71 auto merge of #11663 : huonw/rust/paren-lint, r=cmr
The parens in `if (true) {}` are not necessary, so we'll warn about them.

cc #3070 and #11432
2014-01-21 04:26:15 -08:00
Huon Wilson
39713b8295 Remove unnecessary parentheses. 2014-01-21 22:00:18 +11:00
Huon Wilson
3901228811 rustc: add lint for parens in if, while, match and return.
The parens in `if (true) {}` are not not necessary, so we'll warn about
them.
2014-01-21 21:58:48 +11:00
bors
40df5a2e9a auto merge of #11699 : alexcrichton/rust/snapshot, r=huonw
Upgrade the version to 0.10-pre
2014-01-21 01:31:30 -08:00
bors
6f3326f84d auto merge of #11687 : sfackler/rust/macro-export-inner-crate, r=alexcrichton
It previously missed anything in an inner module.
2014-01-21 00:06:22 -08:00
bors
813db08fe6 auto merge of #11684 : FlaPer87/rust/doc_typos, r=cmr 2014-01-20 22:46:20 -08:00
bors
e65a8b88ca auto merge of #11674 : indirect/rust/doc_file, r=alexcrichton
Found out about `file!` today from o11c in IRC.
2014-01-20 21:26:22 -08:00
bors
80a2306aee auto merge of #11662 : alexcrichton/rust/faster-parens, r=huonw
The included test case would essentially never finish compiling without this
patch. It recursies twice at every ExprParen meaning that the branching factor
is 2^n

The included test case will take so long to parse on the old compiler that it'll
surely never let this crop up again.
2014-01-20 20:06:23 -08:00
Alex Crichton
cb12de14c9 Register new snapshots
Upgrade the version to 0.10-pre
2014-01-20 19:45:38 -08:00
bors
62f8661084 auto merge of #11486 : Matthias247/rust/doc, r=cmr
I wrote a chapter for the FFI tutorial that describes how to perform callbacks from C code to Rust and gives some hints about what to consider and synchronization.

I just needed that for my own wrapper and thought it would be helpful for others.
2014-01-20 18:31:38 -08:00
bors
94236fc078 auto merge of #11653 : alexcrichton/rust/issue-11647, r=luqmana
Closes #11647
2014-01-20 16:56:25 -08:00
bors
b6400f9984 auto merge of #11675 : alexcrichton/rust/fix-snap, r=cmr
They need to read the metadata of cross-compiled crates, so the pretty things
need to have the right target.
2014-01-20 15:26:27 -08:00
Alex Crichton
c62ef2e807 Fix cross-compiled pretty tests
They need to read the metadata of cross-compiled crates, so the pretty things
need to have the right target.
2014-01-20 13:51:12 -08:00
Alex Crichton
1f542cd264 Fix a pathological const checking case
The included test case would essentially never finish compiling without this
patch. It recursies twice at every ExprParen meaning that the branching factor
is 2^n

The included test case will take so long to parse on the old compiler that it'll
surely never let this crop up again.
2014-01-20 13:49:31 -08:00
bors
b6f6e49a7e auto merge of #11636 : alexcrichton/rust/purge-all-the-c, r=brson
This means we can purge even more C from src/rt!
2014-01-20 13:46:24 -08:00
Alex Crichton
c6123ca105 rustuv: Re-work sockaddr glue to not use malloc
This means we can purge even more C from src/rt!
2014-01-20 13:32:45 -08:00
Alex Crichton
caa321ab7d Don't emit landing pads with -Z no-landing-pads
Closes #11647
2014-01-20 13:29:49 -08:00
Matthias Einwag
112d01a951 Disabled the tests for the new code blocks 2014-01-20 21:44:41 +01:00
bors
d4640f9d66 auto merge of #11673 : omasanori/rust/sep-doc, r=alexcrichton 2014-01-20 11:41:29 -08:00
bors
bf89b68a37 auto merge of #11664 : bjz/rust/identities, r=alexcrichton
`Zero` and `One` have precise definitions in mathematics as the identities of the `Add` and `Mul` operations respectively. As such, types that implement these identities are now also required to implement their respective operator traits. This should reduce their misuse whilst still enabling them to be used in generalized algebraic structures (not just numbers). Existing usages of `#[deriving(Zero)]` in client code could break under these new rules, but this is probably a sign that they should have been using something like `#[deriving(Default)]` in the first place.

For more information regarding the mathematical definitions of the additive and multiplicative identities, see the following Wikipedia articles:

- http://wikipedia.org/wiki/Additive_identity
- http://wikipedia.org/wiki/Multiplicative_identity

Note that for floating point numbers the laws specified in the doc comments of `Zero::zero` and `One::one` may not always hold. This is true however for many other traits currently implemented by floating point numbers. What traits floating point numbers should and should not implement is an open question that is beyond the scope of this pull request.

The implementation of `std::num::pow` has been made more succinct and no longer requires `Clone`. The coverage of the associated unit test has also been increased to test for more combinations of bases, exponents, and expected results.
2014-01-20 10:16:30 -08:00
Steven Fackler
d049c27f5b Scan the entire crate for exported macros
It previously missed anything in an inner module.
2014-01-20 09:22:46 -08:00
bors
f8efde148c auto merge of #11670 : sfackler/rust/extctxt-span-note, r=alexcrichton
It was the only span_* missing.
2014-01-20 08:41:30 -08:00
bors
02d4572696 auto merge of #11661 : huonw/rust/fixed-length-instantiation, r=thestinger
Previously, they were treated like ~[] and &[] (which can have length
0), but fixed length vectors are fixed length, i.e. we know at compile
time if it's possible to have length zero (which is only for [T, .. 0]).

Fixes #11659.
2014-01-20 06:16:29 -08:00
bors
068d828850 auto merge of #11660 : sfackler/rust/quote-unused-sp, r=huonw
The provided span isn't used in all cases (namely primitives).
2014-01-20 04:11:32 -08:00
bors
e83e5769ee auto merge of #11657 : huonw/rust/less-lang-duplication, r=cmr
We can use a secondary macro to calculate the count from the information
we're already having to pass to the lang items macro.
2014-01-20 02:31:42 -08:00
Flavio Percoco
1089bfef60 Fix documentation typos 2014-01-20 11:17:27 +01:00
bors
e594acad5f auto merge of #11656 : brson/rust/omgandroid, r=cmr 2014-01-20 01:11:35 -08:00
bors
290c29c24c auto merge of #11654 : korenchkin/rust/doc_guide-testing_format, r=cmr 2014-01-19 23:51:33 -08:00
Brendan Zabarauskas
509283d149 Improve std::num::pow implementation
The implementation has been made more succinct and no longer requires Clone. The coverage of the associated unit test has also been increased to check more combinations of bases, exponents, and expected results.
2014-01-20 18:09:46 +11:00
Brendan Zabarauskas
cf56624a4a Add operator trait constraints to std::num::{Zero, One} and document their appropriate use
Zero and One have precise definitions in mathematics. Documentation has been added to describe the appropriate uses for these traits and the laws that they should satisfy.

For more information regarding these identities, see the following wikipedia pages:

- http://wikipedia.org/wiki/Additive_identity
- http://wikipedia.org/wiki/Multiplicative_identity
2014-01-20 18:09:46 +11:00
bors
a0ecb15411 auto merge of #11652 : hdima/rust/base64-padding-newlines, r=alexcrichton
Ignore all newline characters in Base64 decoder to make it compatible with other Base64 decoders.

Most of the Base64 decoder implementations ignore all newline characters in the input string. There are some examples:

Python:

```python
>>> "
A
Q
=
=
".decode("base64")
'\x01'
```

Ruby:

```ruby
irb(main):001:0> "
A
Q
=
=
".unpack("m")
=> [""]
```

Erlang:

```erlang
1> base64:decode("
A
Q
=
=
").
<<1>>
```

Moreover some Base64 encoders append newline character at the end of the output string by default:

Python:

```python
>>> "".encode("base64")
'AQ==
'
```

Ruby:

```ruby
irb(main):001:0> [""].pack("m")
=> "AQ==
"
```

So I think it's fairly important for Rust Base64 decoder to accept Base64 inputs even with newline characters in the padding.
2014-01-19 22:31:42 -08:00
bors
764f2cb6f3 auto merge of #11649 : FlaPer87/rust/pow, r=cmr
There was an old and barely used implementation of pow, which expected
both parameters to be uint and required more traits to be implemented.
Since a new implementation for `pow` landed, I'm proposing to remove
this old impl in favor of the new one.

The benchmark shows that the new implementation is faster than the one being removed:

```
    test num::bench::bench_pow_function               ..bench:      9429 ns/iter (+/- 2055)
    test num::bench::bench_pow_with_uint_function     ...bench:     28476 ns/iter (+/- 2202)
```
2014-01-19 19:46:35 -08:00
bors
0e6455e2b8 auto merge of #10801 : musitdev/rust/jsondoc2, r=cmr
I update the example of json use to the last update of the json.rs code. I delete the old branch.
From my last request, I remove the example3 because it doesn't compile. I don't understand why and I don't have the time now to investigate.
2014-01-19 18:21:39 -08:00
bors
7c33df0dbb auto merge of #11644 : huonw/rust/less-fatality, r=cmr
This means that compilation continues for longer, and so we can see more
errors per compile. This is mildly more user-friendly because it stops
users having to run rustc n times to see n macro errors: just run it
once to see all of them.
2014-01-19 16:56:40 -08:00
bors
f7cc8a625b auto merge of #11643 : kballard/rust/path-root-path, r=erickt 2014-01-19 15:31:57 -08:00
Andre Arko
ec2b8c59a7 document file! 2014-01-19 15:15:57 -08:00
OGINO Masanori
6b18ef5358 Fix misuse of character/byte in std::path.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-01-20 07:42:28 +09:00
bors
18061e85b7 auto merge of #11642 : erickt/rust/path, r=huonw
This pull request exposes a platform independent way to get the path separator. This is useful when building complicated paths by hand.
2014-01-19 13:11:37 -08:00
Steven Fackler
88d0c182b7 Add span_note to ExtCtxt
It was the only span_* missing.
2014-01-19 11:25:11 -08:00
bors
5512fb49a0 auto merge of #11639 : sfackler/rust/macro-crate-path, r=alexcrichton
If the library is in the working directory, its path won't have a "/"
which will cause dlopen to search /usr/lib etc. It turns out that Path
auto-normalizes during joins so Path::new(".").join(path) is actually a
no-op.
2014-01-19 05:56:35 -08:00