]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #49681 - tmccombs:take-set-limit-stable, r=sfackler
bors [Wed, 11 Apr 2018 06:03:46 +0000 (06:03 +0000)]
Auto merge of #49681 - tmccombs:take-set-limit-stable, r=sfackler

Stabilize take_set_limit

Fixes #42781

6 years agoAuto merge of #49715 - Mark-Simulacrum:deny-warnings, r=alexcrichton
bors [Wed, 11 Apr 2018 03:30:04 +0000 (03:30 +0000)]
Auto merge of #49715 - Mark-Simulacrum:deny-warnings, r=alexcrichton

Move deny(warnings) into rustbuild

This permits easier iteration without having to worry about warnings
being denied.

Fixes #49517

6 years agoAllow incorrectly reported unused attribute warning
Mark Simulacrum [Mon, 9 Apr 2018 17:21:43 +0000 (11:21 -0600)]
Allow incorrectly reported unused attribute warning

6 years agoAuto merge of #49695 - michaelwoerister:unhygienic-ty-min, r=nikomatsakis
bors [Wed, 11 Apr 2018 00:51:38 +0000 (00:51 +0000)]
Auto merge of #49695 - michaelwoerister:unhygienic-ty-min, r=nikomatsakis

Use InternedString instead of Symbol for type parameter types (2)

Reduced alternative to #49266. Let's see if this causes a performance regression.

6 years agoAuto merge of #48914 - gaurikholkar:e0389, r=nikomatsakis
bors [Tue, 10 Apr 2018 19:00:19 +0000 (19:00 +0000)]
Auto merge of #48914 - gaurikholkar:e0389, r=nikomatsakis

Modify compile-fail/E0389 error message WIP

This fixes #47388

cc @nikomatsakis @estebank

r? @nikomatsakis

Certain ui tests were failing locally. I'll check if the same happens here too.

6 years agoAuto merge of #49386 - GuillaumeGomez:fix-path-attribute, r=eddyb
bors [Tue, 10 Apr 2018 12:58:27 +0000 (12:58 +0000)]
Auto merge of #49386 - GuillaumeGomez:fix-path-attribute, r=eddyb

Add tcx in item_body_nested_bodies

Fixes #47391.

r? @eddyb

6 years agoAuto merge of #49390 - Zoxc:sync-syntax, r=michaelwoerister
bors [Tue, 10 Apr 2018 09:00:27 +0000 (09:00 +0000)]
Auto merge of #49390 - Zoxc:sync-syntax, r=michaelwoerister

More thread-safety changes

r? @michaelwoerister

6 years agoAuto merge of #49504 - GuillaumeGomez:doc-all-types, r=QuietMisdreavus
bors [Tue, 10 Apr 2018 06:23:52 +0000 (06:23 +0000)]
Auto merge of #49504 - GuillaumeGomez:doc-all-types, r=QuietMisdreavus

Add page to list all crate's items

r? @QuietMisdreavus

6 years agoAuto merge of #49258 - zackmdavis:not_going_to_recover, r=petrochenkov
bors [Tue, 10 Apr 2018 03:27:43 +0000 (03:27 +0000)]
Auto merge of #49258 - zackmdavis:not_going_to_recover, r=petrochenkov

suggest `!` for erroneous identifier `not`

![not_recovery](https://user-images.githubusercontent.com/1076988/37753255-3b669c42-2d59-11e8-9071-efad8eaf3086.png)

This supersedes #48858.

r? @petrochenkov

6 years agoAuto merge of #49435 - tmandry:rule-implied-bound-from-trait, r=nikomatsakis
bors [Tue, 10 Apr 2018 00:32:54 +0000 (00:32 +0000)]
Auto merge of #49435 - tmandry:rule-implied-bound-from-trait, r=nikomatsakis

chalkify: Implement lowering rule Implied-Bound-From-Trait

For #49177.

TODO:
- [x] Implement where clauses besides trait and projection predicates
- [x] Is the output of the `lower_trait_higher_rank` test correct?
- [ ] Remove `Self::Trait` from the query `tcx.predicates_of(<trait_id>).predicates`
- [ ] Consider moving tests to compile-fail to make them more manageable

6 years agoAuto merge of #49811 - alexcrichton:fix-android, r=SimonSapin
bors [Mon, 9 Apr 2018 21:41:10 +0000 (21:41 +0000)]
Auto merge of #49811 - alexcrichton:fix-android, r=SimonSapin

std: Be sure to modify atomics in tests

See #49775 for some more information but it looks like this is working around an
LLVM bug for the time being.

Closes #49775

6 years agostd: Be sure to modify atomics in tests
Alex Crichton [Mon, 9 Apr 2018 18:40:53 +0000 (11:40 -0700)]
std: Be sure to modify atomics in tests

See #49775 for some more information but it looks like this is working around an
LLVM bug for the time being.

Closes #49775

6 years agotidy fixes
gaurikholkar [Mon, 9 Apr 2018 17:42:13 +0000 (23:12 +0530)]
tidy fixes

6 years agoin which `!` is suggested for erroneous identifier `not`
Zack M. Davis [Thu, 22 Mar 2018 05:38:24 +0000 (22:38 -0700)]
in which `!` is suggested for erroneous identifier `not`

Impressing confused Python users with magical diagnostics is perhaps
worth this not-grossly-unreasonable (only 40ish lines) extra complexity
in the parser?

Thanks to Vadim Petrochenkov for guidance.

This resolves #46836.

6 years agodon't suggest placing code in block if next token is open-brace
Zack M. Davis [Thu, 22 Mar 2018 04:54:06 +0000 (21:54 -0700)]
don't suggest placing code in block if next token is open-brace

Thanks to the inestimably inimitable Esteban "Estebank" Küber for
pointing this out.

This is relevant to #46836.

6 years agoAuto merge of #49805 - nrc:update, r=kennytm
bors [Mon, 9 Apr 2018 11:04:15 +0000 (11:04 +0000)]
Auto merge of #49805 - nrc:update, r=kennytm

Update Rustfmt

r? @alexcrichton

Fixes broken rustfmt

6 years agoUpdate Rustfmt
Nick Cameron [Mon, 9 Apr 2018 08:26:46 +0000 (20:26 +1200)]
Update Rustfmt

6 years agoAuto merge of #49778 - tamird:install-relative-prefix, r=Mark-Simulacrum
bors [Mon, 9 Apr 2018 06:05:49 +0000 (06:05 +0000)]
Auto merge of #49778 - tamird:install-relative-prefix, r=Mark-Simulacrum

rustbuild: canonicalize prefix `install_sh`

Testing:
```
  $ git diff
  diff --git a/config.toml.example b/config.toml.example
  index 9dd3002506..b47bc490cd 100644
  --- a/config.toml.example
  +++ b/config.toml.example
  @@ -196,7 +196,7 @@
   [install]

   # Instead of installing to /usr/local, install to this path instead.
  -#prefix = "/usr/local"
  +prefix = "install-prefix"

   # Where to install system configuration files
   # If this is a relative path, it will get installed in `prefix` above
  $ mkdir install-prefix
  $ ./x.py install -i --stage 0 --config config.toml.example
  ...
  $ ls install-prefix/
  bin lib share
```

Closes #36989.

r? @Mark-Simulacrum

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 agoMove deny(warnings) into rustbuild
Mark Simulacrum [Sun, 1 Apr 2018 15:35:53 +0000 (09:35 -0600)]
Move deny(warnings) into rustbuild

This permits easier iteration without having to worry about warnings
being denied.

Fixes #49517

6 years agorustbuild: canonicalize prefix `install_sh`
Tamir Duberstein [Sun, 8 Apr 2018 02:50:19 +0000 (22:50 -0400)]
rustbuild: canonicalize prefix `install_sh`

Testing:
```
  $ git diff
  diff --git a/config.toml.example b/config.toml.example
  index 9dd3002506..b47bc490cd 100644
  --- a/config.toml.example
  +++ b/config.toml.example
  @@ -196,7 +196,7 @@
   [install]

   # Instead of installing to /usr/local, install to this path instead.
  -#prefix = "/usr/local"
  +prefix = "install-prefix"

   # Where to install system configuration files
   # If this is a relative path, it will get installed in `prefix` above
  $ mkdir install-prefix
  $ ./x.py install -i --stage 0 --config config.toml.example
  ...
  $ ls install-prefix/
  bin lib share
```

Closes #36989.

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 agotidy fixes
gaurikholkar [Sun, 8 Apr 2018 17:27:48 +0000 (22:57 +0530)]
tidy fixes

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 agoImprove code
Guillaume Gomez [Sat, 7 Apr 2018 11:10:49 +0000 (13:10 +0200)]
Improve code

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 agofix tidy errors
gaurikholkar [Sat, 7 Apr 2018 09:06:29 +0000 (14:36 +0530)]
fix tidy errors

6 years agomodify the error message- CR Comments
gaurikholkar [Sat, 7 Apr 2018 05:24:13 +0000 (10:54 +0530)]
modify the error message- CR Comments

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 agochalkify: Implement Rule Implied-Bound-From-Trait
Tyler Mandry [Tue, 27 Mar 2018 04:03:50 +0000 (23:03 -0500)]
chalkify: Implement Rule Implied-Bound-From-Trait

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 agofix ui test
gaurikholkar [Fri, 6 Apr 2018 17:33:20 +0000 (23:03 +0530)]
fix ui test

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 agotidy fix
gaurikholkar [Fri, 6 Apr 2018 14:58:00 +0000 (20:28 +0530)]
tidy fix

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 agofix ui test
gaurikholkar [Fri, 6 Apr 2018 14:34:07 +0000 (20:04 +0530)]
fix ui test

6 years agoreduce nested loops in the code
gaurikholkar [Fri, 6 Apr 2018 14:30:21 +0000 (20:00 +0530)]
reduce nested loops in the code

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`