]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoImprove the appearance of markdown warnings
Nick Cameron [Fri, 1 Sep 2017 01:37:26 +0000 (13:37 +1200)]
Improve the appearance of markdown warnings

6 years agorustdoc: collect rendering warnings and print them in one place
Nick Cameron [Fri, 1 Sep 2017 00:24:26 +0000 (12:24 +1200)]
rustdoc: collect rendering warnings and print them in one place

6 years agoOnly emit warnings if the user is using Pulldown
Nick Cameron [Thu, 31 Aug 2017 23:22:18 +0000 (11:22 +1200)]
Only emit warnings if the user is using Pulldown

Also checks for differences after eliminating whitespace-only diffs.

Renames get_html_diff

6 years agoAuto merge of #41991 - GuillaumeGomez:rustdoc-html-diff, r=nrc
bors [Thu, 31 Aug 2017 08:52:03 +0000 (08:52 +0000)]
Auto merge of #41991 - GuillaumeGomez:rustdoc-html-diff, r=nrc

Add warnings when rustdoc html rendering differs

6 years agodowngrade libgit2
Guillaume Gomez [Thu, 31 Aug 2017 07:49:38 +0000 (09:49 +0200)]
downgrade libgit2

6 years agoAuto merge of #44186 - alexcrichton:rollup, r=alexcrichton
bors [Thu, 31 Aug 2017 01:16:17 +0000 (01:16 +0000)]
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

6 years agoUpdate libc to fix sparc compiles
Alex Crichton [Thu, 31 Aug 2017 00:58:39 +0000 (17:58 -0700)]
Update libc to fix sparc compiles

6 years agoMerge branch 'hide-trait-map' into rollup
Alex Crichton [Wed, 30 Aug 2017 16:12:53 +0000 (09:12 -0700)]
Merge branch 'hide-trait-map' into rollup

6 years agoRollup merge of #44172 - mattico:patch-2, r=frewsxcv
Alex Crichton [Wed, 30 Aug 2017 16:11:16 +0000 (11:11 -0500)]
Rollup merge of #44172 - mattico:patch-2, r=frewsxcv

Fix link in unstable book entry for Generators

6 years agoRollup merge of #44160 - AndyGauge:api-docs-macros, r=steveklabnik
Alex Crichton [Wed, 30 Aug 2017 16:11:15 +0000 (11:11 -0500)]
Rollup merge of #44160 - AndyGauge:api-docs-macros, r=steveklabnik

API docs: macros.  Standard Documentation Checklist

Fixes #29381
r? @steveklabnik

6 years agoRollup merge of #44157 - alexcrichton:no-specializes-cache, r=eddyb
Alex Crichton [Wed, 30 Aug 2017 16:11:14 +0000 (11:11 -0500)]
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

6 years agoAuto merge of #43932 - eddyb:const-scoping, r=nikomatsakis
bors [Wed, 30 Aug 2017 20:12:25 +0000 (20:12 +0000)]
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

6 years agoAdd license exceptions
Guillaume Gomez [Wed, 30 Aug 2017 18:07:58 +0000 (20:07 +0200)]
Add license exceptions

6 years agoRollup merge of #44125 - SergioBenitez:master, r=nrc
Alex Crichton [Wed, 30 Aug 2017 16:11:12 +0000 (11:11 -0500)]
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

6 years agoRollup merge of #44116 - alexcrichton:update-libc, r=Mark-Simulacrum
Alex Crichton [Wed, 30 Aug 2017 16:11:11 +0000 (11:11 -0500)]
Rollup merge of #44116 - alexcrichton:update-libc, r=Mark-Simulacrum

Update the libc submodule

Brings in a few fixes for wasm/asmjs

6 years agoRollup merge of #44089 - alexcrichton:trait-proc-macro, r=nrc
Alex Crichton [Wed, 30 Aug 2017 16:11:10 +0000 (11:11 -0500)]
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

6 years agoRollup merge of #44044 - mattico:string-splice-return, r=dtolnay
Alex Crichton [Wed, 30 Aug 2017 16:11:09 +0000 (11:11 -0500)]
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

6 years agoAuto merge of #43895 - JeremySorensen:master, r=alexcrichton
bors [Wed, 30 Aug 2017 15:43:09 +0000 (15:43 +0000)]
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)

6 years agoAuto merge of #43968 - petrochenkov:span2, r=michaelwoerister
bors [Wed, 30 Aug 2017 11:08:26 +0000 (11:08 +0000)]
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.

6 years agoRemove some false positive issues
Guillaume Gomez [Sun, 27 Aug 2017 10:40:56 +0000 (12:40 +0200)]
Remove some false positive issues

6 years agoAuto merge of #43903 - oli-obk:alignto, r=aturon
bors [Wed, 30 Aug 2017 08:06:42 +0000 (08:06 +0000)]
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).

6 years agoTemporary fix for a test (will require another update when this is fully merged)
Guillaume Gomez [Sun, 27 Aug 2017 12:47:35 +0000 (14:47 +0200)]
Temporary fix for a test (will require another update when this is fully merged)

6 years agoPrint warning whatever the rendering mode
Guillaume Gomez [Mon, 31 Jul 2017 21:04:32 +0000 (23:04 +0200)]
Print warning whatever the rendering mode

6 years agoSet python binary name to python 2.7
Guillaume Gomez [Fri, 14 Jul 2017 10:30:17 +0000 (12:30 +0200)]
Set python binary name to python 2.7

6 years agoUpdate unstable-crate test
Guillaume Gomez [Wed, 14 Jun 2017 11:35:45 +0000 (13:35 +0200)]
Update unstable-crate test

6 years agoAdd warnings when rustdoc html rendering differs
Guillaume Gomez [Sun, 14 May 2017 13:14:02 +0000 (15:14 +0200)]
Add warnings when rustdoc html rendering differs

6 years agoAuto merge of #43880 - arielb1:noninvasive-probe, r=nikomatsakis
bors [Wed, 30 Aug 2017 05:30:28 +0000 (05:30 +0000)]
Auto merge of #43880 - arielb1:noninvasive-probe, r=nikomatsakis

Remove the trait selection impl in method::probe

This removes the hacky trait selection reimplementation in `method::probe`, which occasionally comes and causes problems.

There are 2 issues I've found with this approach:
1. The older implementation sometimes had a "guess" type from an impl, which allowed subtyping to work. This is why I needed to make a change in `libtest`: there's an `impl<A> Clone for fn(A)` and we're calling `<for<'a> fn(&'a T) as Clone>::clone`. The older implementation would do a subtyping between the impl type and the trait type, so it would do the check for `<fn(A) as Clone>::clone`, and confirmation would continue with the subtyping. The newer implementation directly passes `<for<'a> fn(&'a T) as Clone>::clone` to selection, which fails. I'm not sure how big of a problem that would be in reality, especially after #43690 would remove the `Clone` problem, but I still want a crater run to avoid breaking the world.
2. The older implementation "looked into" impls to display error messages. I'm not sure that's an advantage - it looked exactly 1 level deep.

r? @eddyb

6 years agofix option for RUST_CONFIGURE_ARGS to be rust.ignore-git=false
Jeremy Sorensen [Wed, 30 Aug 2017 05:01:51 +0000 (22:01 -0700)]
fix option for RUST_CONFIGURE_ARGS to be rust.ignore-git=false

6 years agorustc: Make the `export_map` of TyCtxt private
Alex Crichton [Tue, 29 Aug 2017 18:10:22 +0000 (11:10 -0700)]
rustc: Make the `export_map` of TyCtxt private

This map, like `trait_map`, is calculated in resolve, but we want to be sure to
track it for incremental compliation. Hide it behind a query to get more
refactorings later.

6 years agoallow value of key/value pair argument to set option be boolean
Jeremy Sorensen [Wed, 30 Aug 2017 04:57:48 +0000 (21:57 -0700)]
allow value of key/value pair argument to set option be boolean

6 years agoFix link in unstable book entry for Generators
Matt Ickstadt [Wed, 30 Aug 2017 03:27:50 +0000 (22:27 -0500)]
Fix link in unstable book entry for Generators

6 years agoAuto merge of #44143 - alexcrichton:faster-bootstrap, r=Mark-Simulacrum
bors [Wed, 30 Aug 2017 02:56:48 +0000 (02:56 +0000)]
Auto merge of #44143 - alexcrichton:faster-bootstrap, r=Mark-Simulacrum

rustbuild: Avoid some extraneous rustc compiles on cross builds

This tweaks a few locations here and there to avoid compiling rustc too many times on our cross-builders on CI.

Closes https://github.com/rust-lang/rust/issues/44132

6 years agoAuto merge of #43938 - arielb1:closure-key, r=nikomatsakis
bors [Wed, 30 Aug 2017 00:25:23 +0000 (00:25 +0000)]
Auto merge of #43938 - arielb1:closure-key, r=nikomatsakis

Track closure signatures & kinds in freshened types

r? @nikomatsakis

6 years agobroken links resolved
Andy Gauge [Tue, 29 Aug 2017 23:39:11 +0000 (16:39 -0700)]
broken links resolved

6 years agoMake fields of `Span` public again
Vadim Petrochenkov [Tue, 29 Aug 2017 22:41:05 +0000 (01:41 +0300)]
Make fields of `Span` public again

This helps to avoid landing changes to rustc and rustfmt in one step

6 years agoNormalize order of `lo` and `hi` in `Span::new`
Vadim Petrochenkov [Tue, 29 Aug 2017 22:39:51 +0000 (01:39 +0300)]
Normalize order of `lo` and `hi` in `Span::new`

6 years agoMake fields of `Span` private
Vadim Petrochenkov [Mon, 31 Jul 2017 20:04:34 +0000 (23:04 +0300)]
Make fields of `Span` private

6 years agorustc: Make the `trait_map` of TyCtxt private
Alex Crichton [Tue, 29 Aug 2017 18:10:22 +0000 (11:10 -0700)]
rustc: Make the `trait_map` of TyCtxt private

This map is calculated in resolve, but we want to be sure to track it for
incremental compliation. Hide it behind a query to get more refactorings later.

6 years agoAuto merge of #44169 - arielb1:rollup, r=arielb1
bors [Tue, 29 Aug 2017 21:42:34 +0000 (21:42 +0000)]
Auto merge of #44169 - arielb1:rollup, r=arielb1

Rollup of 12 pull requests

- Successful merges: #43705, #43778, #43918, #44076, #44117, #44121, #44126, #44134, #44135, #44141, #44144, #44158
- Failed merges:

6 years agoRollup merge of #44158 - dtolnay:zero48, r=sfackler
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:41:04 +0000 (21:41 +0000)]
Rollup merge of #44158 - dtolnay:zero48, r=sfackler

Use a byte literal ASCII 0 instead of its decimal value

@SimonSapin noticed this in https://github.com/dtolnay/itoa/pull/8.

6 years agoRollup merge of #44144 - alexcrichton:faster-hash-and-sign, r=Mark-Simulacrum
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:41:03 +0000 (21:41 +0000)]
Rollup merge of #44144 - alexcrichton:faster-hash-and-sign, r=Mark-Simulacrum

rustbuild: Fix dependencies of build-manifest

No need to depend on librustc! All we need is libstd

Closes #44140

6 years agoRollup merge of #44141 - nrc:rls-preview-beta, r=alexcrichton
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:41:02 +0000 (21:41 +0000)]
Rollup merge of #44141 - nrc:rls-preview-beta, r=alexcrichton

Rename the rls component to rls-preview on beta/stable

Background is that we will have automatic renaming with the next rustup release. We'll then rename rls to rls-preview. In the meantime, this ensures beta/stable users will always have rls-preview.

r? @alexcrichton

6 years agoRollup merge of #44135 - GuillaumeGomez:fix-css-links, r=QuietMisdreavus
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:41:01 +0000 (21:41 +0000)]
Rollup merge of #44135 - GuillaumeGomez:fix-css-links, r=QuietMisdreavus

Fix invalid linker position

Fixes #44120.

Result isn't "optimal" though because there are spaces at the end of some lines.

6 years agoRollup merge of #44134 - vorner:x-py-unknown-cmd, r=nikomatsakis
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:41:00 +0000 (21:41 +0000)]
Rollup merge of #44134 - vorner:x-py-unknown-cmd, r=nikomatsakis

Fail ./x.py on invalid command

Make the ./x.py script fail when run with an invalid command, like:

```
./x.py nonsense
```

This helps in case of chaining multiple runs, eg.:

```
./x.py biuld && ./x.py test
```

6 years agoRollup merge of #44126 - laumann:config-doc-comments, r=nikomatsakis
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:59 +0000 (21:40 +0000)]
Rollup merge of #44126 - laumann:config-doc-comments, r=nikomatsakis

compiletest: Change Config comments to doc comments

I plan to make the same change in compiletest-rs, to have some documentation in [the docs](https://docs.rs/compiletest_rs/0.2.9/compiletest_rs/common/struct.Config.html).

6 years agoRollup merge of #44121 - ishitatsuyuki:bootstrap-deps-purge, r=Mark-Simulacrum
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:58 +0000 (21:40 +0000)]
Rollup merge of #44121 - ishitatsuyuki:bootstrap-deps-purge, r=Mark-Simulacrum

bootstrap: remove unneeded extern crate

The crate itself is internally referenced by serde_derive.

6 years agoRollup merge of #44117 - frewsxcv:frewsxcv-to-socket-addrs-examples, r=QuietMisdreavus
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:57 +0000 (21:40 +0000)]
Rollup merge of #44117 - frewsxcv:frewsxcv-to-socket-addrs-examples, r=QuietMisdreavus

Rewrite `std::net::ToSocketAddrs` doc examples.

in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios

done this as preliminary work while investigating https://github.com/rust-lang/rust/issues/22569

note: i haven't run doc tests on my machine for this, so would be good to confirm CI passes before approving

6 years agoRollup merge of #44076 - RalfJung:src, r=alexcrichton
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:56 +0000 (21:40 +0000)]
Rollup merge of #44076 - RalfJung:src, r=alexcrichton

include Cargo.{toml,lock} in rust-src tarball

The lock file is interesting because e.g. xargo could use it to build libstd against the same dependencies that were used for the main build. More generally speaking, just documenting in this form which exact dependencies should be used IMHO makes lots of sense.

I added the Cargo.toml mostly because having the lock without the toml feels odd. Of course, the toml contains references to paths that don't actually exist in the rust-src tarball. Not sure if that is considered a problem.

6 years agoRollup merge of #43918 - mystor:rustdoc-pound, r=QuietMisdreavus
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:55 +0000 (21:40 +0000)]
Rollup merge of #43918 - mystor:rustdoc-pound, r=QuietMisdreavus

Don't highlight # which does not start an attribute in rustdoc

Currently when we highlight some macros for rustdoc (e.g. `quote!` from https://github.com/dtolnay/quote), we get really bad syntax highlighting, because we assume that every token between a `#` character and the next `]` in the source must be an attribute.

This patch improves that highlighting behavior to instead only highlight after finding the `[` token after the `#` token.

(NOTE: I've only run this patch against https://github.com/nrc/rustdoc-highlight so if it doesn't build on travis that's why - I don't have a recent rustc build on this laptop)

I'm guessing r? @steveklabnik

6 years agoRollup merge of #43778 - topecongiro:handler-reset-err-count, r=arielb1
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:54 +0000 (21:40 +0000)]
Rollup merge of #43778 - topecongiro:handler-reset-err-count, r=arielb1

Add reset_err_count() to errors::Handler

The motivation here is to allow rustfmt to recover from parse errors after failing to parse macros (cc https://github.com/rust-lang-nursery/rustfmt/issues/1742).
r? @nrc

6 years agoRollup merge of #43705 - panicbit:option_ref_mut_cloned, r=aturon
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:53 +0000 (21:40 +0000)]
Rollup merge of #43705 - panicbit:option_ref_mut_cloned, r=aturon

libcore: Implement cloned() for Option<&mut T>

None

6 years agofix test failures in documentation change
Andrew Gauger [Tue, 29 Aug 2017 19:53:12 +0000 (12:53 -0700)]
fix test failures in documentation change

6 years agoAuto merge of #43648 - RalfJung:jemalloc-debug, r=alexcrichton
bors [Tue, 29 Aug 2017 17:32:13 +0000 (17:32 +0000)]
Auto merge of #43648 - RalfJung:jemalloc-debug, r=alexcrichton

Fix alloc_jemalloc debug feature

At least, I think that's how it should be.  'debug' is how the feature is called in liballoc_jemalloc/Cargo.toml and libstd/Cargo.toml. I verified this by making the build script panic rather than adding `--enable-debug`, and without this PR, the panic does not occur even when I set `debug-jemalloc = true` in config.toml. With the PR, the panic occurs as expected.

However, I actually have no idea what I am doing here.

6 years agoAPI docs: macros. Part of #29329 Standard Library Documentation Checklist.
Andy Gauge [Tue, 29 Aug 2017 17:17:33 +0000 (10:17 -0700)]
API docs: macros.  Part of #29329 Standard Library Documentation Checklist.

6 years agorustbuild: Don't require cross-compiled error index
Alex Crichton [Tue, 29 Aug 2017 01:33:01 +0000 (18:33 -0700)]
rustbuild: Don't require cross-compiled error index

All architectures use the same errors, no need to cross-compile a version only
to not look at it.

6 years agoUse a byte literal ASCII 0 instead of its decimal value
David Tolnay [Tue, 29 Aug 2017 17:01:12 +0000 (10:01 -0700)]
Use a byte literal ASCII 0 instead of its decimal value

6 years agoresolve type vars with obligations in more places
Ariel Ben-Yehuda [Mon, 21 Aug 2017 13:44:42 +0000 (16:44 +0300)]
resolve type vars with obligations in more places

This fixes a few cases of inference misses, some of them regressions
caused by the impl selected for a method not being immediately evaluated.

6 years agoCheck the substituted return type in return type suggestions.
Ariel Ben-Yehuda [Wed, 16 Aug 2017 18:23:44 +0000 (21:23 +0300)]
Check the substituted return type in return type suggestions.

Fixes #43420.

6 years agoremove the data from ClosureCandidate
Ariel Ben-Yehuda [Tue, 15 Aug 2017 20:30:13 +0000 (23:30 +0300)]
remove the data from ClosureCandidate

the data serves no purpose - it can be recovered from the obligation -
and I think may leak stale inference variables into global caches.

6 years agochange option for RUST_CONFIGURE_ARGS to ignore-git=false
Jeremy Sorensen [Tue, 29 Aug 2017 16:39:12 +0000 (09:39 -0700)]
change option for RUST_CONFIGURE_ARGS to ignore-git=false

6 years agorustc: Remove `specailization_cache` in favor of a query
Alex Crichton [Tue, 29 Aug 2017 16:25:25 +0000 (09:25 -0700)]
rustc: Remove `specailization_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!

6 years agoadd ignore-git=true option to RUST_CONFIGURE_ARGS
Jeremy Sorensen [Tue, 29 Aug 2017 15:27:30 +0000 (08:27 -0700)]
add ignore-git=true option to RUST_CONFIGURE_ARGS

6 years agogive up on trying to fix the assertion failure
Ralf Jung [Tue, 29 Aug 2017 14:09:38 +0000 (16:09 +0200)]
give up on trying to fix the assertion failure

6 years agoFix alloc_jemalloc debug feature
Ralf Jung [Fri, 4 Aug 2017 06:39:23 +0000 (23:39 -0700)]
Fix alloc_jemalloc debug feature

At least, I think that's how it should be.  'debug' is how the feature is called in Cargo.toml.

6 years agoremove the hacky selection impl in `method::probe`
Ariel Ben-Yehuda [Tue, 15 Aug 2017 10:41:54 +0000 (13:41 +0300)]
remove the hacky selection impl in `method::probe`

6 years agoTrack closure signatures & kinds in freshened types
Ariel Ben-Yehuda [Thu, 17 Aug 2017 14:38:16 +0000 (17:38 +0300)]
Track closure signatures & kinds in freshened types

This allows caching closure signatures and kinds in the normal selection
and evaluation caches, and fixes the exponential worst-case in
@remram44's example, which is a part of #43787.

This improvement is complenentary to #43999 - they fix different cases.

6 years agomake probe priority logic clearer
Ariel Ben-Yehuda [Mon, 14 Aug 2017 12:06:14 +0000 (15:06 +0300)]
make probe priority logic clearer

6 years agoAuto merge of #44111 - zackmdavis:feature_attr_error_span, r=nikomatsakis
bors [Tue, 29 Aug 2017 10:22:14 +0000 (10:22 +0000)]
Auto merge of #44111 - zackmdavis:feature_attr_error_span, r=nikomatsakis

feature error span on attribute for fn_must_use, SIMD/align reprs, macro reëxport

There were several feature-gated attributes for which the feature-not-available
error spans would point to the item annotated with the gated attribute, when it
would make more sense for the span to point to the attribute itself: if the
attribute is removed, the function/struct/_&c._ likely still makes sense and the
program will compile. (Note that we decline to make the analogous change for
the `main`, `start`, and `plugin_registrar` features, for in those cases it
makes sense for the span to implicate the entire function, of which there is
little hope of using without the gated attribute.)

![feature_attr_error_span](https://user-images.githubusercontent.com/1076988/29746531-fd700bfe-8a91-11e7-9c5b-6f5324083887.png)

6 years agoAuto merge of #44059 - oli-obk:ok_suggestion, r=nikomatsakis
bors [Tue, 29 Aug 2017 06:18:23 +0000 (06:18 +0000)]
Auto merge of #44059 - oli-obk:ok_suggestion, r=nikomatsakis

Suggest `Ok(())` when encountering `Result::<(), E>::Ok()`

6 years agouse an optional bool to keep track of ignore-git setting, if not specified by the...
Jeremy Sorensen [Tue, 29 Aug 2017 03:44:40 +0000 (20:44 -0700)]
use an optional bool to keep track of ignore-git setting, if not specified by the end, use the channel to determine its value

6 years agorustbuild: Fix dependencies of build-manifest
Alex Crichton [Tue, 29 Aug 2017 01:40:57 +0000 (18:40 -0700)]
rustbuild: Fix dependencies of build-manifest

No need to depend on librustc! All we need is libstd

Closes #44140

6 years agorustbuild: Fix uplifting stage1 on cross builds
Alex Crichton [Tue, 29 Aug 2017 01:32:29 +0000 (18:32 -0700)]
rustbuild: Fix uplifting stage1 on cross builds

When we pass `--host` the `self.hosts` array doesn't contain `self.build`, so
check `self.build` to see if we can uplift.

6 years agoRename the rls component to rls-preview on beta/stable
Nick Cameron [Tue, 29 Aug 2017 01:03:37 +0000 (13:03 +1200)]
Rename the rls component to rls-preview on beta/stable

6 years agoAuto merge of #44049 - alexcrichton:nounwind-allocators, r=BurntSushi
bors [Tue, 29 Aug 2017 00:58:17 +0000 (00:58 +0000)]
Auto merge of #44049 - alexcrichton:nounwind-allocators, r=BurntSushi

std: Mark allocation functions as nounwind

This commit flags all allocation-related functions in liballoc as "this can't
unwind" which should largely resolve the size-related issues found on #42808.
The documentation on the trait was updated with such a restriction (they can't
panic) as well as some other words about the relative instability about
implementing a bullet-proof allocator.

Closes #42808

6 years agoAuto merge of #43999 - arielb1:immediate-project, r=nikomatsakis
bors [Mon, 28 Aug 2017 20:42:27 +0000 (20:42 +0000)]
Auto merge of #43999 - arielb1:immediate-project, r=nikomatsakis

clear out projection subobligations after they are processed

After a projection was processed, its derived subobligations no longer
need any processing when encountered, and can be removed. This improves
the status of #43787.

This is actually complementary to #43938 - that PR fixes selection
caching (and @remram44's example, which "accidentally" worked because of
the buggy projection caching) while this PR fixes projection caching.

r? @nikomatsakis

6 years agoFix invalid linker position
Guillaume Gomez [Mon, 28 Aug 2017 20:40:09 +0000 (22:40 +0200)]
Fix invalid linker position

6 years agoAuto merge of #43076 - Zoxc:gen, r=arielb1
bors [Mon, 28 Aug 2017 16:36:03 +0000 (16:36 +0000)]
Auto merge of #43076 - Zoxc:gen, r=arielb1

Generator support

This adds experimental support for generators intended to land once https://github.com/rust-lang/rfcs/pull/2033 is approved.

This is not yet ready to be merged. Things to do:
- [x] Make closure arguments on generators an error
- [x] Spot FIXMEs
- [x] Pass make tidy
- [x] Write tests
- [x] Document the current syntax and semantics for generators somewhere
- [x] Use proper error message numbers
- [x] ~~Make the implicit argument type default to `()`~~

6 years agogetting rid of all changes due to this PR thus far, starting from a clean slate
Jeremy Sorensen [Mon, 28 Aug 2017 15:43:35 +0000 (08:43 -0700)]
getting rid of all changes due to this PR thus far, starting from a clean slate

6 years agostd: Mark allocation functions as nounwind
Alex Crichton [Tue, 22 Aug 2017 21:36:49 +0000 (14:36 -0700)]
std: Mark allocation functions as nounwind

This commit flags all allocation-related functions in liballoc as "this can't
unwind" which should largely resolve the size-related issues found on #42808.
The documentation on the trait was updated with such a restriction (they can't
panic) as well as some other words about the relative instability about
implementing a bullet-proof allocator.

Closes #42808

6 years agoUpdate the libc submodule
Alex Crichton [Mon, 17 Jul 2017 16:24:05 +0000 (09:24 -0700)]
Update the libc submodule

Brings in a few fixes for wasm/asmjs

6 years agoUpdate test issue-41783.rs for new attribute highlighting behaviour
Michael Layzell [Mon, 28 Aug 2017 14:52:49 +0000 (10:52 -0400)]
Update test issue-41783.rs for new attribute highlighting behaviour

6 years agoTweak rls submodule again
Alex Crichton [Mon, 28 Aug 2017 14:14:52 +0000 (07:14 -0700)]
Tweak rls submodule again

6 years agoRewrite `std::net::ToSocketAddrs` doc examples.
Corey Farwell [Sun, 27 Aug 2017 19:17:07 +0000 (12:17 -0700)]
Rewrite `std::net::ToSocketAddrs` doc examples.

in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios

6 years agoSuggest `Ok(())` when encountering `Ok()`
Oliver Schneider [Wed, 23 Aug 2017 13:40:05 +0000 (15:40 +0200)]
Suggest `Ok(())` when encountering `Ok()`

6 years agocompiletest: Change Config comments to doc comments
Thomas Jespersen [Mon, 28 Aug 2017 11:35:53 +0000 (13:35 +0200)]
compiletest: Change Config comments to doc comments

6 years agoAuto merge of #44114 - daboross:patch-1, r=dtolnay
bors [Mon, 28 Aug 2017 10:42:11 +0000 (10:42 +0000)]
Auto merge of #44114 - daboross:patch-1, r=dtolnay

Clarify that VecDeque::swap can panic

The previous documentation mentioned this, but ambiguously used the term "fail".

This clarifies that the function will panic if the index is out of bounds, instead of silently failing and not doing anything.

If there's anything else I can do to improve this PR, I'd be happy to do so! Just saw this when reading through the docs in passing - it was slightly unclear what "fail" meant.

6 years agoInitial diagnostic API for proc-macros.
Sergio Benitez [Mon, 28 Aug 2017 09:56:43 +0000 (02:56 -0700)]
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.

6 years agofeature error span on attr. for fn_must_use, SIMD/align, macro reëxport
Zack M. Davis [Sun, 27 Aug 2017 01:00:33 +0000 (18:00 -0700)]
feature error span on attr. for fn_must_use, SIMD/align, macro reëxport

There were several feature-gated attributes for which the
feature-not-available error spans would point to the item annotated with
the gated attribute, when it would make more sense for the span to point
to the attribute itself: if the attribute is removed, the
function/struct/&c. likely still makes sense and the program will
compile. (Note that we decline to make the analogous change for the
`main`, `start`, and `plugin_registrar` features, for in those cases it
makes sense for the span to implicate the entire function, of which
there is little hope of using without the gated attribute.)

6 years agoIgnore a threaded test on emscripten
Alex Crichton [Mon, 28 Aug 2017 06:37:50 +0000 (23:37 -0700)]
Ignore a threaded test on emscripten

6 years agorustc: treat impl associated consts like const items for constness.
Eduard-Mihai Burtescu [Sat, 26 Aug 2017 22:27:58 +0000 (01:27 +0300)]
rustc: treat impl associated consts like const items for constness.

6 years agorustc_mir: conservatively deny non-noop drops in constant contexts.
Eduard-Mihai Burtescu [Sat, 22 Jul 2017 12:18:52 +0000 (15:18 +0300)]
rustc_mir: conservatively deny non-noop drops in constant contexts.

6 years agorustc: use rvalue scope semantics for constant initializers.
Eduard-Mihai Burtescu [Fri, 21 Jul 2017 11:01:22 +0000 (14:01 +0300)]
rustc: use rvalue scope semantics for constant initializers.

6 years agoAuto merge of #44107 - alexcrichton:no-shell-configure, r=Mark-Simulacrum
bors [Mon, 28 Aug 2017 06:04:10 +0000 (06:04 +0000)]
Auto merge of #44107 - alexcrichton:no-shell-configure, r=Mark-Simulacrum

rustbuild: Rewrite the configure script in Python

This commit rewrites our ancient `./configure` script from shell into Python.
The impetus for this change is to remove `config.mk` which is just a vestige of
the old makefile build system at this point. Instead all configuration is now
solely done through `config.toml`.

The python script allows us to more flexibly program (aka we can use loops
easily) and create a `config.toml` which is based off `config.toml.example`.
This way we can preserve comments and munge various values as we see fit.

It is intended that the configure script here is a drop-in replacement for the
previous configure script, no functional change is intended. Also note that the
rationale for this is also because our build system requires Python, so having a
python script a bit earlier shouldn't cause too many problems.

Closes #40730
Closes #43295
Closes #42255
Closes #38058
Closes #32176

6 years agoUpdate the rls submodule again
Alex Crichton [Mon, 28 Aug 2017 04:01:16 +0000 (21:01 -0700)]
Update the rls submodule again

6 years agobootstrap: remove unneeded extern crate
Tatsuyuki Ishi [Mon, 28 Aug 2017 03:52:02 +0000 (12:52 +0900)]
bootstrap: remove unneeded extern crate

The crate itself is internally referenced by serde_derive.

6 years agorustbuild: Rewrite the configure script in Python
Alex Crichton [Sat, 26 Aug 2017 22:01:48 +0000 (15:01 -0700)]
rustbuild: Rewrite the configure script in Python

This commit rewrites our ancient `./configure` script from shell into Python.
The impetus for this change is to remove `config.mk` which is just a vestige of
the old makefile build system at this point. Instead all configuration is now
solely done through `config.toml`.

The python script allows us to more flexibly program (aka we can use loops
easily) and create a `config.toml` which is based off `config.toml.example`.
This way we can preserve comments and munge various values as we see fit.

It is intended that the configure script here is a drop-in replacement for the
previous configure script, no functional change is intended. Also note that the
rationale for this is also because our build system requires Python, so having a
python script a bit earlier shouldn't cause too many problems.

Closes #40730

6 years agoUpdate lock file
Alex Crichton [Mon, 28 Aug 2017 01:52:02 +0000 (18:52 -0700)]
Update lock file

6 years agoMerge branch 'master' of https://github.com/rust-lang/rust into gen
John Kåre Alsaker [Mon, 28 Aug 2017 00:41:16 +0000 (02:41 +0200)]
Merge branch 'master' of https://github.com/rust-lang/rust into gen

6 years agoUpdate rls
John Kåre Alsaker [Mon, 28 Aug 2017 00:39:17 +0000 (02:39 +0200)]
Update rls

6 years agoFail ./x.py on invalid command
Michal 'vorner' Vaner [Sun, 27 Aug 2017 17:20:03 +0000 (19:20 +0200)]
Fail ./x.py on invalid command

Make the ./x.py script fail when run with an invalid command, like:

  ./x.py nonsense

This helps in case of chaining multiple runs, eg.:

  ./x.py biuld && ./x.py test