Commit Graph

58417 Commits

Author SHA1 Message Date
Jethro Beekman
a29b503033 Add stable example to TypeId 2016-10-17 17:49:07 -07:00
bors
1d3dfa5301 Auto merge of #37237 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 6 pull requests

- Successful merges: #37172, #37177, #37189, #37194, #37200, #37215
- Failed merges:
2016-10-17 17:35:16 -07:00
Jeffrey Seyfried
95a9e2a724 Add regression test. 2016-10-17 23:00:53 +00:00
Jeffrey Seyfried
9578e1a251 Fix partially consumed tokens in macro matchers. 2016-10-17 23:00:52 +00:00
Michael Woerister
c560ca4513 Fix typo 2016-10-17 17:47:48 -04:00
Guillaume Gomez
b097790182 Rollup merge of #37215 - flodiebold:comment-fix, r=sfackler
Update comment in Vec::dedup_by

It's a tiny thing, but I came across this comment which previously was in `dedup` and wasn't updated when `dedup_by` was introduced.
2016-10-17 23:07:53 +02:00
Guillaume Gomez
3ff8ee18aa Rollup merge of #37200 - zackmdavis:llvm_version_in_verbose_version, r=sanxiyn
include LLVM version in `--version --verbose`

This is in the matter of #28405.

```
$ ./x86_64-unknown-linux-gnu/stage1/bin/rustc --version --verbose
rustc 1.14.0-dev (8e05e7ee3 2016-10-15)
binary: rustc
commit-hash: 8e05e7ee3c
commit-date: 2016-10-15
host: x86_64-unknown-linux-gnu
release: 1.14.0-dev
LLVM version: 3.9
```
2016-10-17 23:07:53 +02:00
Guillaume Gomez
9569ea0d2f Rollup merge of #37194 - johnthagen:fix-const-static-header, r=bluss
Remove un-rendered ticks from "const and static" doc title

Related to #37116 and #37119.

Ticks in the titles are not correctly rendered

![const-static-render](https://cloud.githubusercontent.com/assets/10340167/19412643/63e385a2-92e8-11e6-81f1-16802f803aad.png)
2016-10-17 23:07:53 +02:00
Guillaume Gomez
28416cbbff Rollup merge of #37189 - nabeelomer:master, r=bluss
Updated the docs for Error::description

Fixes https://github.com/rust-lang/rust/issues/37163
2016-10-17 23:07:52 +02:00
Guillaume Gomez
1aac569e8a Rollup merge of #37177 - michaelwoerister:fix-check-stage1, r=petrochenkov
Fix make check-stage1 by conditionally activating question_mark feature for compiletest tool.

r? @alexcrichton
2016-10-17 23:07:52 +02:00
Guillaume Gomez
2b634949a3 Rollup merge of #37172 - michaelwoerister:cleanup-dibuilder, r=eddyb
debuginfo: Remove some outdated stuff from LLVM DIBuilder binding.

These seem to be leftovers from various adaptations to changes in LLVM over time.
Perfect for a rollup.

r? @eddyb
2016-10-17 23:07:52 +02:00
bors
e0111758eb Auto merge of #36915 - jfirebaugh:E0308-split, r=nikomatsakis
Use a distinct error code for "if may be missing an else clause"

Introduce the possibility of assigning distinct error codes to the various origin types of E0308. Start by assigning E0317 for the "IfExpressionWithNoElse" case, and write a long diagnostic specific to this case.

Fixes #36596
2016-10-17 14:06:46 -07:00
Jonas Schievink
0c844d2304 Set stalled=false when encountering an error 2016-10-17 21:53:27 +02:00
Ulrik Sverdrup
0a0efcbebf std::collections: Reexport libcollections's range module
This is overdue, even if range and RangeArgument is still unstable.
The stability attributes are the same ones as the other unstable item
(Bound) here, they don't seem to matter.
2016-10-17 21:26:29 +02:00
bors
ce31626801 Auto merge of #37112 - pnkfelix:fix-issue-36744, r=arielb1
Fix ICE: inject bitcast if types mismatch for invokes/calls/stores

Fix ICE: inject bitcast if types mismatch for invokes/calls

Fix #36744
2016-10-17 09:47:46 -07:00
Michael Woerister
d07523c716 ICH: Use 128-bit Blake2b hash instead of 64-bit SipHash for incr. comp. fingerprints. 2016-10-17 12:40:25 -04:00
Felix S. Klock II
4124d8e48b Moved new dropck-eyepatch compile-fail tests to the ui/ subtree. 2016-10-17 18:02:23 +02:00
Felix S. Klock II
0d8f7164bb Review feedback: expand comment and simplify some code. 2016-10-17 16:22:42 +02:00
Felix S. Klock II
85d2e4d1d6 Review feedback: add linebreak and reindent to make braces match better. 2016-10-17 16:22:24 +02:00
Felix S. Klock II
818ac082d2 remove fixme that i no longer think appropriate. 2016-10-17 16:17:54 +02:00
Felix S. Klock II
0271a9a60a Fix Subst construction: use subst from adt_def rather than Drop impl's subst.
This addresses issue pointed out by niko that prior code would break
if the declaration order for generics does not match how they are fed
into the instantiation of the type itself. (Added some tests
exercising this scenario.)
2016-10-17 16:14:25 +02:00
Ulrik Sverdrup
13a1f21371 hashmap: Store hashes as usize internally
We can't use more than usize's bits of a hash to select a bucket anyway,
so we only need to store that part in the table. This should be an
improvement for the size of the data structure on 32-bit platforms.
Smaller data means better cache utilization and hopefully better
performance.
2016-10-17 15:54:09 +02:00
bors
07b86d0d4d Auto merge of #37162 - matklad:static-mut-lint, r=jseyfried
Lint against lowercase static mut

Closes #37145.

Lint for non mut statics was added in https://github.com/rust-lang/rust/pull/7523, and it explicitly did not cover mut statics. I am not sure why.
2016-10-17 04:32:15 -07:00
Ulrik Sverdrup
ed5015939f Expand .zip() specialization to .map() and .cloned()
Implement .zip() specialization for Map and Cloned.

The crucial thing for transparent specialization is that we want to
preserve the potential side effects.

The simplest example is that in this code snippet:

`(0..6).map(f).zip((0..4).map(g)).count()`

`f` will be called five times, and `g` four times. The last time for `f`
is when the other iterator is at its end, so this element is unused.
This side effect can be preserved without disturbing code generation for
simple uses of `.map()`.

The `Zip::next_back()` case is even more complicated, unfortunately.
2016-10-17 10:58:21 +02:00
Aleksey Kladov
066d62d4b4 Use one message for uppercase global lint 2016-10-17 11:10:34 +03:00
bors
da7f8c540b Auto merge of #37153 - michaelwoerister:spread-arg-debuginfo, r=eddyb
debuginfo: Handle spread_arg case in MIR-trans in a more stable way.

Use `VariableAccess::DirectVariable` instead of `VariableAccess::IndirectVariable` in order not to make LLVM's SROA angry. This is a step towards fixing #36774 and #35547. At least, I can build Cargo with optimizations + debuginfo again.

r? @eddyb
2016-10-17 00:31:25 -07:00
Marcin Fatyga
c78a212110 Add ordering_chaining feature to libcore/lib.rs 2016-10-17 08:37:54 +02:00
loggerhead
0d3bdc6c3e Fix a error of 'book/deref-coercions.html'
The original sentence is:

> This example has two conversions: `Rc<String>` to `String` and then `String` to `&str`. 

But it should be

> This example has two conversions: `Rc<String>` to `String` and then `String` to `str`. 

or 

> This example has two conversions: `&Rc<String>` to `&String` and then `&String` to `&str`. 

I think the latter is more clearly.
2016-10-17 11:16:36 +08:00
bors
54c133d3ba Auto merge of #37082 - frewsxcv:session, r=jseyfried
'src/librustc/session/filesearch.rs' refactoring and cleanup.
2016-10-16 20:00:14 -07:00
Jonas Schievink
88fde7f728 Don't process cycles when stalled
This improves the `inflate-0.1.0` benchmark by about 10% for me.
2016-10-17 02:28:31 +02:00
Andrew Paseltiner
f8322035eb
Implement RefUnwindSafe for atomic types
Closes #37136
2016-10-16 19:48:59 -04:00
Vadim Petrochenkov
49e6b466e9 Mark enums with non-zero discriminant as non-zero 2016-10-17 02:24:04 +03:00
David Henningsson
e4ed345b2c impl Debug for ReadDir
It is good practice to implement Debug for public types, and
indicating what directory you're reading seems useful.

Signed-off-by: David Henningsson <diwic@ubuntu.com>
2016-10-16 20:42:55 +02:00
Marcin Fatyga
43a022660a Fix doctests 2016-10-16 20:24:20 +02:00
Srinivas Reddy Thatiparthy
7a491bb66d
Run rustfmt on libcore/prelude folder 2016-10-16 22:13:04 +05:30
Srinivas Reddy Thatiparthy
5afd6d8206
Run rustfmt on libcore/sync folder 2016-10-16 22:11:01 +05:30
Florian Diebold
187ddf30b0 Update comment in Vec::dedup_by 2016-10-16 14:41:01 +02:00
bors
6572a46311 Auto merge of #37129 - arielb1:erased-normal, r=eddyb
normalize types every time HR regions are erased

Associated type normalization is inhibited by higher-ranked regions.
Therefore, every time we erase them, we must re-normalize.

I was meaning to introduce this change some time ago, but we used
to erase regions in generic context, which broke this terribly (because
you can't always normalize in a generic context). That seems to be gone
now.

Ensure this by having a `erase_late_bound_regions_and_normalize`
function.

Fixes #37109 (the missing call was in mir::block).

r? @eddyb
2016-10-16 04:22:21 -07:00
Srinivas Reddy Thatiparthy
54e320d4bc
run rustfmt on various folders 2016-10-16 15:41:01 +05:30
Srinivas Reddy Thatiparthy
abc715e985
run rustfmt on bootstrap/bin folder 2016-10-16 14:57:25 +05:30
bors
6dc035ed91 Auto merge of #37098 - ollie27:rustdoc_playground, r=GuillaumeGomez
rustdoc: Improve playground run buttons

The main change is to stop using javascript to generate the URLs and use
rustdoc instead.

This also adds run buttons to the error index examples.

You can test the changes at https://ollie27.github.io/rust_doc_test/.

Fixes #36621
Fixes #36910
2016-10-15 19:49:12 -07:00
Zack M. Davis
06123d3afe include LLVM version in --version --verbose
This is in the matter of #28405.
2016-10-15 15:57:28 -07:00
Jeffrey Seyfried
aac6dca21e Treat custom derive extern crates like empty modules. 2016-10-15 22:55:21 +00:00
Jeffrey Seyfried
33e3da831c Use the macro namespace for custom derives. 2016-10-15 22:55:19 +00:00
bors
98a3502da1 Auto merge of #37152 - arielb1:drop-cache, r=pnkfelix
add a per-param-env cache to `impls_bound`

There used to be only a global cache, which led to uncached calls to
trait selection when there were type parameters.

This causes a 20% decrease in borrow-checking time and an overall 0.5% performance increase during bootstrapping (as borrow-checking tends to be a tiny part of compilation time).

Fixes #37106 (drop elaboration times are now ~half of borrow checking,
so might still be worthy of optimization, but not critical).

r? @pnkfelix
2016-10-15 15:38:52 -07:00
Jeffrey Seyfried
d902963b6d Refactor syntax::ext::base::Resolver::resolve_invoc. 2016-10-15 20:50:02 +00:00
johnthagen
d001e8ad17 Remove un-rendered ticks from title. 2016-10-15 15:00:37 -04:00
Zack M. Davis
ac42f3f206 correct erroneous pluralization of '1 type argument' error messages
This is in the matter of #37042.
2016-10-15 11:40:12 -07:00
Oliver Middleton
0b2746c8db rustdoc: Improve playground run buttons
The main change is to stop using javascript to generate the URLs and use
rustdoc instead.

This also adds run buttons to the error index examples.
2016-10-15 18:32:03 +01:00
Zack M. Davis
1bfa1d51fd introing one-time diagnostics: only emit "lint level defined here" once
We introduce a new `one_time_diagnostics` field on
`rustc::session::Session` to hold a hashset of diagnostic messages we've
set once but don't want to see again (as uniquified by span and message
text), "lint level defined here" being the motivating example dealt with
here.

This is in the matter of #24690.
2016-10-15 10:28:40 -07:00