Commit Graph

45899 Commits

Author SHA1 Message Date
Andrew Paseltiner
f9b63d3973 implement RFC 1194 2015-08-28 12:41:54 -04:00
bors
40fd4d6787 Auto merge of #28028 - tshepang:add-size_hint-example, r=alexcrichton 2015-08-27 10:29:26 +00:00
bors
f663286f26 Auto merge of #28027 - tshepang:improve-sentence, r=alexcrichton 2015-08-27 08:51:15 +00:00
bors
d6a65cd3fe Auto merge of #27975 - sfackler:iter-order-methods, r=aturon
This does cause some breakage due to deficiencies in resolve -
`path::Components` is both an `Iterator` and implements `Eq`, `Ord`,
etc. If one calls e.g. `partial_cmp` on a `Components` and passes a
`&Components` intending to target the `PartialOrd` impl, the compiler
will select the `partial_cmp` from `Iterator` and then error out. I
doubt anyone will run into breakage from `Components` specifically, but
we should see if there are third party types that will run into issues.

`iter::order::equals` wasn't moved to `Iterator` since it's exactly the
same as `iter::order::eq` but with an `Eq` instead of `PartialEq` bound,
which doensn't seem very useful.

I also updated `le`, `gt`, etc to use `partial_cmp` which lets us drop
the extra `PartialEq` bound.

cc #27737 

r? @alexcrichton
2015-08-27 07:13:02 +00:00
Steven Fackler
651c42f11f Make iter::order functions into methods on Iterator
This does cause some breakage due to deficiencies in resolve -
`path::Components` is both an `Iterator` and implements `Eq`, `Ord`,
etc. If one calls e.g. `partial_cmp` on a `Components` and passes a
`&Components` intending to target the `PartialOrd` impl, the compiler
will select the `partial_cmp` from `Iterator` and then error out. I
doubt anyone will run into breakage from `Components` specifically, but
we should see if there are third party types that will run into issues.

`iter::order::equals` wasn't moved to `Iterator` since it's exactly the
same as `iter::order::eq` but with an `Eq` instead of `PartialEq` bound,
which doensn't seem very useful.

I also updated `le`, `gt`, etc to use `partial_cmp` which lets us drop
the extra `PartialEq` bound.

cc #27737
2015-08-26 23:23:57 -07:00
bors
0d5142f9b8 Auto merge of #28023 - jmesmon:llvm-path-native-only, r=alexcrichton
This fixes the case where we try to re-build & re-install rust to the
same prefix (without uninstalling) while using an llvm-root that is the
same as the prefix.

Without this, builds like that fail with:
	'error: multiple dylib candidates for `std` found'

See https://github.com/jmesmon/meta-rust/issues/6 for some details.

May also be related to #20342.
2015-08-27 05:35:02 +00:00
bors
ab21fe59e9 Auto merge of #28020 - dotdash:ref_fat_ptr_be_gone, r=eddyb
r? @eddyb -- we talked about this on IRC a while back but I only now managed to get the change done.
2015-08-27 03:57:21 +00:00
bors
af83d98d24 Auto merge of #28001 - arielb1:dtor-fixes, r=pnkfelix
r? @pnkfelix
2015-08-27 02:19:09 +00:00
bors
fd302a95e1 Auto merge of #27808 - SimonSapin:utf16decoder, r=alexcrichton
* Rename `Utf16Items` to `Utf16Decoder`. "Items" is meaningless.
* Generalize it to any `u16` iterator, not just `[u16].iter()`
* Make it yield `Result` instead of a custom `Utf16Item` enum that was isomorphic to `Result`. This enable using the `FromIterator for Result` impl.
* Replace `Utf16Item::to_char_lossy` with a `Utf16Decoder::lossy` iterator adaptor.

This is a [breaking change], but only for users of the unstable `rustc_unicode` crate.

I’d like this functionality to be stabilized and re-exported in `std` eventually, as the "low-level equivalent" of `String::from_utf16` and `String::from_utf16_lossy` like #27784 is the low-level equivalent of #27714.

CC @aturon, @alexcrichton
2015-08-27 00:41:13 +00:00
bors
80b971a9b8 Auto merge of #28003 - nkondratyev:patch-1, r=steveklabnik 2015-08-26 23:03:24 +00:00
Tshepang Lekhonkhobe
0ca1caee93 doc: add Iterator::size_hint example 2015-08-26 23:59:30 +02:00
Tshepang Lekhonkhobe
469620fd8e doc: I had to read this twice before understanding it 2015-08-26 23:48:45 +02:00
bors
1c3b19d69d Auto merge of #28021 - steveklabnik:gh27958, r=alexcrichton
Fixes #27958
2015-08-26 21:25:13 +00:00
bors
a48c29dcea Auto merge of #27992 - wthrowe:dead-main-2, r=alexcrichton
* Suppresses warnings that main is unused when testing (#12327)
* Makes `--test` work with explicit `#[start]` (#11766)
* Fixes some cases where the normal main would not be disabled by `--test`, resulting in compilation failures.
2015-08-26 18:29:02 +00:00
Steve Klabnik
dec43510f1 Any docs: as_ref doesn't exist anymore
Fixes #27958
2015-08-26 13:59:39 -04:00
Cody P Schafer
2d0cb31d30 mk: tell rustc that we're only looking for native libs in the LLVM_LIBDIR
This fixes the case where we try to re-build & re-install rust to the
same prefix (without uninstalling) while using an llvm-root that is the
same as the prefix.

Without this, builds like that fail with:
	'error: multiple dylib candidates for `std` found'

See https://github.com/jmesmon/meta-rust/issues/6 for some details.

May also be related to #20342.
2015-08-26 13:43:15 -04:00
Björn Steinbrink
05d36965df Avoid an extra alloca/memcpy when auto-ref'ing fat pointers
auto_ref() handles fat pointers just fine and unlike ref_fat_ptr() does so
without creating an unnecessary copy of the pointer.
2015-08-26 19:41:27 +02:00
bors
685332c8d3 Auto merge of #27998 - birkenfeld:patch-1, r=alexcrichton
These have been removed and should not be documented here.

Should the replacement crates on crates.io be linked to, or is that not wanted in the core docs?
2015-08-26 15:50:52 +00:00
bors
ef3255b063 Auto merge of #27991 - bluss:chain-rev, r=alexcrichton
Correct iterator adaptor Chain

The iterator protocol specifies that the iteration ends with the return
value `None` from `.next()` (or `.next_back()`) and it is unspecified
what further calls return. The chain adaptor must account for this in
its DoubleEndedIterator implementation.

It uses three states:

- Both `a` and `b` are valid
- Only the Front iterator (`a`) is valid
- Only the Back iterator (`b`) is valid

The fourth state (neither iterator is valid) only occurs after Chain has
returned None once, so we don't need to store this state.

Fixes #26316
2015-08-26 00:27:00 +00:00
Nikolay Kondratyev
424d9c2778 Fix docs typo 2015-08-26 05:06:00 +05:00
bors
14b7591ee5 Auto merge of #28000 - mbrubeck:reference, r=steveklabnik
See #19466 for background.  r? @steveklabnik
2015-08-25 18:58:07 +00:00
Ariel Ben-Yehuda
277eeb95c3 move destructors_for_type into AdtDef 2015-08-25 21:52:15 +03:00
Ariel Ben-Yehuda
d07ee255d0 handle dtors having generics in an order different from their ADT
Fixes #27997.
2015-08-25 20:50:30 +03:00
Ulrik Sverdrup
35eb3e8b79 Correct iterator adaptor Chain
The iterator protocol specifies that the iteration ends with the return
value `None` from `.next()` (or `.next_back()`) and it is unspecified
what further calls return. The chain adaptor must account for this in
its DoubleEndedIterator implementation.

It uses three states:

- Both `a` and `b` are valid
- Only the Front iterator (`a`) is valid
- Only the Back iterator (`b`) is valid

The fourth state (neither iterator is valid) only occurs after Chain has
returned None once, so we don't need to store this state.

Fixes #26316
2015-08-25 19:07:24 +02:00
Matt Brubeck
93616af42f Document the recursion_limit crate attribute 2015-08-25 10:02:58 -07:00
bors
b339f38fa2 Auto merge of #27995 - nagisa:windows-error-message, r=alexcrichton
According to https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).aspx:

> If the function succeeds, the return value is the number of TCHARs stored in the output buffer,
> excluding the terminating null character.

_**Completely untested**_… since I have no Windows machine or anything of a sort to test this on.

r? @aturon
2015-08-25 16:22:17 +00:00
Georg Brandl
fc7c0f99d7 collections doc: remove mention of BitVec, BitSet, VecMap
These have been removed and should not be documented here.
2015-08-25 18:20:42 +02:00
Ariel Ben-Yehuda
2f052eb0b1 use the parameter environment when checking dtors
This makes it more uniform. No functional changes.
2015-08-25 18:50:26 +03:00
Simonas Kazlauskas
c4c533a293 Do not recalculate string length in error_string
According to https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351(v=vs.85).aspx:

> If the function succeeds, the return value is the number of TCHARs stored in the output buffer,
> excluding the terminating null character.
2015-08-25 18:33:39 +03:00
bors
1806174ab4 Auto merge of #27994 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #27905, #27968, #27978, #27982, #27988
- Failed merges:
2015-08-25 14:16:22 +00:00
Steve Klabnik
c4847a11da Rollup merge of #27988 - nagisa:diags-e0139, r=brson
Fixes #27946
2015-08-25 09:43:07 -04:00
Steve Klabnik
d9de182fa5 Rollup merge of #27982 - frewsxcv:patch-25, r=steveklabnik 2015-08-25 09:43:07 -04:00
Steve Klabnik
c15d0cf270 Rollup merge of #27978 - mgrabovsky:doc-fix, r=steveklabnik 2015-08-25 09:43:07 -04:00
Steve Klabnik
f45d2b56e2 Rollup merge of #27968 - adamcrume:master, r=steveklabnik 2015-08-25 09:43:07 -04:00
Steve Klabnik
03c6b4ce84 Rollup merge of #27905 - tshepang:E0133, r=brson 2015-08-25 09:43:06 -04:00
bors
7472886233 Auto merge of #27986 - chris-morgan:reduce-string-extend-str-implementation, r=bluss
Reserving lower_bound bytes was just silly. It’d be perfectly reasonable
to have empty strings in the iterator, which could cause superfluous
reallocation of the string, or to have more than one byte per string,
which could cause additional reallocation (in practice it’ll balance
out). The added complexity of this logic is simply pointless, adding
a little bloat with no demonstrable advantage and slight disadvantage.
2015-08-25 12:31:11 +00:00
bors
5c630a61c6 Auto merge of #27981 - dotdash:gepi, r=brson 2015-08-25 10:46:06 +00:00
bors
28ef44a9e6 Auto merge of #27974 - Diggsey:issue-27952, r=alexcrichton
Fixes #27952
2015-08-25 09:04:30 +00:00
bors
e195aa84b4 Auto merge of #27971 - tbu-:pr_cloexec, r=alexcrichton
On Linux the flag is just ignored if it is not supported:
https://lwn.net/Articles/588444/

Still needs the values of O_CLOEXEC on the BSDs.

Touches #24237.
2015-08-25 07:23:18 +00:00
Adam Crume
574deb73ba book: Mention that --ignored is a test binary argument 2015-08-24 21:53:02 -07:00
Adam Crume
f56a478377 book: Fix spacing in testing section 2015-08-24 21:52:33 -07:00
bors
656c3acdeb Auto merge of #27966 - GuillaumeGomez:iterator, r=alexcrichton
Part of #22709.
cc @Veedrac

r? @bluss

I don't have added tests yet, I'll see how to do it tomorrow.
2015-08-25 04:48:19 +00:00
bors
19aadd51a8 Auto merge of #27957 - overminder:aug23-i686-android, r=alexcrichton
- All the libstd tests are passing in the optimized build against
  a Zenfone2 and the x86 Android emulator.

I haven't tested the other libraries though.
2015-08-25 03:04:30 +00:00
bors
fd7344c4fe Auto merge of #27945 - Eljay:upgrade-hoedown, r=alexcrichton
Some hoedown FFI changes:
- `HOEDOWN_EXT_NO_INTRA_EMPHASIS` constant changed.
- Updated/tidied up all callback function signatures.
- All opaque data access has an additional layer of indirection for some reason (`hoedown_renderer_data`).

This also fixes #27862.
2015-08-25 01:10:55 +00:00
William Throwe
8320a3a048 Remove #[start] as well as #[main] in --test
Fixes #11766.
2015-08-24 20:28:24 -04:00
William Throwe
0112e7bd15 Move main removal to its own pass in --test mode
This handles the case where the #[main] function is buried deeper in
the ast than we search for #[test] functions.  I'm not sure why one
would want to do that, but since it works in standard compilation it
should also work for tests.
2015-08-24 20:28:24 -04:00
William Throwe
15d6837a16 Mark main-like functions allow(dead_code) in tests
Fixes #12327.
2015-08-24 20:28:24 -04:00
William Throwe
45de9de1e9 Move entry point identification logic to libsyntax
Identifying entry points will be useful in --test mode, which is
handled in libsyntax.
2015-08-24 20:27:42 -04:00
Simonas Kazlauskas
067ad9928f Fix E0139 code
Fixes #27946
2015-08-25 01:44:18 +03:00
bors
bc3573470f Auto merge of #27943 - arielb1:fast-region, r=nikomatsakis
This increases regionck performance greatly - type-checking on
librustc decreased from 9.1s to 8.1s. Because of Amdahl's law,
total performance is improved only by about 1.5% (LLVM wizards,
this is your opportunity to shine!).

before:
576.91user 4.26system 7:42.36elapsed 125%CPU (0avgtext+0avgdata 1142192maxresident)k
after:
566.50user 4.84system 7:36.84elapsed 125%CPU (0avgtext+0avgdata 1124304maxresident)k

I am somewhat worried really need to find out why we have this Red Queen's
Race going on here. Originally I suspected it may be a problem from RFC1214's
warnings, but it seems to be an effect from other changes.

However, the increase seems to be mostly in LLVM's time, so I guess
it's the LLVM wizards' problem.

r? @nikomatsakis
2015-08-24 22:13:45 +00:00