Commit Graph

46078 Commits

Author SHA1 Message Date
Björn Steinbrink
6e60fdba17 Remove unnecessary temporaries from compare_values() 2015-08-25 18:36:10 +02: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
Barosl Lee
71f39c1a2f Respect --color when printing early errors
Currently, `early_error` and `early_warn` in `librustc::session` always
use `ColorConfig::Auto`. Modify them to follow the color configuration
set by the `--color` option.

As colored output is also printed during the early stage, parsing the
`--color` option should be done as early as possible. However, there are
still some cases when the output needs to be colored before knowing the
exact color settings. In these cases, it will be defaulted to
`ColorConfig::Auto`, which is the same as before.

Fixes #27879.
2015-08-25 18:08:57 +09: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
Cesar Eduardo Barros
ff81920f03 Implement read_exact for the Read trait
This implements the proposed "read_exact" RFC
(https://github.com/rust-lang/rfcs/pull/980).
2015-08-24 19:10:08 -03:00
Chris Morgan
81c1d142d3 Simplify String’s Extend<&str> implementation
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 07:47:42 +10:00
Björn Steinbrink
5d9c250fe4 Use StructGEP instead of GEPi where appropriate
StructGEP seems clearer and probably does an even better job of the
micro-optimization that we have in GEPi.
2015-08-24 23:39:56 +02:00
Björn Steinbrink
110a34cd84 Use get_dataptr() and get_meta() where appropriate 2015-08-24 23:39:56 +02:00
Björn Steinbrink
d80ff126bf Rename get_len() to get_meta()
The functions is useful for all kinds of fat pointers, but get_len()
just feels so wrong for trait object fat pointers. Let's use get_meta()
because that's rather neutral.
2015-08-24 23:39:43 +02:00
Corey Farwell
1629dce494 Use correct indefinite article in reference.md 2015-08-24 17:26:26 -04:00
Guillaume Gomez
528d99c014 Add test for LookupHost iterator Send/Sync traits 2015-08-24 23:14:56 +02:00
Ariel Ben-Yehuda
06563fe0b7 fix other test 2015-08-24 23:41:02 +03:00
bors
4c996499a1 Auto merge of #27239 - apasel422:issue-19102, r=huonw
closes #19102
2015-08-24 18:43:41 +00:00
Ariel Ben-Yehuda
1e507d4450 address nits 2015-08-24 21:30:39 +03:00
Eljay
efc98fab26 Update hoedown to latest version (3.0.4). 2015-08-24 19:21:08 +01:00
Matěj Grabovský
82bed0a760 Clarify a sentence in the Book 2015-08-24 20:14:39 +02:00
Tobias Bucher
6de7f609dd Atomically open files with O_CLOEXEC where possible
On Linux the flag is just ignored if it is not supported:
https://lwn.net/Articles/588444/

Touches #24237.
2015-08-24 20:02:09 +02:00
Ariel Ben-Yehuda
581e5ee45e fix test 2015-08-24 20:46:53 +03:00
Ariel Ben-Yehuda
65e9bc0c93 store the CodeExtent directly in FreeRegion
this makes the code cleaner
2015-08-24 20:46:52 +03:00
Ariel Ben-Yehuda
fc304384e6 Use a Vec instead of an HashMap for the scope hierarchy
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.
2015-08-24 20:24:38 +03:00
Ariel Ben-Yehuda
2bcc6d8ec7 Use a u32 instead of a usize in CodeExtent
This reduces the size of CodeExtent to 12 bytes (was 24). We should have
a warning for this kind of problem.
2015-08-24 20:10:25 +03:00
Ariel Ben-Yehuda
316510f5e2 split ReInfer into ReVar and ReSkolemized
this should reduce the size of ty::Region to 24 bytes (from 32),
and they are treated differently in most cases anyway.
2015-08-24 20:10:25 +03:00
bors
b74ec4c847 Auto merge of #27976 - sfackler:addrparseerror-error, r=alexcrichton
Closes #27973
2015-08-24 16:00:42 +00:00
Steven Fackler
f266f12f30 Add stability markers for new impls 2015-08-24 08:59:45 -07:00
Andrea Canciani
152c76ef0d Minimize the implementation of Rem in libcore
The implementation of the remainder operation belongs to
librustc_trans, but it is also stubbed out in libcore in order to
expose it as a trait on primitive types. Instead of exposing some
implementation details (like the upcast to `f64` in MSVC), use a
minimal implementation just like that of the `Div` trait.
2015-08-24 17:47:01 +02:00
bors
797d0ba59c Auto merge of #27857 - Manishearth:improve-fnkind, r=pnkfelix
Since enums are namespaced now, should we also remove the `Fk` prefixes from `FnKind` and remove the reexport? (The reexport must be removed because otherwise it clashes with glob imports containing `ItemFn`). IMO writing `FnKind::Method` is much clearer than `FkMethod`.
2015-08-24 12:47:57 +00:00
bors
db67cbe43d Auto merge of #27856 - nikomatsakis:move-def-id-to-rustc, r=eddyb
It doesn't really make sense for DefId to be in libsyntax -- it is concerned with a single crate only. It is the compiler that understands the idea of many crates. (At some point, there might be a useful intermediate point here.) This is a refactoring in support of incr. compilation, which will be adjusting the notion of a DefId to make it more durable across compilations.

This will probably be a [breaking-change] for every plugin ever. You need to adjust things as follows:

    use rustc::middle::def_id::{DefId, LOCAL_CRATE}; // two most common definitions
    ast_util::is_local(def_id) => def_id.is_local()
    ast_util::local_def(node_id) => DefId::local(node_id)
2015-08-24 10:03:48 +00:00