Commit Graph

49003 Commits

Author SHA1 Message Date
Scott Olson
78526fcfd1 Add test for MIR range matching. 2015-12-30 10:39:27 -06:00
Scott Olson
8a834097cc Use built-in comparisons for range matching in MIR.
The previous version using `PartialOrd::le` was broken since it passed `T`
arguments where `&T` was expected.

It makes sense to use primitive comparisons since range patterns can only be
used with chars and numeric types.
2015-12-30 10:25:41 -06:00
bors
6e2a64b57a Auto merge of #29974 - brson:gold, r=alexcrichton
When using `cc` for linking rustc will, if gold is available (by looking for `/usr/bin/ld.gold`), pass `-fuse-ld=gold` to `cc`.

In some scenarios gold links much faster than ld. Servo uses it to considerably speed up linking. gold behaves nearly identically to ld (though I think there are rare corner cases that don't work still). I've run this through crater and everything there continues to link.

To disable, pass `-C disable-gold`.
2015-12-30 01:07:19 +00:00
bors
c1035b3522 Auto merge of #30619 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #30253, #30390, #30405, #30549, #30603, #30610
- Failed merges:
2015-12-29 22:21:57 +00:00
Steve Klabnik
5a02d2293a Rollup merge of #30610 - steveklabnik:gh30600, r=sfackler
Also, make its panic description identical in wording to assert_eq.

Fixes #30600
2015-12-29 15:55:09 -05:00
Steve Klabnik
9ef4030692 Rollup merge of #30603 - cmr:extern-failure-error-message, r=Manishearth
@ubsan brought up this relatively poor error message. This adds a
help message hinting when the problem actually is, and how to fix
it.
2015-12-29 15:55:09 -05:00
Steve Klabnik
bfa36c9ab8 Rollup merge of #30549 - mitaa:doc_dstruct, r=brson
(reported in #30477)
2015-12-29 15:55:09 -05:00
Steve Klabnik
ccaa7e5146 Rollup merge of #30405 - durka:patch-12, r=steveklabnik
Fixes #30217.
2015-12-29 15:55:09 -05:00
Steve Klabnik
2493fbf547 Rollup merge of #30390 - mitaa:patch-1, r=steveklabnik
None of my devices/browsers renders this correctly.

r? @steveklabnik
2015-12-29 15:55:08 -05:00
Steve Klabnik
8e127ee626 Rollup merge of #30253 - Manishearth:diag-401-improve, r=steveklabnik
r? @steveklabnik
2015-12-29 15:55:08 -05:00
Steve Klabnik
d6275b3591 Correct the documentation of debug_assert_eq
Also, make its panic description identical in wording to assert_eq.

Fixes #30600
2015-12-29 11:01:35 -05:00
Corey Richardson
992feab697
Add a hint when given --extern with an indeterminate type
@ubsan brought up this relatively poor error message. This adds a
help message hinting when the problem actually is, and how to fix
it.
2015-12-29 00:25:37 -05:00
bors
9007d63f24 Auto merge of #30548 - mmcco:linux-syscall, r=brson
There's no need for us to redeclare it in an extern block.

We should probably put the syscall number constants in libc too.
2015-12-28 20:11:34 +00:00
Brian Anderson
34dc0e0739 Link with ld.gold by default
To disable, pass `-C disable-gold`
2015-12-28 18:08:16 +00:00
bors
27a1834ce5 Auto merge of #30588 - nagisa:mir-unit-enums-again, r=eddyb
A dumb mistake on my part from previous PR fixing unit enums in MIR.
2015-12-28 14:32:09 +00:00
Simonas Kazlauskas
e7cab13037 [MIR] Fix setting discriminant for unit enums 2015-12-28 15:48:01 +02:00
bors
89753077fc Auto merge of #30570 - fhartwig:dead-doc-links, r=steveklabnik
r? @steveklabnik
2015-12-28 09:55:45 +00:00
bors
3989f655e0 Auto merge of #30547 - mmcco:cfg, r=sanxiyn 2015-12-28 06:07:34 +00:00
bors
0e9f6ecd0e Auto merge of #30579 - dotdash:30478, r=arielb1
`auto_ref()` currently returns an Rvalue datum for the ref'd value,
which is fine for thin pointers, but for fat pointers this means that
once the pointer is moved out of that datum, its memory will be marked
as dead. And because there is not necessarily an intermediate temporary
involved we can end up marking memory as dead that is actually still
used.

As I don't want to break the micro-optimization for thin pointers by
always returning an Lvalue datum, I decided to only do so for fat
pointers.

Fix #30478
2015-12-28 02:29:14 +00:00
bors
b4707ebca3 Auto merge of #30582 - arielb1:self-test, r=eddyb
the old code was *so terrible*.

r? @eddyb
2015-12-27 23:26:18 +00:00
Ariel Ben-Yehuda
c00b5dc70a remove hack in region inference
I forgot about it in the previous commit
2015-12-28 01:21:25 +02:00
Ariel Ben-Yehuda
efc45758fd rewrite the method-receiver matching code
the old code was *so terrible*.
2015-12-28 00:52:37 +02:00
bors
ded10f4313 Auto merge of #30575 - jswalden:error-handling-typo, r=apasel422
Didn't build/test the change, but if that one-character fix isn't correct, I'll eat my hat.  :-)  Found this reading the book over the last week or two since Mozlando -- much enjoying the book so far.
2015-12-27 19:50:09 +00:00
Björn Steinbrink
575f690b39 Fix auto_ref() for fat pointers
`auto_ref()` currently returns an Rvalue datum for the ref'd value,
which is fine for thin pointers, but for fat pointers this means that
once the pointer is moved out of that datum, its memory will be marked
as dead. And because there is not necessarily an intermediate temporary
involved we can end up marking memory as dead that is actually still
used.

As I don't want to break the micro-optimization for thin pointers by
always returning an Lvalue datum, I decided to only do so for fat
pointers.

Fix #30478
2015-12-27 17:57:49 +01:00
Jeff Walden
68c0f024cf Change the typo 'that' to 'than' in the book error-handling chapter. 2015-12-27 00:24:45 -06:00
bors
2ced149925 Auto merge of #30566 - salty-horse:doc_typo, r=apasel422
Small typo. vectors -> vector.
2015-12-27 01:00:53 +00:00
bors
0c7c94e8a0 Auto merge of #30562 - nagisa:mir-unit-enums, r=luqmana
Thanks @arielb1!
r? @luqmana
2015-12-26 22:58:34 +00:00
Florian Hartwig
eaa94c52a1 Fix links in char docs 2015-12-26 22:04:18 +01:00
Ori Avtalion
d6d949a62a book: Fix typo 2015-12-26 22:29:02 +02:00
Simonas Kazlauskas
7b68b5fc2a Also fix MIRification of unit enum variants 2015-12-26 14:44:36 +02:00
Florian Hartwig
1fe2a77dd8 Fix some links in str docs 2015-12-26 12:16:48 +01:00
Florian Hartwig
0fcf4710e9 Fix links in docs for std::io 2015-12-26 00:11:20 +01:00
Florian Hartwig
0cf5083b24 Fix link that is currently broken due to bad markup 2015-12-26 00:01:10 +01:00
bors
3150dddb0f Auto merge of #30558 - jonas-schievink:delete-ast, r=nrc
Or more specifically, after running early lints.

Closes #28142
2015-12-25 22:32:08 +00:00
Jonas Schievink
389e8e3b81 Delete the AST after lowering 2015-12-25 17:17:45 +01:00
bors
5b838c586c Auto merge of #30555 - Manishearth:rollup, r=Manishearth
- Successful merges: #30485, #30490, #30513, #30518, #30528, #30545, #30551, #30552
- Failed merges:
2015-12-25 14:27:58 +00:00
Manish Goregaokar
04fe94a666 Rollup merge of #30552 - mmcco:align, r=steveklabnik
Trivial, but my eye is twitching.
2015-12-25 18:39:58 +05:30
Manish Goregaokar
ca43930dac Rollup merge of #30551 - nagisa:mir-unit-structs, r=luqmana
Fixes https://github.com/rust-lang/rust/issues/30514

i also went ahead and removed the redundant `ItemKind`s.

r? @nikomatsakis (this is an easy one I guess)
2015-12-25 18:39:57 +05:30
Manish Goregaokar
288a7e52ee Rollup merge of #30545 - bluss:operator-overload, r=steveklabnik
book: Some operator fixes for the syntax index

- Correct the names of the comparison traits (PartialOrd)
- Mention only the traits that overload the operator (PartialOrd,
  PartialEq), not operator-unrelated traits (Ord, Eq).
- Add `!=` operator.
2015-12-25 18:39:56 +05:30
Manish Goregaokar
f903c9738c Rollup merge of #30528 - michaelwoerister:fix-extern-def-paths, r=nikomatsakis
Avoid duplicating the last element of the def path which led to paths like "std::slice::into_vec::into_vec".

cc @rust-lang/compiler
2015-12-25 18:39:56 +05:30
Manish Goregaokar
0886d3f87a Rollup merge of #30518 - semarie:openbsd-snapshot, r=alexcrichton
as the buildbot has timeouted when building snap3 branch, I regenerate one locally.

here the diff that registers the OpenBSD snapshot.

the archive is available at http://semarie.online.fr/rust/rust-stage0-2015-12-18-3391630-openbsd-x86_64-6c8aab2c8a169274942f9a15e460069a3ff64be9.tar.bz2

sha256 : de3c26a93cf9512922cc012f9b57bd08d7b64f7e0469a9bb032fa9c07260cf0c

@alexcrichton does it is the good method for providing a snapshot ?
2015-12-25 18:39:55 +05:30
Manish Goregaokar
91440adbed Rollup merge of #30513 - alexcrichton:assert-is-safe, r=aturon
Types like `&AssertRecoverSafe<T>` and `Rc<AssertRecoverSafe<T>>` were
mistakenly not considered recover safe, but the point of the assertion wrapper
is that it indeed is! This was caused by an interaction between the
`RecoverSafe` and `NoUnsafeCell` marker traits, and this is updated by adding an
impl of the `NoUnsafeCell` marker trait for `AssertRecoverSafe` to ensure that
it never interacts with the other negative impls of `RecoverSafe`.

cc #30510
2015-12-25 18:39:54 +05:30
Manish Goregaokar
12f171b052 Rollup merge of #30485 - sfackler:panic-handler, r=alexcrichton
r? @alexcrichton
2015-12-25 16:54:30 +05:30
bors
711f11e8d6 Auto merge of #30544 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #30251, #30461, #30465, #30473, #30529, #30537, #30539, #30541, #30543
- Failed merges:
2015-12-25 06:24:56 +00:00
Michael McConville
552b70aad3 Fix whitespace alignment
Trivial, but my eye is twitching.
2015-12-24 21:39:38 -05:00
Simonas Kazlauskas
75e8f4afca Properly translate unit structs in MIR 2015-12-25 01:02:34 +02:00
Jonas Schievink
93a655940d ast_map => hir_map 2015-12-24 21:30:27 +01:00
mitaa
08222480e9 Fix link to Formatter::debug_struct 2015-12-24 08:15:58 +01:00
Michael McConville
b0a9b3d458 Use libc's Linux syscall()
There's no need for us to redeclare it in an extern block.
2015-12-23 22:46:45 -05:00
Michael McConville
d958cfc2de Simply two cfg attributes 2015-12-23 22:31:53 -05:00