Commit Graph

68317 Commits

Author SHA1 Message Date
Zack M. Davis
5c9f806d78 code suggestion for unused-parentheses lint
Resolves #42892.
2017-09-30 11:31:12 -07:00
Zack M. Davis
f2c5acd611 code suggestion for deprecated-attribute lint
Also, fix the deprecation message for the late no-debug feature.
2017-09-30 11:31:12 -07:00
QuietMisdreavus
5b59c4db67 let htmldocck.py check for directories 2017-09-30 13:28:09 -05:00
Douglas Campos
b24a672613 weird formatting 2017-09-30 11:08:08 -04:00
bors
c6884b12d9 Auto merge of #44783 - alexcrichton:lto-codegen-units, r=michaelwoerister
rustc: Enable LTO and multiple codegen units

This commit is a refactoring of the LTO backend in Rust to support compilations
with multiple codegen units. The immediate result of this PR is to remove the
artificial error emitted by rustc about `-C lto -C codegen-units-8`, but longer
term this is intended to lay the groundwork for LTO with incremental compilation
and ultimately be the underpinning of ThinLTO support.

The problem here that needed solving is that when rustc is producing multiple
codegen units in one compilation LTO needs to merge them all together.
Previously only upstream dependencies were merged and it was inherently relied
on that there was only one local codegen unit. Supporting this involved
refactoring the optimization backend architecture for rustc, namely splitting
the `optimize_and_codegen` function into `optimize` and `codegen`. After an LLVM
module has been optimized it may be blocked and queued up for LTO, and only
after LTO are modules code generated.

Non-LTO compilations should look the same as they do today backend-wise, we'll
spin up a thread for each codegen unit and optimize/codegen in that thread. LTO
compilations will, however, send the LLVM module back to the coordinator thread
once optimizations have finished. When all LLVM modules have finished optimizing
the coordinator will invoke the LTO backend, producing a further list of LLVM
modules. Currently this is always a list of one LLVM module. The coordinator
then spawns further work to run LTO and code generation passes over each module.

In the course of this refactoring a number of other pieces were refactored:

* Management of the bytecode encoding in rlibs was centralized into one module
  instead of being scattered across LTO and linking.
* Some internal refactorings on the link stage of the compiler was done to work
  directly from `CompiledModule` structures instead of lists of paths.
* The trans time-graph output was tweaked a little to include a name on each
  bar and inflate the size of the bars a little
2017-09-30 15:01:35 +00:00
petrochenkov
8037c28a4a Do not require semantic types for all syntactic types when there are type errors 2017-09-30 17:41:00 +03:00
Daniel Klauer
12a8bc6eb9 rustc: Use 16bit c_int for msp430
Fix regression from c2fe69b9, where main() signature was changed from
using 16bit isize to 32bit c_int for argc parameter/result.
2017-09-30 16:30:12 +02:00
Nikolai Vazquez
f1798d3c9a Cast inner type in OsStr::bytes
The innermost type is not [u8] on all platforms but is assumed to have
the same memory layout as [u8] since this conversion was done via
mem::transmute before.
2017-09-30 10:01:41 -04:00
Daniel Klauer
a204c193ca rustc: Specify c_int width for each target
(all i32 for now, as in liblibc)
2017-09-30 15:54:08 +02:00
Danilo Bargen
eb59952fbd Docs: Add trace_macros! to unstable book 2017-09-30 15:27:42 +02:00
Niv Kaminer
5eebab28dd remove "refinement on pat" FIXME 2017-09-30 13:46:57 +03:00
Aaron Power
7ed23f1349 Update RELEASES.md 2017-09-30 11:36:49 +01:00
bors
c4cca3a72d Auto merge of #44936 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 15 pull requests

- Successful merges: #44124, #44287, #44320, #44694, #44708, #44794, #44797, #44824, #44836, #44840, #44845, #44854, #44889, #44900, #44903
- Failed merges:
2017-09-30 10:03:00 +00:00
Niv Kaminer
ff99111f48 address some FIXMEs whose associated issues were marked as closed
remove FIXME(#13101) since `assert_receiver_is_total_eq` stays.
remove FIXME(#19649) now that stability markers render.
remove FIXME(#13642) now the benchmarks were moved.
remove FIXME(#6220) now that floating points can be formatted.
remove FIXME(#18248) and write tests for `Rc<str>` and `Rc<[u8]>`
remove reference to irelevent issues in FIXME(#1697, #2178...)
update FIXME(#5516) to point to getopts issue 7
update FIXME(#7771) to point to RFC 628
update FIXME(#19839) to point to issue 26925
2017-09-30 11:33:47 +03:00
Alex Crichton
ded38dbfc2 rustc: Enable LTO and multiple codegen units
This commit is a refactoring of the LTO backend in Rust to support compilations
with multiple codegen units. The immediate result of this PR is to remove the
artificial error emitted by rustc about `-C lto -C codegen-units-8`, but longer
term this is intended to lay the groundwork for LTO with incremental compilation
and ultimately be the underpinning of ThinLTO support.

The problem here that needed solving is that when rustc is producing multiple
codegen units in one compilation LTO needs to merge them all together.
Previously only upstream dependencies were merged and it was inherently relied
on that there was only one local codegen unit. Supporting this involved
refactoring the optimization backend architecture for rustc, namely splitting
the `optimize_and_codegen` function into `optimize` and `codegen`. After an LLVM
module has been optimized it may be blocked and queued up for LTO, and only
after LTO are modules code generated.

Non-LTO compilations should look the same as they do today backend-wise, we'll
spin up a thread for each codegen unit and optimize/codegen in that thread. LTO
compilations will, however, send the LLVM module back to the coordinator thread
once optimizations have finished. When all LLVM modules have finished optimizing
the coordinator will invoke the LTO backend, producing a further list of LLVM
modules. Currently this is always a list of one LLVM module. The coordinator
then spawns further work to run LTO and code generation passes over each module.

In the course of this refactoring a number of other pieces were refactored:

* Management of the bytecode encoding in rlibs was centralized into one module
  instead of being scattered across LTO and linking.
* Some internal refactorings on the link stage of the compiler was done to work
  directly from `CompiledModule` structures instead of lists of paths.
* The trans time-graph output was tweaked a little to include a name on each
  bar and inflate the size of the bars a little
2017-09-30 00:22:15 -07:00
bors
4491ea5a3f Auto merge of #44893 - spastorino:remove_new_and_index, r=nikomatsakis
Remove new and index methods already implement for Idx

These are the rest of the repeated implementations for new and index methods. Follow up of https://github.com/rust-lang/rust/pull/44889
2017-09-30 06:56:49 +00:00
Zack M. Davis
d663003e03 fix comment typo, CodeSuggestion path in doc comment
`CodeSuggestion` doesn't live in the `diagnostic` module.
2017-09-29 23:42:24 -07:00
Philip Craig
c27a82f193 Don't use remapped path when loading modules and include files 2017-09-30 16:32:45 +10:00
Douglas Campos
a29c770c68 make match exaustive 2017-09-29 22:34:51 -04:00
Douglas Campos
59e778e5e1 improve documentation for resolve() 2017-09-29 22:34:49 -04:00
Douglas Campos
08e1f0b9d7 fix formatting 2017-09-29 22:34:48 -04:00
Douglas Campos
29220663c1 style fixes as requested by @eddyb 2017-09-29 22:34:48 -04:00
Douglas Campos
081b29c1f6 stop using monomorphize::resolve() 2017-09-29 22:34:48 -04:00
Douglas Campos
8a5800e1d4 take ParamEnv into account when resolving 2017-09-29 22:34:47 -04:00
Douglas Campos
24fc50fffa make it not to be a method 2017-09-29 22:34:46 -04:00
Douglas Campos
5eb302fba8 always use resolve 2017-09-29 22:34:46 -04:00
Douglas Campos
3bd09dee45 re-enable mir inlining across trait methods
this fixes #44389
2017-09-29 22:34:46 -04:00
Douglas Campos
baa010561e copy resolve() over to librustc 2017-09-29 22:34:45 -04:00
Vitaly _Vi Shukela
d892e985b0
rustdoc: A test for local and foreign [src] trait impl links 2017-09-30 03:17:51 +03:00
Mark Simulacrum
d6451f0b33 Rollup merge of #44903 - kallisti5:ci-build-disabled, r=aidanhs
ci: Fix building disabled containers

* Change the context into the disabled directory. Now you can test
  containers which are disabled.
2017-09-29 17:59:05 -06:00
Mark Simulacrum
4489a7a0bb Rollup merge of #44900 - Havvy:normalize-lang-attribute-spacing, r=sfackler
Normalize spaces in lang attributes.

So, like, I grepped for all `lang` attributes for *reasons* and I noticed that they all share the same spacing of `#[lang = "item_name"]` except these five instances. So I decided to fix that. So enjoy this PR of exactly ten spaces.
2017-09-29 17:59:04 -06:00
Mark Simulacrum
37c74e1979 Rollup merge of #44889 - spastorino:remove_new, r=arielb1
Remove DepNodeIndex::new is already impl for Idx
2017-09-29 17:59:03 -06:00
Mark Simulacrum
7756d39dca Rollup merge of #44854 - lucasem:atomic-docs, r=steveklabnik
docs improvement sync::atomic::Atomic*

Addresses the `Atomic*` part of #29377.
r? @steveklabnik
2017-09-29 17:59:02 -06:00
Mark Simulacrum
7c3d376086 Rollup merge of #44845 - SimonSapin:nll_mod_rs, r=nikomatsakis
Move src/librustc_mir/transform/nll.rs to a subdirectory

CC https://github.com/rust-lang/rust/issues/43234
2017-09-29 17:59:01 -06:00
Mark Simulacrum
3d7a390552 Rollup merge of #44840 - steveklabnik:fix-wording, r=BurntSushi
Improve wording for StepBy

No other iterator makes the distinction between an iterator and an iterator adapter
in its summary line, so change it to be consistent with all other adapters.
2017-09-29 17:59:00 -06:00
Mark Simulacrum
327cd0d557 Rollup merge of #44836 - GuillaumeGomez:fmt-missing-links, r=QuietMisdreavus
Add missing links in fmt module

r? @rust-lang/docs
2017-09-29 17:58:59 -06:00
Mark Simulacrum
570f1ce36a Rollup merge of #44824 - dtolnay:22really21, r=alexcrichton
Backport libs stabilizations to 1.21 beta

Includes the following stabilizations:

- tcpstream_connect_timeout https://github.com/rust-lang/rust/pull/44563
- iterator_for_each https://github.com/rust-lang/rust/pull/44567
- ord_max_min https://github.com/rust-lang/rust/pull/44593
- compiler_fences https://github.com/rust-lang/rust/pull/44595
- needs_drop https://github.com/rust-lang/rust/pull/44639
- vec_splice https://github.com/rust-lang/rust/pull/44640

These have been backported in https://github.com/rust-lang/rust/pull/44823.
2017-09-29 17:58:58 -06:00
Mark Simulacrum
b1437bc0f7 Rollup merge of #44797 - lucasem:master, r=frewsxcv
docs improvement std::sync::{PoisonError, TryLockError}

Addresses the `PoisonError` and `TryLockError` parts of #29377.
Adds examples and links.

r? @steveklabnik
2017-09-29 17:58:57 -06:00
Mark Simulacrum
f2feb83b73 Rollup merge of #44794 - napen123:master, r=frewsxcv
Add doc example to HashMap::hasher

None
2017-09-29 17:58:56 -06:00
Mark Simulacrum
8083877987 Rollup merge of #44708 - toidiu:ak-44493, r=nikomatsakis
Infer `T: 'x` outlives requirements on structs #44493

https://github.com/rust-lang/rust/issues/44493
2017-09-29 17:58:55 -06:00
Mark Simulacrum
6bc8ca06c1 Rollup merge of #44694 - tommyip:make_clean, r=Mark-Simulacrum
Add --all flag to ./x.py clean

This make `clean` removes the LLVM and download cache directory as well.

Fixes #44214.

r? @Mark-Simulacrum
2017-09-29 17:58:54 -06:00
Mark Simulacrum
20f892f549 Rollup merge of #44320 - jakllsch:jakllsch-caf2c3d2-c939-4c4d-8c68-1aecbd570fab, r=Mark-Simulacrum
Fix extended bootstrap issues with OpenSSL on NetBSD build hosts
2017-09-29 17:58:53 -06:00
Mark Simulacrum
f91c55e995 Rollup merge of #44287 - Eh2406:master, r=aturon
Allow T op= &T for built-in numeric types T v2

Manually rebase of @Migi https://github.com/rust-lang/rust/pull/41336
2017-09-29 17:58:52 -06:00
Mark Simulacrum
f407b2bf4a Rollup merge of #44124 - gaurikholkar:return_self, r=arielb1
adding E0623 for return types - both parameters are anonymous

This is a fix for #44018
```
error[E0621]: explicit lifetime required in the type of `self`
  --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:17:5
   |
16 |   fn foo<'a>(&self, x: &i32) -> &i32 {
   |                        ----     ----
   |                        |
   |                        this parameter and the return type are
                            declared with different lifetimes...
17 |     x
   |     ^ ...but data from `x` is returned here

error: aborting due to previous error
```
It also works for the below case where we have self as anonymous

```
error[E0623]: lifetime mismatch
  --> src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs:17:19
   |
16 |     fn foo<'a>(&self, x: &Foo) -> &Foo {
   |                          ----     ----
   |                          |
   |                          this parameter and the return type are
                            declared with different lifetimes...
17 |         if true { x } else { self }
   |                   ^ ...but data from `x` is returned here

error: aborting due to previous error
```
r? @nikomatsakis

Currently, I have enabled E0621 where return type and self are anonymous, hence WIP.
2017-09-29 17:58:51 -06:00
est31
4114d68f18 Update the libcompiler_builtins submodule 2017-09-30 01:45:21 +02:00
Garrett Berg
daf3ed5651 Add links to headers in README and CONTRIBUTING and dependencies to CONTRIBUTING 2017-09-29 17:44:55 -06:00
bors
b7041bfab3 Auto merge of #44174 - jimmycuadra:try-from-infallible, r=sfackler
Add blanket TryFrom impl when From is implemented.

Adds `impl<T, U> TryFrom<T> for U where U: From<T>`.

Removes `impl<'a, T> TryFrom<&'a str> for T where T: FromStr` (originally added in #40281) due to overlapping impls caused by the new blanket impl. This removal is to be discussed further on the tracking issue for TryFrom.

Refs #33417.

/cc @sfackler, @scottmcm (thank you for the help!), and @aturon
2017-09-29 22:35:23 +00:00
Jimmy Cuadra
27d95d3645 Fix more TryFrom impls for integers. 2017-09-29 14:10:26 -07:00
Jimmy Cuadra
966cf339cb Simplify implementation of From<Infallible> for TryFromIntError. 2017-09-29 14:04:28 -07:00
bors
6f87d20a7c Auto merge of #42526 - huntiep:try_opt, r=nikomatsakis
Impl Try for Option

This is part of #31436.
2017-09-29 20:09:35 +00:00