Commit Graph

67197 Commits

Author SHA1 Message Date
Oliver Schneider
c4d5a1e17b
Produce expansion info for more builtin macros 2017-09-04 11:03:19 +02:00
bors
a59a6d8a56 Auto merge of #44171 - eddyb:scope, r=nikomatsakis
Use hir::ItemLocalId instead of ast::NodeId in rustc::middle::region::CodeExtent.

This is an alternative to @michaelwoerister's #43887, changing `CodeExtent` instead of `ReScope`.

The benefit here is that the same `Region`s are used same-crate and cross-crate, while preserving the incremental recompilation properties of the stable `hir::ItemLocalId`.

Only places which needed to get back to the `ast::NodeId` from `CodeExtent` was its `span` method, used in error reporting - passing the `&RegionMaps` down allowed using `hir_to_node_id`.
`rustc::cfg` and `dataflow` also had to be converted to `hir::ItemLocalId` because of their interactions with `CodeExtent`, especially in `borrowck`, and from that we have 3 more `hir_to_node_id` calls: `cfg::graphviz` node labels, `borrowck` move reporting, and the `unconditional_recursion` lint.

Out of all of those, *only* the lint actually makes a decision (on whether code will compile) based on the result of the conversion, the others only use it to know how to print information to the user.
So I think we're safe to say that the bulk of the code working with a `CodeExtent` is fine with local IDs.

r? @nikomatsakis
2017-09-01 10:40:18 +00:00
Eduard-Mihai Burtescu
e4996ec49c rustc: use hir::ItemLocalId instead of ast::NodeId in CodeExtent. 2017-09-01 11:18:31 +03:00
Eduard-Mihai Burtescu
ea6aca7726 rustc: take TyCtxt and RegionMaps in CodeMap::span. 2017-09-01 11:17:03 +03:00
Eduard-Mihai Burtescu
28ddd7a4ef rustc: use hir::ItemLocalId instead of ast::NodeId in CFG. 2017-09-01 11:17:03 +03:00
bors
45d31e7310 Auto merge of #44233 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 10 pull requests

- Successful merges: #44192, #44199, #44202, #44203, #44205, #44207, #44209, #44223, #44230, #44231
- Failed merges:
2017-09-01 04:50:00 +00:00
Mark Simulacrum
81fc0e1150 Rollup merge of #44231 - lukaramu:patch-1, r=alexcrichton
Fix release notes on associated constants

Associated constants seem to be stable everywhere, not just in traits
2017-08-31 18:07:49 -06:00
Mark Simulacrum
88ee66d3c2 Rollup merge of #44230 - Phlosioneer:patch-1, r=sfackler
Fix typo in 1.20.0 release notes

str::from_boxed_utf8_unchecked rather than ste::
2017-08-31 18:07:48 -06:00
Mark Simulacrum
9c4bdd3b87 Rollup merge of #44223 - eddyb:symbol-from-str, r=jseyfried
Implement From<&str> for Symbol.

This lets us have `fn foo<S: Into<Symbol>>` bounds and accept both `&str` and existing `Symbol`s.

r? @jseyfried
2017-08-31 18:07:47 -06:00
Mark Simulacrum
3cd4ea3bfa Rollup merge of #44209 - frewsxcv:frewsxcv-addr-other-scenarios, r=alexcrichton
Expand docs of multi-address behavior of some UDP/TCP APIs.

Fixes https://github.com/rust-lang/rust/issues/22569.
2017-08-31 18:07:46 -06:00
Mark Simulacrum
4b2d568e72 Rollup merge of #44207 - durka:define-maps-fn, r=eddyb
add `fn` to syntax of rustc::ty::maps::define_maps

This is not a functional change, it just makes it possible to find a query by grepping without knowing that it's a query rather than a function.

I didn't pursue renaming everything from "map" to "query" because it seems to be a very invasive change. It would be a good test to exercise an IDE's renaming features.

Closes #44161

r? @eddyb
2017-08-31 18:07:45 -06:00
Mark Simulacrum
471f9894c9 Rollup merge of #44205 - frewsxcv:frewsxcv-addr-doc-fix, r=QuietMisdreavus
Fix typo in doc `ToSocketAddrs` example.

None
2017-08-31 18:07:44 -06:00
Mark Simulacrum
b66823fb4d Rollup merge of #44203 - cuviper:compiler-rt-test, r=Mark-Simulacrum
rustbuild: update the rust-src filter for compiler-rt

We wanted `src/compiler-rt/test` filtered from the `rust-src` package,
but that path is now `src/libcompiler_builtins/compiler-rt/test`.  This
saves over half of the installed rust-src size. (50MB -> 22MB)
2017-08-31 18:07:43 -06:00
Mark Simulacrum
f3b7197384 Rollup merge of #44202 - alexcrichton:xcrate-generators, r=arielb1
rustc: Fix reachability with cross-crate generators

Same solution as in f2df1857

Closes #44181
2017-08-31 18:07:42 -06:00
Mark Simulacrum
5f00b10b1c Rollup merge of #44199 - jakllsch:jakllsch-abcc6c4a-0caf-4d30-b336-39629c73d3f5, r=sfackler
bootstrap: add openssl configuration mapping for i686-unknown-netbsd
2017-08-31 18:07:41 -06:00
Mark Simulacrum
fd5a945727 Rollup merge of #44192 - GuillaumeGomez:sub-fields-style, r=QuietMisdreavus
Fix invalid display of enum sub-fields docs

Before:

<img width="1440" alt="screen shot 2017-08-30 at 23 17 00" src="https://user-images.githubusercontent.com/3050060/29895433-61f2bf8c-8dd9-11e7-83e8-cf1dca878100.png">

After:

<img width="1440" alt="screen shot 2017-08-30 at 23 16 48" src="https://user-images.githubusercontent.com/3050060/29895441-66dea042-8dd9-11e7-9576-11b0c770c70b.png">

cc @nox @rust-lang/docs
2017-08-31 18:07:40 -06:00
bors
69dbe6602d Auto merge of #43425 - matklad:lambda-restrictions, r=eddyb
Lambda expressions honor no struct literal restriction

This is a fix for #43412 if we decide that it is indeed a bug :)

closes #43412
2017-08-31 23:26:47 +00:00
Lukas H
f575185f39 Fix release note on associated constants
Associated constants seem to be stable everywhere, not just in traits
2017-09-01 01:17:08 +02:00
Phlosioneer
945ba85019 Fix typo in 1.20.0 release notes
str::from_boxed_utf8_unchecked rather than ste::
2017-08-31 19:12:07 -04:00
Eduard-Mihai Burtescu
9988e798c0 Implement From<&str> for Symbol. 2017-08-31 23:23:52 +03:00
Corey Farwell
0a716fdce2 Expand docs of multi-address behavior of some UDP/TCP APIs.
Fixes https://github.com/rust-lang/rust/issues/22569.
2017-08-31 11:24:34 -04:00
bors
97b01abf3d Auto merge of #41991 - GuillaumeGomez:rustdoc-html-diff, r=nrc
Add warnings when rustdoc html rendering differs
2017-08-31 08:52:03 +00:00
Guillaume Gomez
b501d00090 downgrade libgit2 2017-08-31 09:49:38 +02:00
Alex Burka
da302846ac add fn to syntax of rustc::ty::maps::define_maps 2017-08-31 01:07:47 -04:00
Corey Farwell
396fc111e1 Fix typo in doc ToSocketAddrs example. 2017-08-30 22:03:03 -04:00
Josh Stone
35f8a2065b rustbuild: update the rust-src filter for compiler-rt
We wanted `src/compiler-rt/test` filtered from the `rust-src` package,
but that path is now `src/libcompiler_builtins/compiler-rt/test`.  This
saves over half of the installed rust-src size. (50MB -> 22MB)
2017-08-30 18:20:59 -07:00
bors
890c87b643 Auto merge of #44186 - alexcrichton:rollup, r=alexcrichton
Rollup of 8 pull requests

- Successful merges: #44044, #44089, #44116, #44125, #44154, #44157, #44160, #44172
- Failed merges: #44162
2017-08-31 01:16:17 +00:00
Alex Crichton
b9fea42b7a Update libc to fix sparc compiles 2017-08-30 17:58:39 -07:00
Alex Crichton
41d3e83183 rustc: Fix reachability with cross-crate generators
Same solution as in f2df1857

Closes #44181
2017-08-30 17:32:21 -07:00
Jonathan A. Kollasch
0c2a9d6917 bootstrap: add openssl configuration mapping for i686-unknown-netbsd 2017-08-30 18:22:46 -05:00
Guillaume Gomez
bde0071d1d Fix invalid display of enum sub-fields docs 2017-08-30 23:16:25 +02:00
Alex Crichton
5c279a40ae Merge branch 'hide-trait-map' into rollup 2017-08-30 13:17:40 -07:00
Alex Crichton
16bbff0277 Rollup merge of #44172 - mattico:patch-2, r=frewsxcv
Fix link in unstable book entry for Generators
2017-08-30 13:17:05 -07:00
Alex Crichton
c0812c8458 Rollup merge of #44160 - AndyGauge:api-docs-macros, r=steveklabnik
API docs: macros.  Standard Documentation Checklist

Fixes #29381
r? @steveklabnik
2017-08-30 13:17:05 -07:00
Alex Crichton
8962393299 Rollup merge of #44157 - alexcrichton:no-specializes-cache, r=eddyb
rustc: Remove `specialization_cache` in favor of a query

This commit removes the `specialization_cache` field of `TyCtxt` by moving it to
a dedicated query, which it turned out was already quite easily structured to do
so!

cc #44137
2017-08-30 13:17:05 -07:00
bors
7eeac1b814 Auto merge of #43932 - eddyb:const-scoping, r=nikomatsakis
Forward-compatibly deny drops in constants if they *could* actually run.

This is part of #40036, specifically the checks for user-defined destructor invocations on locals which *may not* have been moved away, the motivating example being:
```rust
const FOO: i32 = (HasDrop {...}, 0).1;
```
The evaluation of constant MIR will continue to create `'static` slots for more locals than is necessary (if `Storage{Live,Dead}` statements are ignored), but it shouldn't be misusable.

r? @nikomatsakis
2017-08-30 20:12:25 +00:00
Guillaume Gomez
76e32210d1 Add license exceptions 2017-08-30 20:07:58 +02:00
Alex Crichton
fd4f362b30 Rollup merge of #44125 - SergioBenitez:master, r=nrc
Initial diagnostic API for proc-macros.

This commit introduces the ability to create and emit `Diagnostic` structures from proc-macros, allowing for proc-macro authors to emit warning, error, note, and help messages just like the compiler does.

The API is somewhat based on the diagnostic API already present in `rustc` with several changes that improve usability. The entry point into the diagnostic API is a new `Diagnostic` type which is primarily created through new `error`, `warning`, `help`, and `note` methods on `Span`. The `Diagnostic` type records the diagnostic level, message, and optional `Span` for the top-level diagnostic and contains a `Vec` of all of the child diagnostics. Child diagnostics can be added through builder methods on `Diagnostic`.

A typical use of the API may look like:

```rust
let token = parse_token();
let val = parse_val();

val.span
    .error(format!("expected A but found {}", val))
    .span_note(token.span, "because of this token")
    .help("consider using a different token")
    .emit();
```

cc @jseyfried @nrc @dtolnay @alexcrichton
2017-08-30 11:11:12 -05:00
Alex Crichton
bc6981ba55 Rollup merge of #44116 - alexcrichton:update-libc, r=Mark-Simulacrum
Update the libc submodule

Brings in a few fixes for wasm/asmjs
2017-08-30 11:11:11 -05:00
Alex Crichton
63cc2dda63 Rollup merge of #44089 - alexcrichton:trait-proc-macro, r=nrc
rustc: Fix proc_macro expansions on trait methods

This commit fixes procedural macro attributes being attached to trait methods,
ensuring that they get resolved and expanded as other procedural macro
attributes. The bug here was that `current_module` on the resolver was
accidentally set to be a trait when it's otherwise only ever expecting a
`mod`/block module. The actual fix here came from @jseyfried, I'm just helping
to land it in the compiler!

Closes #42493
2017-08-30 11:11:10 -05:00
Alex Crichton
581dc93293 Rollup merge of #44044 - mattico:string-splice-return, r=dtolnay
Remove Splice struct return value from String::splice

The implementation is now almost identical to the one in the RFC.

Fixes #44038
cc #32310
2017-08-30 11:11:09 -05:00
bors
51a54b6dc0 Auto merge of #43895 - JeremySorensen:master, r=alexcrichton
make ignore-git true by default when channel is dev

Fixes #43771
(Handle git info in rustbuild differently)
2017-08-30 15:43:09 +00:00
bors
ca9cf3594a Auto merge of #43968 - petrochenkov:span2, r=michaelwoerister
Make fields of `Span` private

I actually tried to intern spans and benchmark the result<sup>*</sup>, and this was a prerequisite.
This kind of encapsulation will be a prerequisite for any other attempt to compress span's representation, so I decided to submit this change alone.

The issue https://github.com/rust-lang/rust/issues/43088 seems relevant, but it looks like `SpanId` won't be able to reuse this interface, unless the tables are global (like interner that I tried) and are not a part of HIR.
r? @michaelwoerister anyway

<sup>*</sup> Interning means 2-3 times more space is required for a single span, but duplicates are free. In practice it turned out that duplicates are not *that* common, so more memory was wasted by interning rather than saved.
2017-08-30 11:08:26 +00:00
Guillaume Gomez
9b26f3ad25 Remove some false positive issues 2017-08-30 11:46:58 +02:00
bors
c66e7fa8de Auto merge of #43903 - oli-obk:alignto, r=aturon
Add align_offset intrinsic

see https://github.com/rust-lang/rfcs/pull/2043 for details and the plan towards stabilization (reexport in `core::mem` via various convenience functions)

as per @scottmcm 's [comment](https://github.com/rust-lang/rfcs/pull/2043#issuecomment-316818169), this is just the intrinsic (which is obviously unstable).
2017-08-30 08:06:42 +00:00
Guillaume Gomez
bba7fd9dd5 Temporary fix for a test (will require another update when this is fully merged) 2017-08-30 09:40:43 +02:00
Guillaume Gomez
f2774b7ac3 Print warning whatever the rendering mode 2017-08-30 09:40:43 +02:00
Guillaume Gomez
33d99e526e Set python binary name to python 2.7 2017-08-30 09:40:43 +02:00
Guillaume Gomez
e1367ef1b1 Update unstable-crate test 2017-08-30 09:40:43 +02:00
Guillaume Gomez
274543b9ca Add warnings when rustdoc html rendering differs 2017-08-30 09:40:43 +02:00