Commit Graph

57558 Commits

Author SHA1 Message Date
Eduard Burtescu
a79104e0c6 serialize: extend with specialization-based encoding/decoding multi-dispatch. 2016-09-20 19:21:33 +03:00
Nick Platt
429ba7ba9a Minor correction in sort_by_key doc comment 2016-09-20 11:20:33 -04:00
bors
c772948b68 Auto merge of #36388 - pcwalton:copy-propagation, r=nikomatsakis
librustc_mir: Implement def-use chains and trivial copy propagation on MIR.

This only supports trivial cases in which there is exactly one def and
one use.

Currently, some random unrelated MIR tests are failing, probably just because they haven't been updated.

r? @eddyb
2016-09-20 08:01:01 -07:00
Felix S. Klock II
c41a806e4e Workaround #34427 by using memset of 0 on ARM to set the discriminant. 2016-09-20 15:58:46 +02:00
Nicholas Nethercote
80a44779f7 Lazily allocate TypedArena's first chunk.
Currently `TypedArena` allocates its first chunk, which is usually 4096
bytes, as soon as it is created. If no allocations are ever made from
the arena then this allocation (and the corresponding deallocation) is
wasted effort.

This commit changes `TypedArena` so it doesn't allocate the first chunk
until the first allocation is made.

This change speeds up rustc by a non-trivial amount because rustc uses
`TypedArena` heavily: compilation speed (producing debug builds) on
several of the rustc-benchmarks increases by 1.02--1.06x. The change
should never cause a slow-down because the hot `alloc` function is
unchanged. It does increase the size of `TypedArena` by one `usize`
field, however.

The commit also fixes some out-of-date comments.
2016-09-20 22:00:29 +10:00
bors
2c2552b712 Auto merge of #36445 - infinity0:master, r=brson
mk: add a all-no-docs target to build everything except docs

This makes things slightly more efficient for Debian's auto-builders where the
docs can be built on just one architecture, and distributed to users of all
other architectures as well.
2016-09-20 01:24:54 -07:00
Patrick Walton
480287ec3b librustc: Implement def-use chains and trivial copy propagation on MIR.
This only supports trivial cases in which there is exactly one def and
one use.
2016-09-19 19:18:38 -07:00
bors
cbd84aeb73 Auto merge of #34942 - porglezomp:master, r=sfackler
Fix overflow checking in unsigned pow()

The pow() method for unsigned integers produced 0 instead of trapping overflow for certain inputs. Calls such as 2u32.pow(1024) produced 0 when they should trap an overflow. This also adds tests for the correctly handling overflow in unsigned pow().

This was previously fixed for signed integers in #28248, but it seems unsigned integers got missed that time.

For issue number #34913
2016-09-19 19:03:52 -07:00
jacobpadkins
8b02aa1c80 fixed the safety header/wording in option.rs 2016-09-19 17:55:44 -05:00
Jorge Aparicio
e0c60b4d02 rustdoc: implement --sysroot
with the same semantics as rustc. This let us build documentation for a
crate that depends on a custom sysroot.
2016-09-19 15:56:38 -05:00
bors
e0547019eb Auto merge of #36102 - GuillaumeGomez:rustc_metadata_diagnostics, r=jonathandturner
Rustc metadata diagnostics

r? @jonathandturner
2016-09-19 13:23:12 -07:00
Jorge Aparicio
2f71fa7150 add a test 2016-09-19 15:21:32 -05:00
Jonathan Turner
2ea3ab3a90 Add the ability to merge spans to codemap 2016-09-19 12:31:56 -07:00
Patrick Walton
2e6a91812c librustc: Add a new nop statement to the MIR.
This is useful when passes want to remove statements without affecting
`Location`s.
2016-09-19 11:17:12 -07:00
bors
412a637704 Auto merge of #36471 - nnethercote:rm-to_binop, r=sanxiyn
Remove unused Token::to_binop function

Just some dead code removal.
2016-09-19 08:32:05 -07:00
Guillaume Gomez
313fb8fbf2 Replace 'e.g.' by 'i.e.' 2016-09-19 14:08:57 +02:00
Guillaume Gomez
dfa094014c Add missing urls for Box doc 2016-09-19 14:02:48 +02:00
Jorge Aparicio
9631e9f9b3 rustc: implement -C link-arg
this flag lets you pass a _single_ argument to the linker but can be
used _repeatedly_. For example, instead of using:

```
rustc -C link-args='-l bar' (..)
```

you could write

```
rustc -C link-arg='-l' -C link-arg='bar' (..)
```

This new flag can be used with RUSTFLAGS where `-C link-args` has
problems with "nested" spaces:

```
RUSTFLAGS='-C link-args="-Tlayout.ld -nostartfiles"'
```

This passes three arguments to rustc: `-C` `link-args="-Tlayout.ld` and
`-nostartfiles"` to `rustc`. That's not what we meant. But this does
what we want:

```
RUSTFLAGS='-C link-arg=-Tlayout.ld -C link-arg=-nostartfiles`
```

cc rust-lang/rfcs#1509
2016-09-19 02:48:08 -05:00
bors
5f6f838448 Auto merge of #36545 - Cobrand:wild-print-fix, r=sfackler
Remove stray println! when invoking error E0316

Removed a wild println! statement that has been here for over a year and a half.

Closes #36543
2016-09-18 21:01:49 -07:00
bors
bfac5d6d9f Auto merge of #36523 - Mark-Simulacrum:format-args-link, r=GuillaumeGomez
Add links between format_args! macro and std::fmt::Arguments struct

r? @GuillaumeGomez
2016-09-18 17:25:01 -07:00
aclarry
af67f0b389 Fix name of error test file 2016-09-18 18:55:19 -04:00
bors
55bf6a4f87 Auto merge of #36487 - nrc:save-doc-urls, r=@eddyb
save-analysis: better 'parent' info

In particular, this fixes some bugs displaying doc URLs for method calls.
2016-09-18 14:00:02 -07:00
Nick Cameron
48e69e029b save-analysis: better 'parent' info
In particular, this fixes some bugs displaying doc URLs for method calls.
2016-09-19 07:17:49 +12:00
bors
33927757ae Auto merge of #36390 - frewsxcv:panic-set-hook, r=GuillaumeGomez
Add basic doc examples for `std::panic::{set_hook, take_hook}`.

None
2016-09-18 10:34:48 -07:00
Corey Farwell
e0d554a883 Add regression test for #9837.
Fixes https://github.com/rust-lang/rust/issues/9837
2016-09-18 13:01:40 -04:00
Eitan Adler
0c252ffbab per timnn 2016-09-18 07:36:02 -07:00
Corey Farwell
5505ebc31d Add basic doc examples for std::panic::{set_hook, take_hook}. 2016-09-18 10:03:34 -04:00
Vanja Cosic
b67a8439f9 Updated "Ownership". Trying to fix #34865
- Reword
- Add link
2016-09-18 14:43:14 +02:00
Guillaume Gomez
b4c739dbdd Add missing Eq implementations 2016-09-18 14:26:49 +02:00
Vanja Cosic
172d321f9f Updated "Getting started". Trying to fix #34523
- Updated paragraphs and wording for clarity.
- Renamed `helloworld.rs` to `myprogram.rs` to make it clearer that it's an unrelated example.
2016-09-18 14:16:42 +02:00
bors
22d15eaca9 Auto merge of #36555 - jseyfried:issue_36540, r=eddyb
Visit and fold macro invocations in the same order

Fixes #36540.
r? @nrc
2016-09-18 04:11:51 -07:00
bors
f39039e6e5 Auto merge of #36527 - nnethercote:last_token_kind, r=jseyfried
Optimize the parser's last token handling.

The parser currently makes a heap copy of the last token in four cases:
identifiers, paths, doc comments, and commas. The identifier and
interpolation cases are unused, and for doc comments and commas we only
need to record their presence, not their value.

This commit consolidates the last token handling and avoids the
unnecessary copies by replacing `last_token`, `last_token_eof`, and
`last_token_interpolated` with a new field `last_token_kind`. This
simplifies the parser slightly and speeds up parsing on some files by
3--4%.
2016-09-18 00:48:51 -07:00
Eitan Adler
fad6a09c94 remove duplicate duplicate words 2016-09-17 23:36:59 -07:00
Eitan Adler
9c3cf06b29 inherit from object 2016-09-17 23:31:06 -07:00
Eitan Adler
4f11a39e26 invisible isn't a tag 2016-09-17 23:30:42 -07:00
Eitan Adler
ccb78d20cd border-color > border 2016-09-17 23:30:22 -07:00
Eitan Adler
101d987d29 add missing semi-colon 2016-09-17 23:29:00 -07:00
Eitan Adler
73d2653417 duplicate the 2016-09-17 23:19:03 -07:00
Eitan Adler
1a4a723dda remove useless semicolon from python 2016-09-17 23:10:12 -07:00
Eitan Adler
22c66c4b38 modern style classes 2016-09-17 23:09:21 -07:00
Eitan Adler
733fe1d25c make functions static where possible 2016-09-17 23:08:31 -07:00
Eitan Adler
3545785041 Remove unused code 2016-09-17 23:07:11 -07:00
Eitan Adler
1a67298f20 prefer tuple to array 2016-09-17 23:06:45 -07:00
Eitan Adler
266ef889e3 pep8 prefers triple quoted with double quotes 2016-09-17 23:05:20 -07:00
Eitan Adler
f7811c1ca6 Fix order of @import
In CSS 2.1, any @import rules must precede all other rules (except the
@charset rule, if present).
2016-09-17 22:56:22 -07:00
Eitan Adler
8de97dddfd simplify python code 2016-09-17 22:52:00 -07:00
Eitan Adler
a6d804ede8 Browsers do not consistently handle non-integer values for font-size. 2016-09-17 22:51:13 -07:00
Steven Fackler
12960aa114 Clean up hasher discussion on HashMap
* We never want to make guarantees about protecting against attacks.
* "True randomness" is not the right terminology to be using in this
    context.
* There is significantly more nuance to the performance of SipHash than
    "somewhat slow".
2016-09-17 21:04:24 -07:00
bors
0b03ba1f55 Auto merge of #36502 - TimNN:correct-cancel, r=jseyfried
correctly cancel some errors

Fixes #36499.

I also (proactively) changed all other calls in `parser.rs` to use `Handler::cancel`.
2016-09-17 20:57:05 -07:00
bors
d37e54b419 Auto merge of #36504 - pcwalton:and-star, r=eddyb
librustc_mir: Remove `&*x` when `x` has a reference type.

This introduces a new `InstCombine` pass for us to place such peephole
optimizations.

r? @eddyb
2016-09-17 17:30:22 -07:00