Commit Graph

91752 Commits

Author SHA1 Message Date
Aaron Hill
d2584e3b6a
Only track 'visited' state for function types 2019-03-31 22:53:27 -04:00
mark
abab4af7f9 update rustc-guide submodule 2019-03-31 19:36:00 -05:00
Aaron Hill
c4556a5a65
Fix typos 2019-03-31 20:09:30 -04:00
Aaron Hill
aed7ec42b3
Add codegen test 2019-03-31 20:09:30 -04:00
Aaron Hill
e1837a0d1a
Fix inverted panic check 2019-03-31 20:09:30 -04:00
Aaron Hill
512069f8e5
Fix stack overflow when generating debuginfo for 'recursive' type
By using 'impl trait', it's possible to create a self-referential
type as follows:

fn foo() -> impl Copy { foo }

This is a function which returns itself.
Normally, the signature of this function would be impossible
to write - it would look like 'fn foo() -> fn() -> fn() ...'
e.g. a function which returns a function, which returns a function...

Using 'impl trait' allows us to avoid writing this infinitely long
type. While it's useless for practical purposes, it does compile and run

However, issues arise when we try to generate llvm debuginfo for such a
type. All 'impl trait' types (e.g. ty::Opaque) are resolved when we
generate debuginfo, which can lead to us recursing back to the original
'fn' type when we try to process its return type.

To resolve this, I've modified debuginfo generation to account for these
kinds of weird types. Unfortunately, there's no 'correct' debuginfo that
we can generate - 'impl trait' does not exist in debuginfo, and this
kind of recursive type is impossible to directly represent.

To ensure that we emit *something*, this commit emits dummy
debuginfo/type names whenever it encounters a self-reference. In
practice, this should never happen - it's just to ensure that we can
emit some kind of debuginfo, even if it's not particularly meaningful

Fixes #58463
2019-03-31 20:09:29 -04:00
bors
eab3eb38df Auto merge of #59507 - nnethercote:indent-with-SPACES, r=petrochenkov
Optimize indentation in the pretty printer.

Currently the pretty-printer calls `write!` for every space of
indentation. On some workloads the indentation level can exceed 100, and
a faster implementation reduces instruction counts by up to 7% on a few
workloads.
2019-03-31 23:50:46 +00:00
Pietro Albini
3c26f65c09
ci: print the appveyor agent version at the start of the build 2019-03-31 23:56:09 +02:00
Nicholas Nethercote
606f3158bf Optimize indentation in the pretty printer.
Currently the pretty-printer calls `write!` for every space of
indentation. On some workloads the indentation level can exceed 100, and
a faster implementation reduces instruction counts by up to 7% on a few
workloads.
2019-04-01 07:55:25 +11:00
bors
e3428db7c2 Auto merge of #59577 - dlrobertson:fix_58881, r=nagisa
Fix LLVM IR generated for C-variadic arguments

It is possible to create malformed LLVM IR given variadic arguments that
are aggregate types. This occurs due to improper tracking of the current
argument in the functions list of arguments.

Fixes: #58881
2019-03-31 20:28:00 +00:00
O01eg
5bcc365a0f
Fix custom relative libdir.
Uses relative libdir to place libraries on all stages.
Adds verbose installation output.
2019-03-31 22:28:12 +03:00
Dan Robertson
a9d62be557
Fix LLVM IR generated for C-variadic arguments
It is possible to create malformed LLVM IR given variadic arguments that
are aggregate types. This occurs due to improper tracking of the current
argument in the functions list of arguments.
2019-03-31 17:37:37 +00:00
bors
4fac5c98b2 Auto merge of #59590 - Centril:rollup, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #58805 (Lint for redundant imports)
 - #59506 (Use platform dependent mcount function)
 - #59519 (rustc_target: factor out common fields of non-Single Variants.)
 - #59580 (Allow closure to unsafe fn coercion)
 - #59581 (Stabilize refcell_replace_swap feature)
 - #59583 (match match match match match)
 - #59587 (Remove #[doc(hidden)] from Error::type_id)

Failed merges:

r? @ghost
2019-03-31 17:21:14 +00:00
Mazdak Farrokhzad
34454451a1
Rollup merge of #59587 - XAMPPRocky:master, r=Centril
Remove #[doc(hidden)] from Error::type_id

Nominating this for beta so that `Error::type_id` has documentation in time for release.

cc @rust-lang/release @rust-lang/docs
2019-03-31 19:19:56 +02:00
Mazdak Farrokhzad
9eba66b35f
Rollup merge of #59583 - oberien:patch-1, r=Centril
match match match match match
2019-03-31 19:19:54 +02:00
Mazdak Farrokhzad
9d198db339
Rollup merge of #59581 - jmcomets:stabilize-refcell_replace_swap, r=Centril
Stabilize refcell_replace_swap feature

Please be kind, this is my first time contributing. 😄

I noticed #43570 only needs stabilizing (and I need it for a side project I'm working on), so I followed the [guide](https://rust-lang.github.io/rustc-guide/stabilization_guide.html#stabilization-pr) to move things forward.

I'm happy to amend things if needed, let me know!
2019-03-31 19:19:53 +02:00
Mazdak Farrokhzad
1909a0303a
Rollup merge of #59580 - taiki-e:coerce-closure, r=oli-obk
Allow closure to unsafe fn coercion

Closes #57883
2019-03-31 19:19:51 +02:00
Mazdak Farrokhzad
0171fe5598
Rollup merge of #59519 - eddyb:layout-variants-refactor, r=oli-obk
rustc_target: factor out common fields of non-Single Variants.

@tmandry and I were discussing ways to generalize the current variants/discriminant layout to allow more fields in the "`enum`" (or another multi-variant types, such as potentially generator state, in the future), shared by all variants, than just the tag/niche discriminant.

This refactor should make it easier to extend multi-variant layouts, as nothing is duplicating anymore between "tagged enums" and "niche-filling enums".

r? @oli-obk
2019-03-31 19:19:50 +02:00
Mazdak Farrokhzad
245a0afb52
Rollup merge of #59506 - JohnTitor:improve-mcount, r=nagisa
Use platform dependent mcount function

close #59097

This pull-request is based on #57244 and [here](https://github.com/llvm-mirror/clang/search?q=MCountName&unscoped_MCountName).

r? @nagisa
2019-03-31 19:19:48 +02:00
Mazdak Farrokhzad
dffdd8f728
Rollup merge of #58805 - fabric-and-ink:redundant_import, r=petrochenkov
Lint for redundant imports

Add lint for redundant imports. The changes are suggested by @petrochenkov.

Closes #10178.
2019-03-31 19:19:47 +02:00
Esteban Küber
30c247f881 Suggest using anonymous lifetime in impl Trait return without hacks
Fallback to `static_impl_trait` for nice error message by peeking at the
return type and the lifetime type. Point at the return type instead of
the return expr/stmt in NLL mode.
2019-03-31 09:11:47 -07:00
Taiki Endo
07021e07ed Allow closure to unsafe fn coercion 2019-04-01 00:00:43 +09:00
Aaron Power
14f4e27df3 Fixed URL in cargotest::TEST_REPOS 2019-03-31 16:56:30 +02:00
Aaron Power
c056a79f35 Remove #[doc(hidden)] from Error::type_id 2019-03-31 16:54:05 +02:00
Yuki OKUSHI
7b26a43ae5 Use u{1} instead of 01 2019-03-31 23:17:49 +09:00
Matthew Jasper
16ee042100 Fixes for shallow borrows
* Don't promote these borrows if we're going to remove them before
  codegen
* Correctly mark unreachable code
2019-03-31 15:14:50 +01:00
bors
a89c03a30a Auto merge of #59584 - Centril:rollup, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #58828 (libstd: deny(elided_lifetimes_in_paths))
 - #59234 (Mention `no merge policy` in the CONTRIBUTING guide)
 - #59572 (Include bounds in generic re-ordering diagnostic)
 - #59574 (Distinguish message for external macros depending on error level)

Failed merges:

r? @ghost
2019-03-31 14:11:11 +00:00
Mazdak Farrokhzad
fb8396da84
Rollup merge of #59574 - JohnTitor:distinguish-error-vs-warning, r=Centril
Distinguish message for external macros depending on error level

fixes #57716

(I picked you because assigned to this issue.)
r? @estebank
2019-03-31 16:10:38 +02:00
Mazdak Farrokhzad
61222b5731
Rollup merge of #59572 - davidtwco:issue-59508, r=varkor
Include bounds in generic re-ordering diagnostic

Fixes #59508.

r? @estebank
cc @varkor
2019-03-31 16:10:37 +02:00
Mazdak Farrokhzad
df18e190be
Rollup merge of #59234 - stepnivlk:add-no_merge_policy, r=oli-obk
Mention `no merge policy` in the CONTRIBUTING guide

Issue: https://github.com/rust-lang/rust/issues/59233
2019-03-31 16:10:36 +02:00
Mazdak Farrokhzad
a02b825c93
Rollup merge of #58828 - Centril:deny-elided_lifetimes_in_paths-libstd, r=oli-obk
libstd: deny(elided_lifetimes_in_paths)

r? @oli-obk
2019-03-31 16:10:34 +02:00
Jaro Fietz
55b7efe29f
match match match match match 2019-03-31 15:20:10 +02:00
Jean-Marie Comets
c789a539a2 refcell_replace_swap: remove feature gate & obsolete documentation item 2019-03-31 14:50:06 +02:00
Mazdak Farrokhzad
1d9508a33a libstd: deny(elided_lifetimes_in_paths), fixes in redox 2019-03-31 14:33:50 +02:00
Fabian Drinck
c1d5314bd3 Remove redundant import 2019-03-31 14:11:46 +02:00
Mazdak Farrokhzad
351a20c32f libstd: deny(elided_lifetimes_in_paths), fixes in sgx 2019-03-31 12:56:51 +02:00
Mazdak Farrokhzad
c5d60910ca libstd: deny(elided_lifetimes_in_paths), fixes in wasi 2019-03-31 12:56:51 +02:00
Mazdak Farrokhzad
6f4df8c0c2 libstd: deny(elided_lifetimes_in_paths), fixes in cloudabi 2019-03-31 12:56:51 +02:00
Mazdak Farrokhzad
379c380a60 libstd: deny(elided_lifetimes_in_paths) 2019-03-31 12:56:51 +02:00
Fabian Drinck
ae6622da58 Add back missing import 2019-03-31 12:02:27 +02:00
Jean-Marie Comets
70fa616a23 Stabilize refcell_replace_swap feature, closes #43570 2019-03-31 10:54:14 +02:00
bors
cee58fdc12 Auto merge of #59566 - cuviper:llvm-rebuild-sha, r=Mark-Simulacrum
Use the existing LLVM GitInfo for checking rebuilds

Fixes #59565
2019-03-31 01:22:07 +00:00
David Wood
0270d565d9
Only mention const generics if enabled.
This commit updates the generic parameter re-ordering diagnostic to only
mention const generics if the feature is enabled.
2019-03-31 00:14:21 +01:00
David Wood
3829746ef9
Include bounds in generic reordering diagnostic.
This commit extends the existing generic re-ordering diagnostic to
include any bounds on the generic parameter, thus producing correct
suggestions.
2019-03-31 00:14:21 +01:00
Yuki OKUSHI
45c82abf13 Distinguish depending on error level
Remove unnecessary comment
2019-03-31 07:51:31 +09:00
bors
b0fcfa7d61 Auto merge of #59575 - Centril:rollup, r=Centril
Rollup of 3 pull requests

Successful merges:

 - #59405 (doc: use correct body font URLs)
 - #59562 (Changed reference style in dbg macro docs.)
 - #59569 (Add book.toml with title to unstable-book doc)

Failed merges:

r? @ghost
2019-03-30 22:15:05 +00:00
Mazdak Farrokhzad
7da27b261a
Rollup merge of #59569 - gruberb:add-title-for-unstable-book, r=frewsxcv
Add book.toml with title to unstable-book doc

Adding a title to the unstable book based on https://github.com/rust-lang/rust/issues/59554
2019-03-30 23:14:43 +01:00
Mazdak Farrokhzad
c6f0ad1719
Rollup merge of #59562 - DevQps:dbg-macro-docs, r=Centril
Changed reference style in dbg macro docs.

# Description

A continuation of Pull Request #59528 :
- Fixed method of referencing and adjusted the references as suggested by @lzutao
2019-03-30 23:14:42 +01:00
Mazdak Farrokhzad
8a19973eed
Rollup merge of #59405 - benesch:docs-font, r=GuillaumeGomez
doc: use correct body font URLs

The CSS for the docs homepage (docs.rust-lang.org) was using the wrong
URL for the body font, resulting in the fallback serif font being used,
instead of the desired Source Serif Pro fonts.

(It's worth noting that the CSS for rustdoc's API generation got these URLs right.)
2019-03-30 23:14:40 +01:00
Yuki OKUSHI
aec518addd Fix test 2019-03-31 07:13:59 +09:00