]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoUpdate Rustfmt
Nick Cameron [Mon, 9 Apr 2018 08:26:46 +0000 (20:26 +1200)]
Update Rustfmt

6 years agoAuto merge of #49673 - ollie27:stab, r=sfackler
bors [Mon, 9 Apr 2018 03:32:32 +0000 (03:32 +0000)]
Auto merge of #49673 - ollie27:stab, r=sfackler

Correct a few stability attributes

* `const_indexing` language feature was stabilized in 1.26.0 by #46882
* `Display` impls for `PanicInfo` and `Location` were stabilized in 1.26.0 by #47687
* `TrustedLen` is still unstable so its impls should be as well even though `RangeInclusive` was stabilized by #47813
* `!Send` and `!Sync` for `Args` and `ArgsOs` were stabilized in 1.26.0 by #48005
* `EscapeDefault` has been stable since 1.0.0 so should continue to show that even though it was moved to core in #48735

This could be backported to beta like #49612

6 years agoAuto merge of #49770 - tamird:csv-dumper-comment, r=nrc
bors [Mon, 9 Apr 2018 00:50:39 +0000 (00:50 +0000)]
Auto merge of #49770 - tamird:csv-dumper-comment, r=nrc

Remove mention of CsvDumper

...it was removed in 9a47160.

Updates #18582.

r? @nrc

6 years agoAuto merge of #49774 - danc86:configure.py-tools, r=alexcrichton
bors [Sun, 8 Apr 2018 21:40:44 +0000 (21:40 +0000)]
Auto merge of #49774 - danc86:configure.py-tools, r=alexcrichton

configure.py --tools should set a list instead of a string

Currently the --tools option does not work because it is setting a string value
for 'build.tools'. It should be a list of strings instead.

6 years agoAuto merge of #49771 - tamird:incremental-no-stage-1, r=Mark-Simulacrum
bors [Sun, 8 Apr 2018 19:11:47 +0000 (19:11 +0000)]
Auto merge of #49771 - tamird:incremental-no-stage-1, r=Mark-Simulacrum

Don't default to stage 1 with incremental

Closes #43177.

r? @Mark-Simulacrum

6 years agoAuto merge of #49759 - ollie27:rustbuild_cargo, r=Mark-Simulacrum
bors [Sun, 8 Apr 2018 16:44:22 +0000 (16:44 +0000)]
Auto merge of #49759 - ollie27:rustbuild_cargo, r=Mark-Simulacrum

rustbuild: Fix setting initial cargo

Fixes #49741

r? @Mark-Simulacrum

6 years agoAuto merge of #49758 - bjorn3:miri_public_write_discriminant_value, r=oli-obk
bors [Sun, 8 Apr 2018 14:12:13 +0000 (14:12 +0000)]
Auto merge of #49758 - bjorn3:miri_public_write_discriminant_value, r=oli-obk

miri: Make write_discriminant_value public

6 years agoAuto merge of #49752 - sinkuu:fix_incrcmp_str_lit, r=oli-obk
bors [Sun, 8 Apr 2018 10:01:59 +0000 (10:01 +0000)]
Auto merge of #49752 - sinkuu:fix_incrcmp_str_lit, r=oli-obk

[incremental] Hash `Allocation`s

`HashSet::insert` returns `true` if the value did not exist, which is the timing we want to hash the `Allocation`.

Fixes #49595

cc @oli-obk

6 years agoconfigure.py --tools should set a list instead of a string
Dan Callaghan [Sun, 8 Apr 2018 04:59:15 +0000 (14:59 +1000)]
configure.py --tools should set a list instead of a string

Currently the --tools option does not work because it is setting a string value
for 'build.tools'. It should be a list of strings instead.

6 years agoAuto merge of #49714 - nikomatsakis:issue-49631, r=eddyb
bors [Sun, 8 Apr 2018 03:03:25 +0000 (03:03 +0000)]
Auto merge of #49714 - nikomatsakis:issue-49631, r=eddyb

mem-categorization, coherence fix

make mem-categorization use adjusted type for patterns: Fixes #49631

do not propagate `Err` when determing causal info: Fixes #48728

r? @eddyb

6 years agoDon't default to stage 1 with incremental
Tamir Duberstein [Sun, 8 Apr 2018 02:32:21 +0000 (22:32 -0400)]
Don't default to stage 1 with incremental

Closes #43177.

6 years agoRemove mention of CsvDumper
Tamir Duberstein [Sun, 8 Apr 2018 02:21:50 +0000 (22:21 -0400)]
Remove mention of CsvDumper

...it was removed in 9a47160.

Updates #18582.

6 years agoAuto merge of #49704 - leodasvacas:fix-#49344, r=nikomatsakis
bors [Sun, 8 Apr 2018 00:28:24 +0000 (00:28 +0000)]
Auto merge of #49704 - leodasvacas:fix-#49344, r=nikomatsakis

Fix regression in defaults #49344

Fixes #49344 by not checking the well-formedness wrt defaults of predicates that contain lifetimes, which is consistent with not checking generic predicates.

r? @nikomatsakis

6 years agoAuto merge of #49678 - bobtwinkles:fix_multiple_activations, r=nikomatsakis
bors [Sat, 7 Apr 2018 19:49:39 +0000 (19:49 +0000)]
Auto merge of #49678 - bobtwinkles:fix_multiple_activations, r=nikomatsakis

two-phase borrows: support multiple activations in one statement

The need for this has arisen since the introduction of two-phase borrows on
method autorefs in #49348. r'ing @pnkfelix to keep things off Niko's plate so he can make this redundant, and @pnkfelix is familiar with the code.

Fixes #49635
Fixes #49662

r? @pnkfelix

6 years agoAuto merge of #49672 - alexcrichton:fix-another-std-core-cycle, r=michaelwoerister
bors [Sat, 7 Apr 2018 17:14:46 +0000 (17:14 +0000)]
Auto merge of #49672 - alexcrichton:fix-another-std-core-cycle, r=michaelwoerister

Fix another circular deps link args issue

It turns out that the support in #49316 wasn't enough to handle all cases
notably the example in #48661. The underlying bug was connected to panic=abort
where lang items were listed in the `missing_lang_items` sets but didn't
actually exist anywhere.

This caused the linker backend to deduce that start-group/end-group wasn't
needed because not all items were defined. Instead the missing lang items that
don't actually need to have a definition are filtered out and not considered for
the start-group/end-group arguments

Closes #48661

6 years agoAuto merge of #49692 - sinkuu:main_fix, r=arielb1
bors [Sat, 7 Apr 2018 14:33:48 +0000 (14:33 +0000)]
Auto merge of #49692 - sinkuu:main_fix, r=arielb1

Fix ICE with `main`'s return type containing lifetimes

Fixes #48890

6 years agorustbuild: Fix setting initial cargo
Oliver Middleton [Sat, 7 Apr 2018 14:10:36 +0000 (15:10 +0100)]
rustbuild: Fix setting initial cargo

6 years agomiri: Make write_discriminant_value public
bjorn3 [Sat, 7 Apr 2018 12:39:24 +0000 (14:39 +0200)]
miri: Make write_discriminant_value public

6 years agoAuto merge of #49661 - alexcrichton:bump-bootstrap, r=nikomatsakis
bors [Sat, 7 Apr 2018 11:58:38 +0000 (11:58 +0000)]
Auto merge of #49661 - alexcrichton:bump-bootstrap, r=nikomatsakis

Bump the bootstrap compiler to 1.26.0 beta

Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language
features!

6 years agoAuto merge of #49753 - kennytm:rollup, r=kennytm
bors [Sat, 7 Apr 2018 09:30:10 +0000 (09:30 +0000)]
Auto merge of #49753 - kennytm:rollup, r=kennytm

Rollup of 9 pull requests

Successful merges:

 - #49510 (Fix anchor position on fields)
 - #49652 (Fix anchors issue when everything is collapsed)
 - #49702 (std: Inline some Termination-related methods)
 - #49728 (add emit_debug_gdb_scripts target option and ..)
 - #49731 (add THUMB targets to rustup manifest)
 - #49742 (Using X headings instead of 0.X #49739)
 - #49748 (proc_macro: Improve Debug representations)
 - #49750 (bootstrap: Remove the fast path)
 - #49503 (Inject the `compiler_builtins` crate whenever the `core` crate is injected)

Failed merges:

6 years agoRollup merge of #49503 - oli-obk:extern_crate_compiler_builtins, r=alexcrichton
kennytm [Sat, 7 Apr 2018 07:36:57 +0000 (15:36 +0800)]
Rollup merge of #49503 - oli-obk:extern_crate_compiler_builtins, r=alexcrichton

Inject the `compiler_builtins` crate whenever the `core` crate is injected

6 years agoInject the `compiler_builtins` crate whenever the `core` crate is injected
Oliver Schneider [Fri, 30 Mar 2018 11:06:34 +0000 (13:06 +0200)]
Inject the `compiler_builtins` crate whenever the `core` crate is injected

6 years agoRollup merge of #49750 - ishitatsuyuki:boot-no-fast, r=Mark-Simulacrum
kennytm [Sat, 7 Apr 2018 06:51:34 +0000 (14:51 +0800)]
Rollup merge of #49750 - ishitatsuyuki:boot-no-fast, r=Mark-Simulacrum

bootstrap: Remove the fast path

This is rarely noticed, but when you have old submodules, not updating them will cause you run into https://github.com/rust-lang/cargo/issues/4678.

(Reopen of #49721)

r? @alexcrichton

6 years agoRollup merge of #49748 - alexcrichton:proc-macro-debug, r=dtolnay
kennytm [Sat, 7 Apr 2018 06:51:33 +0000 (14:51 +0800)]
Rollup merge of #49748 - alexcrichton:proc-macro-debug, r=dtolnay

proc_macro: Improve Debug representations

This commit improves the `fmt::Debug` output of `proc_macro` data structures by
primarily focusing on the representation exposed by `proc_macro` rather than the
compiler's own internal representation. This cuts down quite a bit on assorted
wrapper types and ensure a relatively clean output.

Closes #49720

6 years agoRollup merge of #49742 - Pulkit07:master, r=steveklabnik
kennytm [Sat, 7 Apr 2018 06:51:32 +0000 (14:51 +0800)]
Rollup merge of #49742 - Pulkit07:master, r=steveklabnik

Using X headings instead of 0.X #49739

Fix #49739

6 years agoRollup merge of #49731 - japaric:std-thumb-for-real, r=alexcrichton
kennytm [Sat, 7 Apr 2018 06:51:31 +0000 (14:51 +0800)]
Rollup merge of #49731 - japaric:std-thumb-for-real, r=alexcrichton

add THUMB targets to rustup manifest

as instructed in https://github.com/rust-lang/rust/pull/49563#issuecomment-379271327

r? @alexcrichton

6 years agoRollup merge of #49728 - japaric:no-debug_gdb_scripts, r=alexcrichton
kennytm [Sat, 7 Apr 2018 06:51:30 +0000 (14:51 +0800)]
Rollup merge of #49728 - japaric:no-debug_gdb_scripts, r=alexcrichton

add emit_debug_gdb_scripts target option and ..

set it to false for no-std targets like ARM Cortex-M and MSP430. For the rationale of this change see the comment in thumb_base.rs

this is a temporary workaround until #44993 is implemented

r? @alexcrichton or @michaelwoerister

6 years agoRollup merge of #49702 - alexcrichton:inline-methods, r=Mark-Simulacrum
kennytm [Sat, 7 Apr 2018 06:51:28 +0000 (14:51 +0800)]
Rollup merge of #49702 - alexcrichton:inline-methods, r=Mark-Simulacrum

std: Inline some Termination-related methods

These were showing up in tests and in binaries but are trivially optimize-able
away, so add `#[inline]` attributes so LLVM has an opportunity to optimize them
out.

6 years agoRollup merge of #49652 - GuillaumeGomez:anchor-collapsed, r=QuietMisdreavus
kennytm [Sat, 7 Apr 2018 06:51:27 +0000 (14:51 +0800)]
Rollup merge of #49652 - GuillaumeGomez:anchor-collapsed, r=QuietMisdreavus

Fix anchors issue when everything is collapsed

Fixes #49455.

@frewsxcv does it seem good for you like this?

r? @QuietMisdreavus

6 years agoRollup merge of #49510 - GuillaumeGomez:anchor-field-position, r=QuietMisdreavus
kennytm [Sat, 7 Apr 2018 06:51:26 +0000 (14:51 +0800)]
Rollup merge of #49510 - GuillaumeGomez:anchor-field-position, r=QuietMisdreavus

Fix anchor position on fields

Take a look at `Option` variants for example and try to click on `§` to get the issue.

r? @QuietMisdreavus

6 years agoPrint proc_macro spans as a half-open range
David Tolnay [Sat, 7 Apr 2018 05:57:10 +0000 (22:57 -0700)]
Print proc_macro spans as a half-open range

A span covering a single byte, such as for an operator `+` token, should
print as e.g. `80..81` rather than `80...81`. The lo end of the range is
inclusive and the hi end is exclusive.

6 years agoAuto merge of #49419 - leodasvacas:small-typeck-refactorings, r=nikomatsakis
bors [Sat, 7 Apr 2018 05:33:11 +0000 (05:33 +0000)]
Auto merge of #49419 - leodasvacas:small-typeck-refactorings, r=nikomatsakis

Small typeck refactorings

Some code improvements I noticed while reading the code.

6 years ago[incremental] Hash `Allocation`s
Shotaro Yamada [Sat, 7 Apr 2018 02:18:04 +0000 (11:18 +0900)]
[incremental] Hash `Allocation`s

6 years agoAuto merge of #49222 - Zoxc:print-query-stack, r=nikomatsakis
bors [Sat, 7 Apr 2018 02:51:17 +0000 (02:51 +0000)]
Auto merge of #49222 - Zoxc:print-query-stack, r=nikomatsakis

Print query stack on ICEs

ICE output is now:
```
thread 'rustc' panicked at 'no borrowck', librustc_borrowck\borrowck\mod.rs:95:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
query stack during panic:
#0 [borrowck] processing `main`
  --> no-std.rs:10:1
   |
10 | fn main() {}
   | ^^^^^^^^^
end of query stack

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.26.0-dev running on x86_64-pc-windows-msvc
```

Fixes #42529.

r? @eddyb

6 years agoAuto merge of #49623 - steveklabnik:update-mdbook, r=GuillaumeGomez
bors [Sat, 7 Apr 2018 00:20:21 +0000 (00:20 +0000)]
Auto merge of #49623 - steveklabnik:update-mdbook, r=GuillaumeGomez

update mdbook

This includes search for all books, a long-requested feature!

6 years agoproc_macro: Improve Debug representations
Alex Crichton [Fri, 6 Apr 2018 22:20:57 +0000 (15:20 -0700)]
proc_macro: Improve Debug representations

This commit improves the `fmt::Debug` output of `proc_macro` data structures by
primarily focusing on the representation exposed by `proc_macro` rather than the
compiler's own internal representation. This cuts down quite a bit on assorted
wrapper types and ensure a relatively clean output.

Closes #49720

6 years agoAuto merge of #49392 - retep007:nll-issue-48962, r=nikomatsakis
bors [Fri, 6 Apr 2018 21:50:12 +0000 (21:50 +0000)]
Auto merge of #49392 - retep007:nll-issue-48962, r=nikomatsakis

fixes move analysis

Fixed compiler error by correct checking when dereferencing

Fix #48962

r? @nikomatsakis

6 years agoUsing X headings instead of 0.X #49739
Pulkit Goyal [Fri, 6 Apr 2018 19:12:47 +0000 (00:42 +0530)]
Using X headings instead of 0.X #49739

6 years agoAdd test from #49736
bobtwinkles [Fri, 6 Apr 2018 19:00:45 +0000 (15:00 -0400)]
Add test from #49736

Fixes #49736

6 years agoAuto merge of #49064 - QuietMisdreavus:piercing-the-veil, r=GuillaumeGomez
bors [Fri, 6 Apr 2018 17:38:41 +0000 (17:38 +0000)]
Auto merge of #49064 - QuietMisdreavus:piercing-the-veil, r=GuillaumeGomez

rustdoctest: suppress the default allow(unused) under --display-warnings

If you're passing rustdoc `--display-warnings`, you probably want to see the default ones too. This change modifies `test::make_test` to suppress the default `#![allow(unused)]` if the `--display-warnings` CLI flag was provided to rustdoc.

cc https://github.com/rust-lang/rust/issues/41574

6 years agoAuto merge of #48779 - michaelwoerister:share-generics4, r=alexcrichton
bors [Fri, 6 Apr 2018 15:01:27 +0000 (15:01 +0000)]
Auto merge of #48779 - michaelwoerister:share-generics4, r=alexcrichton

Allow for re-using monomorphizations in upstream crates.

Followup to #48611. This implementation is pretty much finished modulo failing tests if there are any. Not quite ready for review yet though.

### DESCRIPTION

This PR introduces a `share-generics` mode for RLIBs and Rust dylibs. When a crate is compiled in this mode, two things will happen:
- before instantiating a monomorphization in the current crate, the compiler will look for that monomorphization in all upstream crates and link to it, if possible.
- monomorphizations are not internalized during partitioning. Instead they are added to the list of symbols exported from the crate.

This results in less code being translated and LLVMed. However, there are also downsides:
- it will impede optimization somewhat, since fewer functions can be internalized, and
- Rust dylibs will have bigger symbol tables since they'll also export monomorphizations.

Consequently, this PR only enables the `shared-generics` mode for opt-levels `No`, `Less`, `Size`, and `MinSize`, and for when incremental compilation is activated. `-O2` and `-O3` will still generate generic functions per-crate.

Another thing to note is that this has a somewhat similar effect as MIR-only RLIBs, in that monomorphizations are shared, but it is less effective because it cannot share monomorphizations between sibling crates:

```
         A        <--- defines `fn foo<T>() { .. }`
       /   \
      /     \
     B       C    <--- both call `foo<u32>()`
      \     /
       \   /
         D        <--- calls `foo<u32>()` too
```

With `share-generics`, both `B` and `C` have to instantiate `foo<u32>` and only `D` can re-use it (from either `B` or `C`). With MIR-only RLIBs, `B` and `C` would not instantiate anything, and in `D` we would then only instantiate `foo<u32>` once.
On the other hand, when there are many leaf crates in the graph (e.g. when compiling many individual test binaries) then the `share-generics` approach will often be more effective.

### TODO
 - [x] Add codegen test that makes sure monomorphizations can be internalized in non-Rust binaries.
 - [x] Add codegen-units test that makes sure we share generics.
 - [x] Add run-make test that makes sure we don't export any monomorphizations from non-Rust binaries.
 - [x] Review for reproducible-builds implications.

6 years agoadd THUMB targets to rustup manifest
Jorge Aparicio [Fri, 6 Apr 2018 14:35:03 +0000 (16:35 +0200)]
add THUMB targets to rustup manifest

6 years agoPrint query stack on ICEs
John Kåre Alsaker [Tue, 20 Mar 2018 22:41:25 +0000 (23:41 +0100)]
Print query stack on ICEs

6 years agorefactor: simplify `needs_gdb_debug_scripts_section`
Jorge Aparicio [Fri, 6 Apr 2018 13:44:08 +0000 (15:44 +0200)]
refactor: simplify `needs_gdb_debug_scripts_section`

6 years agoadd emit_debug_gdb_scripts target option and ..
Jorge Aparicio [Fri, 6 Apr 2018 13:40:43 +0000 (15:40 +0200)]
add emit_debug_gdb_scripts target option and ..

set it to false for no-std targets like ARM Cortex-M and MSP430. For the rationale of this change
see the comment in thumb_base.rs

6 years agoAuto merge of #49335 - GuillaumeGomez:remove-unneeded-trait-implementations-title...
bors [Fri, 6 Apr 2018 12:03:16 +0000 (12:03 +0000)]
Auto merge of #49335 - GuillaumeGomez:remove-unneeded-trait-implementations-title, r=QuietMisdreavus

Remove unneeded trait implementations titles

r? @QuietMisdreavus

6 years agoUpdate run-make/symbol-visibility to also cover shared-generics
Michael Woerister [Tue, 13 Mar 2018 13:21:50 +0000 (14:21 +0100)]
Update run-make/symbol-visibility to also cover shared-generics

6 years agoAllow for re-using hidden monomorphizations on platforms that don't support Rust...
Michael Woerister [Wed, 21 Mar 2018 11:23:57 +0000 (12:23 +0100)]
Allow for re-using hidden monomorphizations on platforms that don't support Rust dylibs.

6 years agoUpdate a few comments about symbol visibility.
Michael Woerister [Wed, 14 Mar 2018 15:45:06 +0000 (16:45 +0100)]
Update a few comments about symbol visibility.

6 years agoAdd codegen-units test for shared-generics.
Michael Woerister [Tue, 13 Mar 2018 13:26:49 +0000 (14:26 +0100)]
Add codegen-units test for shared-generics.

6 years agoMake sure that generics are internalized in executables even with -Zshare-generics
Michael Woerister [Tue, 13 Mar 2018 13:24:03 +0000 (14:24 +0100)]
Make sure that generics are internalized in executables even with -Zshare-generics

6 years agoDon't internalize generics that are re-exported
Michael Woerister [Tue, 13 Mar 2018 13:21:00 +0000 (14:21 +0100)]
Don't internalize generics that are re-exported

6 years agoFix some rebasing fallout.
Michael Woerister [Tue, 13 Mar 2018 10:52:26 +0000 (11:52 +0100)]
Fix some rebasing fallout.

6 years agoSelect upstream monomorphizations in a stable way.
Michael Woerister [Mon, 12 Mar 2018 17:28:53 +0000 (18:28 +0100)]
Select upstream monomorphizations in a stable way.

6 years agoAdapt codegen-unit test to shared-generics.
Michael Woerister [Wed, 7 Mar 2018 11:01:28 +0000 (12:01 +0100)]
Adapt codegen-unit test to shared-generics.

6 years agoAllow for internalizing monomorphizations that cannot be shared.
Michael Woerister [Tue, 6 Mar 2018 13:44:14 +0000 (14:44 +0100)]
Allow for internalizing monomorphizations that cannot be shared.

6 years agoRemove the (inaccurate) symbol_export_level query.
Michael Woerister [Tue, 6 Mar 2018 11:20:50 +0000 (12:20 +0100)]
Remove the (inaccurate) symbol_export_level query.

6 years agoMake generics sharing the default for non-optimized builds.
Michael Woerister [Tue, 6 Mar 2018 10:56:01 +0000 (11:56 +0100)]
Make generics sharing the default for non-optimized builds.

6 years agoAllow for re-using monomorphizations from upstream crates.
Michael Woerister [Tue, 6 Mar 2018 09:33:42 +0000 (10:33 +0100)]
Allow for re-using monomorphizations from upstream crates.

6 years agoMove export level computation to reachable_non_generics query.
Michael Woerister [Tue, 6 Mar 2018 09:18:48 +0000 (10:18 +0100)]
Move export level computation to reachable_non_generics query.

6 years agoAllow for representing exported monomorphizations in crate metadata.
Michael Woerister [Thu, 1 Mar 2018 15:50:08 +0000 (16:50 +0100)]
Allow for representing exported monomorphizations in crate metadata.

6 years agoFix incomplete ICH implementation for ty::subst::UnpackedKind.
Michael Woerister [Thu, 1 Mar 2018 15:48:03 +0000 (16:48 +0100)]
Fix incomplete ICH implementation for ty::subst::UnpackedKind.

6 years agoAuto merge of #49154 - petrochenkov:spident, r=eddyb
bors [Fri, 6 Apr 2018 09:32:03 +0000 (09:32 +0000)]
Auto merge of #49154 - petrochenkov:spident, r=eddyb

AST: Give spans to all identifiers

Change representation of `ast::Ident` from `{ name: Symbol, ctxt: SyntaxContext }` to `{ name: Symbol, span: Span }`.
Syntax contexts still can be extracted from spans (`span.ctxt()`).

Why this should not require more memory:
- `Span` is `u32` just like `SyntaxContext`.
- Despite keeping more spans in AST we don't actually *create* more spans, so the number of "outlined" spans kept in span interner shouldn't become larger.

Why this may be slightly slower:
- When we need to extract ctxt from an identifier instead of just field read we need to do bit field extraction possibly followed by and access by index into span interner's vector. Both operations should be fast (unless the span interner is under some synchronization) and we already do ctxt extraction from spans all the time during macro expansion, so the difference should be lost in noise.

cc https://github.com/rust-lang/rust/pull/48842#issuecomment-373365661

6 years agoFix feature gating for crate/extern in paths
Vadim Petrochenkov [Sun, 25 Mar 2018 15:51:32 +0000 (18:51 +0300)]
Fix feature gating for crate/extern in paths

6 years agoUse `Ident` instead of `Name` in `MetaItem`
Vadim Petrochenkov [Sat, 24 Mar 2018 18:17:27 +0000 (21:17 +0300)]
Use `Ident` instead of `Name` in `MetaItem`

6 years agoFix stable hash for identifiers
Vadim Petrochenkov [Sat, 24 Mar 2018 17:28:44 +0000 (20:28 +0300)]
Fix stable hash for identifiers

6 years agoMake lifetime nonterminals closer to identifier nonterminals
Vadim Petrochenkov [Sat, 24 Mar 2018 16:49:50 +0000 (19:49 +0300)]
Make lifetime nonterminals closer to identifier nonterminals

6 years agoRemove more duplicated spans
Vadim Petrochenkov [Mon, 19 Mar 2018 00:54:56 +0000 (03:54 +0300)]
Remove more duplicated spans

6 years agoRename `ast::Variant_::name` into `ident` + Fix rebase
Vadim Petrochenkov [Sun, 18 Mar 2018 22:21:30 +0000 (01:21 +0300)]
Rename `ast::Variant_::name` into `ident` + Fix rebase

6 years agoUse `Span::apply_mark` where possible
Vadim Petrochenkov [Sun, 18 Mar 2018 20:51:53 +0000 (23:51 +0300)]
Use `Span::apply_mark` where possible

6 years agoGet rid of `SpannedIdent`
Vadim Petrochenkov [Sun, 18 Mar 2018 13:47:09 +0000 (16:47 +0300)]
Get rid of `SpannedIdent`

6 years agoRename `PathSegment::identifier` to `ident`
Vadim Petrochenkov [Sun, 18 Mar 2018 00:53:41 +0000 (03:53 +0300)]
Rename `PathSegment::identifier` to `ident`

6 years agoUse `Span` instead of `SyntaxContext` in `Ident`
Vadim Petrochenkov [Sat, 17 Mar 2018 23:57:23 +0000 (02:57 +0300)]
Use `Span` instead of `SyntaxContext` in `Ident`

6 years agobootstrap: Remove the fast path
Tatsuyuki Ishi [Fri, 6 Apr 2018 07:23:53 +0000 (16:23 +0900)]
bootstrap: Remove the fast path

This is rarely noticed, but when you have old submodules, not updating them will cause you run into https://github.com/rust-lang/cargo/issues/4678.

6 years agoAuto merge of #49293 - memoryleak47:add-compiletest-nll-compare-mode, r=pnkfelix
bors [Fri, 6 Apr 2018 07:04:20 +0000 (07:04 +0000)]
Auto merge of #49293 - memoryleak47:add-compiletest-nll-compare-mode, r=pnkfelix

Add compiletest `--compare-mode nll` option

Before implementing the tidy stuff, I'd appreciate if someone reviews the changes so far.
This is my first non-trivial pull request, so I could really use some feedback. :)
closes #48879.

r? @nikomatsakis

6 years agodo not propagate `Err` when determing causal info
Niko Matsakis [Fri, 6 Apr 2018 00:15:23 +0000 (20:15 -0400)]
do not propagate `Err` when determing causal info

In intercrate mode, if we determine that a particular `T: Trait` is
unknowable, we sometimes also go and get extra causal information. An
errant `?` was causing us to propagate an error found in that process
out as if `T: Trait` was not unknowable but rather not provable. This
led to an ICE.

6 years agoadd `failure-status: 1` to the test
Niko Matsakis [Thu, 5 Apr 2018 23:01:45 +0000 (19:01 -0400)]
add `failure-status: 1` to the test

6 years agomake mem-categorization use adjusted type for patterns
Niko Matsakis [Thu, 5 Apr 2018 21:16:07 +0000 (17:16 -0400)]
make mem-categorization use adjusted type for patterns

Fixes #49631

6 years agoAuto merge of #49696 - alexcrichton:rollup, r=alexcrichton
bors [Thu, 5 Apr 2018 19:25:37 +0000 (19:25 +0000)]
Auto merge of #49696 - alexcrichton:rollup, r=alexcrichton

Rollup of 8 pull requests

Successful merges:

 - #49045 (Make queries thread safe)
 - #49350 (Expand macros in `extern {}` blocks)
 - #49497 (Chalkify - Tweak `Clause` definition and HRTBs)
 - #49597 (proc_macro: Reorganize public API)
 - #49686 (typos)
- #49621
- #49697
- #49705

Failed merges:

6 years agoupdate mdbook
steveklabnik [Tue, 3 Apr 2018 14:32:04 +0000 (10:32 -0400)]
update mdbook

This includes search for all books, a long-requested feature!

6 years agoRollup merge of #49705 - alexcrichton:less-manifest-docs, r=kennytm
Alex Crichton [Thu, 5 Apr 2018 19:03:03 +0000 (12:03 -0700)]
Rollup merge of #49705 - alexcrichton:less-manifest-docs, r=kennytm

6 years agoRollup merge of #49697 - kennytm:name-every-builder, r=aturon
Alex Crichton [Thu, 5 Apr 2018 18:50:46 +0000 (11:50 -0700)]
Rollup merge of #49697 - kennytm:name-every-builder, r=aturon

6 years agoRollup merge of #49621 - Nemo157:impl-unpin-for-pin, r=withoutboats
Alex Crichton [Thu, 5 Apr 2018 18:50:12 +0000 (11:50 -0700)]
Rollup merge of #49621 - Nemo157:impl-unpin-for-pin, r=withoutboats

6 years agoFilter out missing components from manifests
Alex Crichton [Thu, 5 Apr 2018 18:36:01 +0000 (11:36 -0700)]
Filter out missing components from manifests

This commit updates our manifest generation for rustup to filter out any
components/extensions which are actually missing. This is intended to help
mitigate #49462 by making the manifests reflect reality, that many targets now
are missing a `rust-docs` component rather than requiring it exists.

6 years agoFix #49344
leonardo.yvens [Thu, 5 Apr 2018 18:21:56 +0000 (15:21 -0300)]
Fix #49344

6 years agoRollup merge of #49686 - memoryleak47:typo, r=alexcrichton
Alex Crichton [Thu, 5 Apr 2018 15:49:21 +0000 (10:49 -0500)]
Rollup merge of #49686 - memoryleak47:typo, r=alexcrichton

typos

6 years agoRollup merge of #49597 - alexcrichton:proc-macro-v2, r=petrochenkov
Alex Crichton [Thu, 5 Apr 2018 15:49:20 +0000 (10:49 -0500)]
Rollup merge of #49597 - alexcrichton:proc-macro-v2, r=petrochenkov

proc_macro: Reorganize public API

This commit is a reorganization of the `proc_macro` crate's public user-facing
API. This is the result of a number of discussions at the recent Rust All-Hands
where we're hoping to get the `proc_macro` crate into ship shape for
stabilization of a subset of its functionality in the Rust 2018 release.

The reorganization here is motivated by experiences from the `proc-macro2`,
`quote`, and `syn` crates on crates.io (and other crates which depend on them).
The main focus is future flexibility along with making a few more operations
consistent and/or fixing bugs. A summary of the changes made from today's
`proc_macro` API is:

* The `TokenNode` enum has been removed and the public fields of `TokenTree`
  have also been removed. Instead the `TokenTree` type is now a public enum
  (what `TokenNode` was) and each variant is an opaque struct which internally
  contains `Span` information. This makes the various tokens a bit more
  consistent, require fewer wrappers, and otherwise provides good
  future-compatibility as opaque structs are easy to modify later on.

* `Literal` integer constructors have been expanded to be unambiguous as to what
  they're doing and also allow for more future flexibility. Previously
  constructors like `Literal::float` and `Literal::integer` were used to create
  unsuffixed literals and the concrete methods like `Literal::i32` would create
  a suffixed token. This wasn't immediately clear to all users (the
  suffixed/unsuffixed aspect) and having *one* constructor for unsuffixed
  literals required us to pick a largest type which may not always be true. To
  fix these issues all constructors are now of the form
  `Literal::i32_unsuffixed` or `Literal::i32_suffixed` (for all integral types).
  This should allow future compatibility as well as being immediately clear
  what's suffixed and what isn't.

* Each variant of `TokenTree` internally contains a `Span` which can also be
  configured via `set_span`. For example `Literal` and `Term` now both
  internally contain a `Span` rather than having it stored in an auxiliary
  location.

* Constructors of all tokens are called `new` now (aka `Term::intern` is gone)
  and most do not take spans. Manufactured tokens typically don't have a fresh
  span to go with them and the span is purely used for error-reporting
  **except** the span for `Term`, which currently affects hygiene. The default
  spans for all these constructed tokens is `Span::call_site()` for now.

  The `Term` type's constructor explicitly requires passing in a `Span` to
  provide future-proofing against possible hygiene changes. It's intended that a
  first pass of stabilization will likely only stabilize `Span::call_site()`
  which is an explicit opt-in for "I would like no hygiene here please". The
  intention here is to make this explicit in procedural macros to be
  forwards-compatible with a hygiene-specifying solution.

* Some of the conversions for `TokenStream` have been simplified a little.

* The `TokenTreeIter` iterator was renamed to `token_stream::IntoIter`.

Overall the hope is that this is the "final pass" at the API of `TokenStream`
and most of `TokenTree` before stabilization. Explicitly left out here is any
changes to `Span`'s API which will likely need to be re-evaluated before
stabilization.

All changes in this PR have already been reflected to the [`proc-macro2`],
`quote`, and `syn` crates. New versions of all these crates have also been
published to crates.io.

Once this lands in nightly I plan on making an internals post again summarizing
the changes made here and also calling on all macro authors to give the APIs a
spin and see how they work. Hopefully pending no major issues we can then have
an FCP to stabilize later this cycle!

[`proc-macro2`]: https://docs.rs/proc-macro2/0.3.1/proc_macro2/

Closes #49596

6 years agoRollup merge of #49497 - scalexm:hrtb, r=nikomatsakis
Alex Crichton [Thu, 5 Apr 2018 15:49:19 +0000 (10:49 -0500)]
Rollup merge of #49497 - scalexm:hrtb, r=nikomatsakis

Chalkify - Tweak `Clause` definition and HRTBs

r? @nikomatsakis

6 years agostd: Inline some Termination-related methods
Alex Crichton [Thu, 5 Apr 2018 18:07:19 +0000 (11:07 -0700)]
std: Inline some Termination-related methods

These were showing up in tests and in binaries but are trivially optimize-able
away, so add `#[inline]` attributes so LLVM has an opportunity to optimize them
out.

6 years agoimpl Unpin for PinBox
Wim Looman [Thu, 5 Apr 2018 18:03:02 +0000 (20:03 +0200)]
impl Unpin for PinBox

6 years agoGive a name to every CI job.
kennytm [Thu, 5 Apr 2018 17:09:59 +0000 (01:09 +0800)]
Give a name to every CI job.

Bots that read the log can simply look for `[CI_JOB_NAME=...]` to find out
the job's name.

6 years agoAuto merge of #49045 - Zoxc:tls, r=michaelwoerister
bors [Thu, 5 Apr 2018 16:38:15 +0000 (16:38 +0000)]
Auto merge of #49045 - Zoxc:tls, r=michaelwoerister

Make queries thread safe

This makes queries thread safe by removing the query stack and making queries point to their parents. Queries write to the query map when starting and cycles are detected by checking if there's already an entry in the query map. This makes cycle detection O(1) instead of O(n), where `n` is the size of the query stack.

This is mostly corresponds to the method I described [here](https://internals.rust-lang.org/t/parallelizing-rustc-using-rayon/6606).

cc @rust-lang/compiler

r? @michaelwoerister

6 years agoRollup merge of #49350 - abonander:macros-in-extern, r=petrochenkov
Alex Crichton [Thu, 5 Apr 2018 15:49:14 +0000 (10:49 -0500)]
Rollup merge of #49350 - abonander:macros-in-extern, r=petrochenkov

Expand macros in `extern {}` blocks

This permits macro and proc-macro and attribute invocations (the latter only with the `proc_macro` feature of course) in `extern {}` blocks, gated behind a new `macros_in_extern` feature.

A tracking issue is now open at #49476

closes #48747

6 years agoRollup merge of #49045 - Zoxc:tls, r=michaelwoerister
Alex Crichton [Thu, 5 Apr 2018 15:49:13 +0000 (10:49 -0500)]
Rollup merge of #49045 - Zoxc:tls, r=michaelwoerister

Make queries thread safe

This makes queries thread safe by removing the query stack and making queries point to their parents. Queries write to the query map when starting and cycles are detected by checking if there's already an entry in the query map. This makes cycle detection O(1) instead of O(n), where `n` is the size of the query stack.

This is mostly corresponds to the method I described [here](https://internals.rust-lang.org/t/parallelizing-rustc-using-rayon/6606).

cc @rust-lang/compiler

r? @michaelwoerister

6 years agoFix ICE with `main`'s return type containing lifetimes
Shotaro Yamada [Thu, 5 Apr 2018 13:50:48 +0000 (22:50 +0900)]
Fix ICE with `main`'s return type containing lifetimes

6 years agoCorrect a few stability attributes
Oliver Middleton [Wed, 4 Apr 2018 23:35:09 +0000 (00:35 +0100)]
Correct a few stability attributes

6 years agoBump the bootstrap compiler to 1.26.0 beta
Alex Crichton [Wed, 4 Apr 2018 14:16:25 +0000 (07:16 -0700)]
Bump the bootstrap compiler to 1.26.0 beta

Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language
features!

6 years agoAuto merge of #49684 - kennytm:rollup, r=kennytm
bors [Thu, 5 Apr 2018 13:07:45 +0000 (13:07 +0000)]
Auto merge of #49684 - kennytm:rollup, r=kennytm

Rollup of 9 pull requests

Successful merges:

 - #48658 (Add a generic CAS loop to std::sync::Atomic*)
 - #49253 (Take the original extra-filename passed to a crate into account when resolving it as a dependency)
 - #49345 (RFC 2008: Finishing Touches)
 - #49432 (Flush executables to disk after linkage)
 - #49496 (Add more vec![... ; n] optimizations)
 - #49563 (add a dist builder to build rust-std components for the THUMB targets)
 - #49654 (Host compiler documentation: Include private items)
 - #49667 (Add more features to rust_2018_preview)
 - #49674 (ci: Remove x86_64-gnu-incremental builder)

Failed merges:

6 years agotypos
memoryleak47 [Thu, 5 Apr 2018 11:04:00 +0000 (13:04 +0200)]
typos

6 years agoRollup merge of #49674 - alexcrichton:no-incremental-rustc, r=michaelwoerister
kennytm [Thu, 5 Apr 2018 10:38:53 +0000 (18:38 +0800)]
Rollup merge of #49674 - alexcrichton:no-incremental-rustc, r=michaelwoerister

ci: Remove x86_64-gnu-incremental builder

This builder is starting to time out frequently causing PRs to bounce and
otherwise doesn't seem to be catching too many bugs, so this commit removes it
entirely. We've had a number of timeouts in the last few weeks related to this
builder:

* https://travis-ci.org/rust-lang/rust/jobs/360947582
* https://travis-ci.org/rust-lang/rust/jobs/360464190
* https://travis-ci.org/rust-lang/rust/jobs/359946975
* https://travis-ci.org/rust-lang/rust/jobs/361213241
* https://travis-ci.org/rust-lang/rust/jobs/362346279
* https://travis-ci.org/rust-lang/rust/jobs/362072331

On a good run this builder takes about 2h15m, which is already too long for
Travis and the variable build times end up pushing it beyond the 3h limit
occasionally.

The timeouts here are somewhat expected in that an incrementally compiled rustc
compiler isn't optimized like a normal rustc, disallowing inlining between
codegen units and losing lots of optimization opportunities.