Commit Graph

35682 Commits

Author SHA1 Message Date
Florian Hahn
eb4b20288e Map EEXIST to PathAlreadyExists error, closes #20226 2014-12-25 22:22:44 +01:00
bors
f673e9841f auto merge of #20167 : michaelwoerister/rust/for-loop-var, r=alexcrichton
... really this time `:)`

I went for the simpler fix after all since it turned out to become a bit too complicated to extract the current iteration value from its containing `Option` with the different memory layouts it can have. It's also what we already do for match bindings.

I also extended the new test case to include the "simple identifier" case.

Fixes #20127, fixes #19732
2014-12-25 14:21:47 +00:00
bors
ead198c513 auto merge of #20024 : mneumann/rust/dragonfly-fixes3, r=alexcrichton 2014-12-25 05:11:36 +00:00
bors
65248c5e05 auto merge of #19934 : tomjakubowski/rust/rustdoc-unboxed-closures-redux, r=alexcrichton
We render HRTB and the unboxed closure trait sugar (the so-called 
"parenthesized" notation) where appropriate. Also address the new
`for` syntax on the old closures.
2014-12-25 01:01:42 +00:00
bors
7e11b22713 auto merge of #20117 : lfairy/rust/rename-include-bin, r=alexcrichton
According to [RFC 344][], methods that return `&[u8]` should have names ending in `bytes`. Though `include_bin!` is a macro not a method, it seems reasonable to follow the convention anyway.

We keep the old name around for now, but trigger a deprecation warning when it is used.

[RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md

[breaking-change]
2014-12-24 20:47:12 +00:00
bors
14597f980a auto merge of #19813 : barosl/rust/autoderef-type-inference-ice, r=pnkfelix
`check::autoderef()` returns a `ty_err` when it fails to infer the type. `probe::probe()` should respect this failure and fail together to prevent further corruption.

Fixes #19692.
Fixes #19583.
Fixes #19297.
2014-12-24 18:37:07 +00:00
Tom Jakubowski
64b5464f30 rustdoc: Use Fn trait sugar for external paths
Fix #19909
2014-12-24 11:18:27 -06:00
Tom Jakubowski
c639cf6ee9 rustdoc: Use unboxed closure sugar
This unfortunately leaves sugaring Fn/FnMut/FnOnce on cross-crate
re-exports for future work.

cc #19909
2014-12-24 11:18:27 -06:00
Tom Jakubowski
37225288be rustdoc: render higher-rank trait bounds
Fix #19915
2014-12-24 11:18:27 -06:00
Tom Jakubowski
b39e99cfc7 rustdoc: render for<> on old closure lifetimes 2014-12-24 10:32:49 -06:00
bors
29ad8539b9 auto merge of #20060 : Aatch/rust/enum-repr, r=alexcrichton
The previous behaviour of using the smallest type possible caused LLVM
to treat padding too conservatively, causing poor codegen. This commit
changes the behaviour to use an alignment-sized integer as the
discriminant. This keeps types the same size, but helps LLVM understand
the data structure a little better, resulting in better codegen.
2014-12-24 16:21:23 +00:00
bors
e64a8193b0 auto merge of #19858 : nick29581/rust/ranges, r=aturon
Closes #19794

r? @aturon for the first patch
r? @nikomatsakis for the rest
2014-12-24 06:31:13 +00:00
bors
96a3c7c6a0 auto merge of #19758 : tbu-/rust/pr_fp_name, r=alexcrichton
This is a [breaking-change].
2014-12-23 22:21:10 +00:00
Nick Cameron
e82215d4e2 Review changes 2014-12-24 09:24:59 +13:00
Nick Cameron
e840e49b21 Tests 2014-12-24 09:12:46 +13:00
Nick Cameron
17826e10a2 Type checking and trans for ranges 2014-12-24 09:12:45 +13:00
Nick Cameron
8a357e1d87 Add syntax for ranges 2014-12-24 09:12:45 +13:00
Nick Cameron
53c5fcb99f Add lang items for ranges. 2014-12-24 09:12:45 +13:00
Nick Cameron
21ea66f47a Add structs for ranges to core::ops. 2014-12-24 09:12:45 +13:00
bors
d10642ef0f auto merge of #20083 : eddyb/rust/fix-expectation, r=nikomatsakis
This fixes a few corner cases with expected type propagation, e.g.:
```rust
fn take_int_slice(_: &[int]) {}
take_int_slice(&if 1 < 0 { [ 0, 1 ] } else { [ 0, 1 ] });
```
```rust
<anon>:2:28: 2:36 error: mismatched types: expected `[int]`, found `[int, ..2]`
<anon>:2 take_int_slice(&if 1 < 0 { [ 0, 1 ] } else { [ 0, 1 ] });
                                    ^~~~~~~~
<anon>:2:46: 2:54 error: mismatched types: expected `[int]`, found `[int, ..2]`
<anon>:2 take_int_slice(&if 1 < 0 { [ 0, 1 ] } else { [ 0, 1 ] });
                                                      ^~~~~~~~
```
Right now we unpack the expected `&[int]` and pass down `[int]`, forcing
rvalue expressions to take unsized types, which causes mismatch errors.
Instead, I replaced that expectation with a weaker hint, for the unsized
cases - a hint is still required to infer the integer literals' types, above.

Fixes #20169.
2014-12-23 18:01:22 +00:00
Tobias Bucher
16f01cc13f Rename and namespace FPCategory
Rename `FPCategory` to `FpCategory` and `Fp* to `*` in order to adhere to the
naming convention

This is a [breaking-change].

Existing code like this:
```
use std::num::{FPCategory, FPNaN};
```
should be adjusted to this:
```
use std::num::FpCategory as Fp
```

In the following code you can use the constants `Fp::Nan`, `Fp::Normal`, etc.
2014-12-23 13:42:09 +01:00
Eduard Burtescu
adabf4e63d rustc_typeck: don't expect rvalues to have unsized types. 2014-12-23 13:30:36 +02:00
Michael Woerister
875a30c492 debuginfo: Add test case for destructured for-loop variable. 2014-12-23 11:07:32 +01:00
Michael Woerister
07f10310c0 debuginfo: Clean the debuginfo module up a bit. 2014-12-23 10:45:29 +01:00
Michael Woerister
6f88258f1d debuginfo: Create debuginfo for for-loop variables again. 2014-12-23 10:45:16 +01:00
bors
658529467d Merge pull request #20155 from tbu-/pr_vecmap_fiximpls
Fix `collections::VecMap`'s `PartialEq` implementation

Reviewed-by: Gankro
2014-12-23 09:31:26 +00:00
bors
3f8d94e5a0 Merge pull request #20153 from brianloveswords/patch-1
Update complement-bugreport.md

Reviewed-by: alexcrichton
2014-12-23 09:31:26 +00:00
bors
7cf470b6da Merge pull request #20001 from huonw/speeling2
Fix some spelling errors.

Reviewed-by: nick29581
2014-12-23 09:31:25 +00:00
bors
e751038bfd Merge pull request #19886 from brson/rustup
rustup: Don't do verbose tarball extraction

Reviewed-by: alexcrichton
2014-12-23 09:31:25 +00:00
Chris Wong
85c1a4b1ba Rename include_bin! to include_bytes!
According to [RFC 344][], methods that return `&[u8]` should have names
ending in `bytes`. Though `include_bin!` is a macro not a method, it
seems reasonable to follow the convention anyway.

We keep the old name around for now, but trigger a deprecation warning
when it is used.

[RFC 344]: https://github.com/rust-lang/rfcs/blob/master/text/0344-conventions-galore.md

[breaking-change]
2014-12-23 22:06:32 +13:00
James Miller
b473311ad8 Make alignment-forcing case work the same on 64 and 32-bit platforms 2014-12-23 20:44:06 +13:00
Huon Wilson
832c3e3cd7 Fix some spelling errors. 2014-12-23 16:13:15 +11:00
bors
62fb41c32b auto merge of #20145 : alexcrichton/rust/rollup, r=alexcrichton 2014-12-23 02:41:48 +00:00
Tobias Bucher
d62cf317aa Fix collections::VecMap's PartialEq implementation
Previously it took capacity into account.

Additionally remove the `ne` implementation of `RingBuf` which is the default
one anyway.
2014-12-23 01:50:54 +01:00
Brian J Brennan
d3d39b2f0a Update complement-bugreport.md
`--version=verbose` doesn't exist anymore, `--version --verbose` is the way to do that now.
2014-12-22 19:43:57 -05:00
James Miller
fe7adfe631 Add enum size cases to type-sizes test 2014-12-23 12:31:13 +13:00
James Miller
f1a3ff047e Use type-alignment-sized integer for discriminant types
The previous behaviour of using the smallest type possible caused LLVM
to treat padding too conservatively, causing poor codegen. This commit
changes the behaviour to use an type-alignment-sized integer as the
discriminant. This keeps types the same size, but helps LLVM understand
the data structure a little better, resulting in better codegen.
2014-12-23 12:29:52 +13:00
Alex Crichton
3583d613b9 Test fixes and rebase conflicts 2014-12-22 15:17:26 -08:00
Alex Crichton
8824c39945 rollup merge of #20089: rolftimmermans/json-control-chars-escape
Conflicts:
	src/libserialize/json.rs
2014-12-22 15:17:22 -08:00
Alex Crichton
0a07db438b rollup merge of #19964: pnkfelix/everybody-loops-pprint
Conflicts:
	src/librustc/session/config.rs
	src/librustc_driver/lib.rs
	src/librustc_driver/pretty.rs
2014-12-22 12:53:23 -08:00
Alex Crichton
de11710d80 rollup merge of #19891: nikomatsakis/unique-fn-types-3
Conflicts:
	src/libcore/str.rs
	src/librustc_trans/trans/closure.rs
	src/librustc_typeck/collect.rs
	src/libstd/path/posix.rs
	src/libstd/path/windows.rs
2014-12-22 12:51:23 -08:00
Alex Crichton
459f3b2cfa rollup merge of #20056: MrFloya/iter_rename
Conflicts:
	src/libcollections/bit.rs
	src/libcore/str.rs
2014-12-22 12:49:57 -08:00
Alex Crichton
6938d51122 rollup merge of #20141: frewsxcv/rfc438
RFC 248? I think you meant RFC 438.

There ain’t an RFC 248, while 438 looks to be what is being referred to:
https://github.com/rust-lang/rfcs/blob/master/text/0438-precedence-of-plus.md

--------------

Chis Morgan has a pretty important documentation fix in #19385 and he hasn't responded in a while to that pull request so I rebased it for him

Closes #19385
2014-12-22 12:48:19 -08:00
Alex Crichton
fac17defcb rollup merge of #20140: frewsxcv/rm-reexports
Part of #19253

I would have removed this public reexport in #19842, but #19812 hadn't merged (and snapshotted) at the time

In #19407, I changed the codebase to stop utilizing this reexport

[breaking-change]
2014-12-22 12:48:16 -08:00
Alex Crichton
ca441df82a rollup merge of #20135: selaine/less-asm
r? @alexcrichton
2014-12-22 12:48:13 -08:00
Alex Crichton
e5800dd454 rollup merge of #20134: jbranchaud/add-doctest-for-btreemap-entry
This is an updated version of #19711. The merge and subsequent rebase on that branch were more trouble than they were worth, so I am just resubmitting the relevant change here.

If this PR is accepted, then #19711 can be closed.

/cc @Gankro
2014-12-22 12:48:12 -08:00
Alex Crichton
48d1bb3602 rollup merge of #20129: nagisa/man-fixes
This pull request updates the rustc manual page to represent current state of rustc option handling better. Moved the apparently deprecated options (#19900) to their own section and added all the new codegen options.

A bit unrelatedly, I also updated description of `-O` and `-g` flags to point to the new codegen options rather than old, deprecated ones.

Fixes #20111.
2014-12-22 12:48:10 -08:00
Alex Crichton
2cc9baccc7 rollup merge of #20125: csouth3/hashset-bitops
Now that #19448 has landed in a snapshot, we can add proper by-value operator overloads for `HashSet`.  The behavior of these operator overloads is consistent with rust-lang/rfcs#235.
2014-12-22 12:48:09 -08:00
Alex Crichton
55cf032f43 rollup merge of #20124: klutzy/pprust-asm 2014-12-22 12:48:07 -08:00
Alex Crichton
941361b395 rollup merge of #20102: tshepang/patch-4
That sentence made it look like there was no option for using 'mut'
2014-12-22 12:47:52 -08:00