Commit Graph

45115 Commits

Author SHA1 Message Date
Eli Friedman
21b514ff30 In improper-ctypes lint, handle functions which explicitly return ().
Fixes issue #27302.
2015-07-26 19:21:53 -07:00
Alexis Beingessner
8c7111da07 fixup atomics 2015-07-26 18:19:50 -07:00
Alexis Beingessner
36a8b94464 expand lifetime splitting to show IterMut is totally safe 2015-07-26 18:12:36 -07:00
bors
922aef0359 Auto merge of #27311 - kballard:thread-mod-desc-remove-scoped, r=huonw
It's deprecated and unsafe, so we shouldn't be encouraging people to use
it. Move it to `std:🧵:scoped` instead, since it's still useful
information to anyone who is using the API.
2015-07-27 01:10:32 +00:00
bors
6d288192d9 Auto merge of #27294 - eddyb:deep-unsize-hinting, r=nrc
`Rc::new(RefCell::new(x)): Rc<RefCell<Trait>>` should not mean `RefCell::new(x): RefCell<Trait>`.
The latter is impossible, as an rvalue can't have an unsized type.
We were already handling unsized argument hints, but not when dealing with unsized structures.
2015-07-26 23:35:38 +00:00
Kevin Ballard
11c22180a7 Remove the module-level documentation for thread::scoped
It's deprecated and unsafe, so we shouldn't be encouraging people to use
it. Move it to `std:🧵:scoped` instead, since it's still useful
information to anyone who is using the API.
2015-07-26 15:37:25 -07:00
bors
6d36798c89 Auto merge of #27267 - tamird:fix-ios-improper-ctypes, r=alexcrichton
Fixes #27263.
2015-07-26 22:00:53 +00:00
Akos Kiss
286b337de4 Fix getrandom syscall number for aarch64-unknown-linux-gnu 2015-07-26 23:46:26 +02:00
Eduard Burtescu
c46f913244 typeck: handle unsized structs in type hints by recursing into their last field. 2015-07-27 00:31:08 +03:00
Steven Stewart-Gallus
f3bfbda665 Standardize on non-zero checks for configure 2015-07-26 14:18:30 -07:00
bors
6232f958cd Auto merge of #27012 - pornel:master, r=Gankro
Fixes #26689

This PR tries to clarify uses of "character" where it means "code point" or "UTF-8 sequence", which are almost, but not quite the same. Edge cases added to some examples to demonstrate this.

However, I've kept use of the term "code point" instead of "Unicode scalar value", because in UTF-8 they're the same, and "code point" is more widely known.
2015-07-26 20:18:39 +00:00
bors
cf7e825ecd Auto merge of #27272 - eefriedman:closure-const-crash, r=nikomatsakis
Fixes issue #27268.

r? @nikomatsakis
2015-07-26 17:51:30 +00:00
Alex Crichton
316e1b0d41 Revert "trans: Be a little more picky about dllimport"
This reverts commit a0efd3a3d9.
2015-07-26 10:19:11 -07:00
bors
a42e21d66e Auto merge of #27297 - mitaa:cleanup_E0005, r=alexcrichton
This does two things:
* removes ast::LocalSource, where only one variant was used because for-loop expansion has changed. One reason that this slipped into here is because the code in `check_local` which checks for `LocalSource::LocalFor` would report the same error as in `check_exhaustive` while using the wrong error code (E0005 instead of E0297).
* silences the warning about already used diagnostic code E0005 (fixes #27279)

passes `make check` locally.
2015-07-26 15:17:24 +00:00
bors
a5c12f4e39 Auto merge of #26870 - jroesch:default-typaram-fallback, r=nikomatsakis
This PR completes [RFC 213](https://github.com/rust-lang/rfcs/blob/master/text/0213-defaulted-type-params.md) by allowing default type parameters to influence inference. This is almost certainly a breaking change due to interactions between default type parameters and the old fallback algorithm used for integral and floating point literals.

The error messages still require polish but I wanted to get early review and feedback from others on the the changes, error messages, and test cases. I also imagine we will want to run anywhere from 1-3 versions of this on crater and evaluate the impact, and it would be best to get that ball rolling. 

The only outstanding issue I'm aware of is that type alias defaults don't work. It seems this may require significant restructuring, since during inference type aliases have already been expanded. @nikomatsakis might be able to provide some clarity here.

r? @nikomatsakis 

cc @eddyb @Gankro @aturon @brson
2015-07-26 10:39:18 +00:00
Ariel Ben-Yehuda
e99b53e1c1 use a HashSet instead of a Vec for breadcrumbs 2015-07-26 11:36:03 +03:00
bors
9a196aa173 Auto merge of #27283 - arielb1:free-self-2, r=eddyb
Fixes #27281

r? @eddyb
2015-07-26 07:58:43 +00:00
mitaa
19512be113 Sidestep warning about repeated E0005 span_err! invocation.
Fixes #27279
2015-07-26 09:56:28 +02:00
mitaa
adfdbc4bd7 Remove ast::LocalSource with only one used variant
`LocalSource` indicated wether a let binding originated from for-loop desugaring to enable specialized error messages, but for-loop expansion has changed and this is now achieved through `MatchSource::ForLoopDesugar`.
2015-07-26 08:56:29 +02:00
Jared Roesch
5ad36cb887 Add omitted trailing comma 2015-07-25 21:22:38 -07:00
Jared Roesch
8ea9672f82 Address nit 2015-07-25 20:05:42 -07:00
Jared Roesch
55621b6199 Add feature gate 2015-07-25 20:05:42 -07:00
Jared Roesch
9da04b2bd1 Make default error reporting deterministic 2015-07-25 19:57:59 -07:00
Jared Roesch
d732f7323b Add cross-crate error message tests 2015-07-25 19:57:59 -07:00
Jared Roesch
77165415b7 Address tidy 2015-07-25 19:57:59 -07:00
Jared Roesch
99a12933fb Rework cross crate error messages 2015-07-25 19:57:59 -07:00
Jared Roesch
ed3fbba797 Fix error message spans 2015-07-25 19:57:59 -07:00
Jared Roesch
fbfbdd7d14 Correctly subst defaults with the in-scope substs 2015-07-25 19:57:58 -07:00
Jared Roesch
b75f215e82 Remove second transaction 2015-07-25 19:57:58 -07:00
Jared Roesch
ee43920410 Rebase fixes 2015-07-25 19:57:58 -07:00
Jared Roesch
e85787102f Clean up test cases 2015-07-25 19:57:58 -07:00
Jared Roesch
01dcb3bdf0 Refactor the default type parameter algorithm
The algorithm was not correctly detecting conflicts after moving
defaults into TypeVariableValue. The updated algorithm
correctly detects and reports conflicts with information about
where the conflict occured and which items the defaults were
introduced by. The span's for said items are not being correctly
attached and still need to be patched.
2015-07-25 19:57:58 -07:00
Jared Roesch
d782e35c30 Fix bug with defaults not being restored 2015-07-25 19:57:58 -07:00
Jared Roesch
49eb2c6763 Remove defaults table and attach defaults directly to tyvars 2015-07-25 19:57:58 -07:00
Jared Roesch
bbdca2c8ad Correctly collect defaults from type alises in astconv 2015-07-25 19:57:57 -07:00
Jared Roesch
91de8e6c28 Fix tidy 2015-07-25 19:57:57 -07:00
Jared Roesch
bbcb13da88 Implement Default TyParam fallback
This patch allows type parameter defaults to influence type inference. This is a possible breaking change since it effects the way type inference works and will have different behavior when mixing defaults and literal fallback.
2015-07-25 19:57:57 -07:00
Leif Arne Storset
95c7f306c7 Mention pub for structs and fields 2015-07-25 21:20:27 +02:00
Leif Arne Storset
7bec320e6e Default methods example: Show "(in)valid" case
Instead of bar/baz, use valid/invalid as default methods. This
illustrates why you might want default methods, and shows that you can
call other trait methods from a default method.
2015-07-25 20:53:57 +02:00
Ariel Ben-Yehuda
11aa8756c1 Substitute free lifetimes in Self::T
Fixes #27281
2015-07-25 21:25:51 +03:00
bors
7276d8b761 Auto merge of #27258 - nikomatsakis:issue-26952, r=eddyb
Correct regression in type-inference caused by failing to reconfirm that
the object trait matches the required trait during trait selection.  The
existing code was checking that the object trait WOULD match (in a
probe), but never executing the match outside of a probe.

This corrects various regressions observed in the wild, including
issue #26952. Fixes #26952.

r? @eddyb 
cc @frankmcsherry
2015-07-25 18:16:51 +00:00
Kornel Lesiński
c20e3fc1e4 Document Unicode complications in chars iterator 2015-07-25 16:01:48 +01:00
bors
e333e6a0dc Auto merge of #26630 - eefriedman:recursive-static, r=pnkfelix
***Edit: Fixed now.*** I'm pretty sure the way I'm using LLVMReplaceAllUsesWith here is
unsafe... but before I figure out how to fix that, I'd like a
reality-check: is this actually useful?
2015-07-25 14:50:13 +00:00
bors
04badd6a97 Auto merge of #27253 - bossmc:unbalanced-delimiters-cause-ice, r=nikomatsakis
This introduces a test for #23389 and improves the error behaviour to treat the malformed LHS as an error, not a compiler bug.

The parse phase that precedes the call to `check_lhs_nt_follows` could possibly be enhanced to police the format itself (which the old code suggests was the original intention), but I'm not sure that's any nicer than just parsing the matcher as generic rust code and then policing the specific requirements for being a macro matcher afterwards (as this does).

Fixes #23389
2015-07-25 11:20:15 +00:00
Ulrik Sverdrup
27c44ce9c3 siphash: Reorder hash state in the struct
If they are ordered v0, v2, v1, v3, the compiler can find just a few
simd optimizations itself.

The new optimization I could observe on x86-64 was using 128 bit
registers for the v = key ^ constant operations in new / reset.
2015-07-25 12:26:18 +02:00
Ulrik Sverdrup
5f6a61e165 siphash: Remove one variable
Without this temporary variable, codegen improves slightly and less
registers are spilled to the stack in SipHash::write.
2015-07-25 12:26:18 +02:00
Ulrik Sverdrup
f910d27f87 siphash: Use ptr::copy_nonoverlapping for efficient data loading
Use `ptr::copy_nonoverlapping` (aka memcpy) to load an u64 from the
byte stream. This is correct for any alignment, and the compiler will
use the appropriate instruction to load the data.

Use unchecked indexing.

This results in a large improvement of throughput (hashed bytes
/ second) for long data. Maximum improvement benches at a 70% increase
in throughput for large values (> 256 bytes) but already values of 16
bytes or larger improve.

Introducing unchecked indexing is motivated to reach as good throughput
as possible. Using ptr::copy_nonoverlapping without unchecked indexing
would land the improvement some 20-30 pct units lower.

We use a debug assertion so that the test suite checks our use of
unchecked indexing.
2015-07-25 12:26:18 +02:00
Ulrik Sverdrup
381d2ed70d siphash: Add more benchmarks 2015-07-25 12:26:17 +02:00
Jonathan Hansford
8fee56777c Commas added, as requested. 2015-07-25 10:42:46 +01:00
bors
f0b7ede78a Auto merge of #26960 - Manishearth:wrapper-types, r=steveklabnik
@steveklabnik had suggested I do this.

This needs much review -- I tried reducing the informal tone but there's room for improvement.


r? @steveklabnik
2015-07-25 07:54:48 +00:00