Commit Graph

54973 Commits

Author SHA1 Message Date
Seo Sanghyeon
41fef433a0 Rollup merge of #34807 - sanxiyn:dump-mir, r=nagisa
Remove extra newlines in MIR dump
2016-07-18 22:44:56 +09:00
bors
06ca016b6e Auto merge of #34886 - jseyfried:improve_stmt_matchers, r=eddyb
macros: fix bug in `stmt` matchers

Today, `stmt` matchers stop too early when parsing expression statements that begin with non-braced macro invocations. For example,
```rust
fn main() {
    macro_rules! m { ($s:stmt;) => { $s } }
    id!(vec![].push(0););
    //^ Before this PR, the `stmt` matcher only consumes "vec![]", so this is an error.
    //| After this PR, the `stmt` matcher consumes "vec![].push(0)", so this compiles.
}
```
This change is backwards compatible due to the follow set for `stmt`.

r? @eddyb
2016-07-18 01:40:23 -07:00
Mark Buer
d820fcba12 Remove rustdoc reference to walk_dir 2016-07-18 17:54:15 +09:30
bors
6cc49e51de Auto merge of #34860 - jseyfried:encapsulate_hygiene, r=nrc
Clean up and encapsulate `syntax::ext::mtwt`, rename `mtwt` to `hygiene`

r? @nrc
2016-07-17 22:12:59 -07:00
ggomez
ce442b4f51 Add debug for hash_map::{Entry, VacantEntry, OccupiedEntry} 2016-07-18 01:38:19 +02:00
Jake Goulding
661187a95e Remove extraneous words 2016-07-17 18:19:20 -04:00
Jake Goulding
f6be6aa92a Document from_raw_parts involves ownership transfer 2016-07-17 18:18:49 -04:00
Jack O'Connor
6a09df9079 implement AddAssign for String 2016-07-17 15:30:21 -04:00
bors
f441bca499 Auto merge of #34876 - frewsxcv:vec-as-mut-slice, r=alexcrichton
Remove unnecessary indexing and deref in `Vec::as_mut_slice`.

None
2016-07-17 12:04:51 -07:00
Ximin Luo
8aaf0f894b doc/book: fix tests for non-x86 architectures, such as aarch64
`rustdoc --test` gets confused when "main" exists for some architectures but not others.
2016-07-17 21:00:24 +02:00
Ximin Luo
4e5e36fb79 test: disable more stdcall tests for ARM arches. temp workaround for #24958 2016-07-17 20:57:54 +02:00
Jeffrey Seyfried
275d321ab0 Remove some unit tests and that are redundant with run-pass/hygiene.rs
and that would be painful to rewrite.
2016-07-17 17:12:35 +00:00
Jeffrey Seyfried
44575f708a Rename mtwt to hygiene 2016-07-17 17:12:35 +00:00
Jeffrey Seyfried
76ed445622 Clean up and encapsulate syntax::ext::mtwt 2016-07-17 17:12:32 +00:00
Jeffrey Seyfried
bd1ad762b7 Add regression test 2016-07-17 16:08:09 +00:00
bors
34f35ed29c Auto merge of #34871 - petrochenkov:inherent, r=jseyfried
Do not resolve inherent static methods from other crates prematurely

Under some specific circumstances paths like `Type::method` can be resolved early in rustc_resolve instead of type checker. `Type` must be defined in another crate, it should be an enum or a trait object (i.e. a type that acts as a "module" in resolve), and `method` should be an inherent static method.
As a result, such paths don't go through `resolve_ufcs`, may be resolved incorrectly and break some invariants in type checker. This patch removes special treatment of such methods.

The removed code was introduced in 2bd46e767c to fix a problem that no longer exists.

r? @jseyfried
2016-07-17 09:07:50 -07:00
Jeffrey Seyfried
27a18b127f macros: Fix bug in statement matchers 2016-07-17 15:46:41 +00:00
Corey Farwell
b2f5b5a812 Indicate where std::slice structs originate from. 2016-07-17 09:16:47 -04:00
Novotnik, Petr
3b5d71e0cf Make .enumerate() example self-explanatory 2016-07-17 12:06:10 +02:00
bors
6aba7be9a6 Auto merge of #34829 - cgswords:tstream, r=nrc
Added tokenstream parser procedure

A tiny PR that simply adds a procedure for parsing `TokenStream`s to the parser in `src/libsyntax`. This is to ease using `TokenStream`s with the current (old) procedural macro system.
2016-07-17 03:05:08 -07:00
Vadim Petrochenkov
9c5039a128 Implement traits for variadic function pointers 2016-07-17 10:21:07 +03:00
bors
7ed6068d3e Auto merge of #34789 - jonathandturner:simplify_liberror, r=alexcrichton
Simplify librustc_errors

This is part 2 of the error crate refactor, starting with #34403.

In this refactor, I focused on slimming down the error crate to fewer moving parts.  As such, I've removed quite a few parts and replaced the with simpler, straight-line code.  Specifically, this PR:

* Removes BasicEmitter
* Remove emit from emitter, leaving emit_struct
* Renames emit_struct to emit
* Removes CoreEmitter and focuses on a single Emitter
* Implements the latest changes to error format RFC (#1644)
* Removes (now-unused) code in emitter.rs and snippet.rs
* Moves more tests to the UI tester, removing some duplicate tests in the process

There is probably more that could be done with some additional refactoring, but this felt like it was getting to a good state.

r? @alexcrichton   cc: @Manishearth (as there may be breaking changes in stuff I removed/changed)
2016-07-17 00:06:29 -07:00
bors
34d7f7e607 Auto merge of #34606 - mathstuf:llvm-with-ninja, r=alexcrichton
llvm, rt: build using the Ninja generator if available

The Ninja generator generally builds much faster than make. It may also
be used on Windows to have a vast speed improvement over the Visual
Studio generators.

Currently hidden behind an `--enable-ninja` flag because it does not
obey the top-level `-j` or `-l` flags given to `make`.
2016-07-16 21:09:15 -07:00
Corey Farwell
f80165dfa2 Remove unnecessary indexing and deref in Vec::as_mut_slice. 2016-07-16 22:09:55 -04:00
Guillaume Gomez
0c9a6f65d0 Add examples for LinkedList 2016-07-17 03:19:27 +02:00
bors
103e5c9b37 Auto merge of #34852 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 7 pull requests

- Successful merges: #33362, #34768, #34837, #34838, #34847, #34848, #34849
- Failed merges: #33951, #34850
2016-07-16 17:40:28 -07:00
Vadim Petrochenkov
f66da5e794 Do not resolve inherent static methods from other crates prematurely 2016-07-17 00:19:26 +03:00
bors
b5ad2779ea Auto merge of #34846 - jonas-schievink:issue34839, r=eddyb
Variant Size Differences: Erase regions before computing type layout

Fixes #34839
2016-07-16 13:38:51 -07:00
Alex Crichton
60564d072f Merge pull request #34862 from TimNN/revert-34836-panic-counter
Revert #34836 "Refactored code to access TLS only in case of panic"
2016-07-16 13:38:06 -07:00
Tim Neumann
dd72785af5 Revert "Refactored code to access TLS only in case of panic" 2016-07-16 22:19:43 +02:00
Alex Crichton
d5b9850d79 Merge pull request #34836 from cynicaldevil/panic-counter
Refactored code to access TLS only in case of panic
2016-07-16 10:10:17 -07:00
Guillaume Gomez
42326ec2a4 Add examples for VecDeque 2016-07-16 18:00:05 +02:00
Corey Farwell
e2f5961f35 Partial rewrite/expansion of Vec::truncate documentation. 2016-07-16 11:23:55 -04:00
Guillaume Gomez
45f8427d47 Rollup merge of #34849 - tshepang:patch-2, r=apasel422
doc: remove extraneous word
2016-07-16 16:55:59 +02:00
Guillaume Gomez
9d622d9e7e Rollup merge of #34848 - tshepang:patch-1, r=apasel422
doc: remove stray comma
2016-07-16 16:55:59 +02:00
Guillaume Gomez
f7e4545d1a Rollup merge of #34847 - baskerville:unwanted-tag, r=apasel422
Add missing inline code delimiters around Vec<T>

r? @steveklabnik
2016-07-16 16:55:59 +02:00
Guillaume Gomez
689fde2735 Rollup merge of #34838 - steveklabnik:gh33677, r=alexcrichton
Fix up documentation around no_std

1. Fix the sections in the book to have the correct signatures. I've
   also marked them as `ignore`; there's no way to set the `no_std`
   feature for libc, so it pulls in the stdlib, so this wasn't even
   testing the actual thing it was testing. Better to just ignore.
2. Correcting libcore's docs for factual inaccuracy, and add a note
   about language items.

Fixes #33677

r? @alexcrichton
2016-07-16 16:55:59 +02:00
Guillaume Gomez
6a7596a328 Rollup merge of #34837 - GuillaumeGomez:better_example, r=nagisa
Improve float number example

r? @nagisa
2016-07-16 16:55:59 +02:00
Guillaume Gomez
ad7a697a62 Rollup merge of #34768 - alexcrichton:issue-audit, r=aturon
std: Correct tracking issue for SipHash{13,24}

The referenced tracking issue was closed and was actually about changing the
algorithm.

cc #34767
2016-07-16 16:55:58 +02:00
Guillaume Gomez
1fb707dab5 Rollup merge of #33362 - andradei:master, r=Manishearth
Add mention to RFC 940 in the Rust Reference.

This PR adds a mention to hyphens in Cargo package names being replaced by underscores when used as a crate, as per [RFC 940](https://github.com/rust-lang/rfcs/blob/master/text/0940-hyphens-considered-harmful.md)

It also formats the RFCs consistently as RFC XXX instead of RFCXXX.
2016-07-16 16:55:57 +02:00
bors
eb196dc2ff Auto merge of #34816 - jseyfried:fix_include_path, r=nrc
Fix `include!()`s inside `asm!()` invocations

Fixes #34812, a regression caused by #33749 that was not fixed in #34450.
r? @nrc
2016-07-16 06:34:01 -07:00
Tshepang Lekhonkhobe
29ca456dfc doc: remove extraneous word 2016-07-16 11:13:29 +02:00
Tshepang Lekhonkhobe
cc2176d3fe doc: remove stray comma 2016-07-16 11:10:05 +02:00
Bastien Dejean
fc0d037265 Add missing inline code delimiters around Vec<T> 2016-07-16 10:50:19 +02:00
Jonas Schievink
d1486108bc Erase regions before computing type layout
Fixes #34839
2016-07-16 10:45:13 +02:00
bors
dc8212ff20 Auto merge of #34779 - infinity0:master, r=alexcrichton
If local-rust is the same as the current version, then force a local-rebuild

In Debian, we would like the option to build/rebuild the current release from
*either* the current or previous stable release. So we use enable-local-rust
instead of enable-local-rebuild, and read the bootstrap key dynamically from
whatever is installed locally.

In general, it does not make much sense to allow enable-local-rust without also
setting the bootstrap key, since the build would fail otherwise.

(The way I detect "the bootstrap key of [the local] rustc installation" is a bit hacky, suggestions welcome.)
2016-07-16 01:19:16 -07:00
bors
c4788c26ad Auto merge of #34676 - aravind-pg:inner-attr, r=brson
Better error message for inner attribute following doc comment

Before it was always just "an inner attribute is not permitted in this context", whereas now we add a special case for when an inner attr follows an outer attr. If the outer attr is a doc comment, then the error is "an inner attr is not permitted following a doc comment", and otherwise it's "an inner attr is not permitted following an outer attribute". In all other cases it's still  "an inner attribute is not permitted in this context".

Note that the public API and behaviour of `parse_attribute` is unchanged. Also, all new names are very open to bikeshedding -- they're arguably clunky.

Fixes #34516. cc @brson
2016-07-15 22:21:40 -07:00
Aravind Gollakota
ff95ba3a8c syntax: Better error message for inner attr following doc comment 2016-07-15 21:02:53 -07:00
bors
145f0ec88c Auto merge of #34841 - alexcrichton:no-mips-soft-float, r=brson
mk: Don't pass -msoft-float on mips-gnu

Soon the LLVM upgrade (#34743) will require an updated CMake installation, and
the easiest way to do this was to upgrade the Ubuntu version of the bots to
16.04. This in turn brings in a new MIPS compiler on the linux-cross builder,
which is now from the "official" ubuntu repositories. Unfortunately these
new compilers don't support compiling with the `-msoft-float` flag like we're
currently passing, causing compiles to fail.

This commit removes these flags as it's not clear *why* they're being passed, as
the mipsel targets also don't have it. At least if it's not supported by a
debian default compiler, perhaps it's not too relevant to support?
2016-07-15 17:36:22 -07:00
cgswords
fecf3b6a2c Added tokenstream parser procedure 2016-07-15 15:20:43 -07:00