Commit Graph

74369 Commits

Author SHA1 Message Date
gnzlbg 23dfb42ab3 still support LLVM4 for emscripten 2018-07-09 11:35:53 +02:00
gnzlbg 52d7740277 bump llvm version of failing codegen test 2018-07-09 11:35:53 +02:00
gnzlbg 4ff90c7e0a bump minimum LLVM version to 5.0 2018-07-09 11:35:52 +02:00
bors c30acc7187 Auto merge of #52160 - euclio:include-macros, r=oli-obk
add regression test for #48835

Fixes #48835.

The underlying issue was fixed in #51978.
2018-07-09 08:41:43 +00:00
Oliver Schneider 7a8e085835 Also distribute cargo clippy 2018-07-09 10:15:30 +02:00
Oliver Schneider 68620b14a2 Inject clippy into the rls again
Also makes sure we actually point to the local rls
2018-07-09 10:10:42 +02:00
Ben Harris aac0d914b2 Correct some codegen stats counters 2018-07-09 09:40:16 +02:00
bors ec039c7cb1 Auto merge of #52066 - benjaminp:obligation-select, r=Mark-Simulacrum
Remove obsolete documentation from FufillmentContext::select comment.

The `only_new_obligations` parameter has not existed since 43756934d2.
2018-07-09 06:38:47 +00:00
Orson Peters e529dfd590 Removed a single trailing space. Oops. 2018-07-09 06:31:24 +02:00
Niko Matsakis a6adb1ebff find and highlight the `&` or `'_` in `region_name` 2018-07-09 00:20:36 -04:00
Orson Peters 6faa295cec Reimplemented Vec's swap_remove to not rely on pop. 2018-07-09 06:13:58 +02:00
Orson Peters 295768ae8f Performance improvement of Vec's swap_remove. 2018-07-09 05:01:39 +02:00
Andy Russell 1be1d90662
add regression test for #48835
Fixes #48835.

The underlying issue was fixed in #51978.
2018-07-08 16:45:01 -04:00
jD91mZM2 0b56e7f1a9
Delete leftover files 2018-07-08 20:48:11 +02:00
bors 960f6046c6 Auto merge of #52152 - fabric-and-ink:edit-file-open-example, r=frewsxcv
Edit code example for File::open

It looked kinda strange and is now aligned with the other examples for `File`.
2018-07-08 16:08:54 +00:00
Vadim Petrochenkov fc74e35981 Remove fallback to parent modules from lexical resolution 2018-07-08 18:16:09 +03:00
bors 0e6b713dd5 Auto merge of #52106 - PramodBisht:issue/52049, r=oli-obk
Don't suggest `let` bindings if they don't help with borrows

@oli-obk I have added a condition to address #52049, right now, this is on WIP because I think code change is also required on `error_reporting.rs`. Plus I need to check if any test cases fail.
I will ping you again if everything passes

r? @oli-obk
2018-07-08 14:08:36 +00:00
Fabian Drinck f580b983b1 Edit code example for File::open 2018-07-08 16:07:09 +02:00
Vadim Petrochenkov 94ef9f57f5 hygiene: Decouple transparencies from expansion IDs 2018-07-08 16:17:37 +03:00
Vadim Petrochenkov 01b6d7cc6f libsyntax_pos: Tweak some visibilities 2018-07-08 16:17:36 +03:00
Guillaume Gomez 26615b8f20 Fix some links 2018-07-08 15:07:17 +02:00
Guillaume Gomez c0ec5d5e44 Add setting to prevent doc auto-hide of trait implementations 2018-07-08 15:07:06 +02:00
willmo e769deca99
Add #[repr(transparent)] to Atomic* types
This allows them to be used in #[repr(C)] structs without warnings. Since rust-lang/rfcs#1649 and rust-lang/rust#35603 they are already documented to have "the same in-memory representation as" their corresponding primitive types. This just makes that explicit.
2018-07-07 20:09:34 -07:00
bors 0c0315cfd9 Auto merge of #51955 - zackmdavis:item_semi, r=oli-obk
clarify why we're suggesting removing semicolon after braced items

Previously (issue #46186, pull-request #46258), a suggestion was added
to remove the semicolon after we fail to parse an item, but issue #51603
complains that it's still insufficiently obvious why. Let's add a note.

Resolves #51603.
2018-07-08 02:51:54 +00:00
bors 9342f293e9 Auto merge of #51590 - bjorn3:codegen_llvm_extract, r=alexcrichton
Mostly fix metadata_only backend and extract some code out of rustc_codegen_llvm

Removes dependency on the `ar` crate and removes the `llvm.enabled` config option in favour of setting `rust.codegen-backends` to `[]`.
2018-07-08 00:52:36 +00:00
Simon Sapin 5b795cf57e Reformat std prelude source to show it is the sum of core and alloc preludes 2018-07-07 23:16:27 +02:00
Simon Sapin b842177cfa Add the `alloc::prelude` module
It contains the re-exports that are in `std::prelude::v1`
but not in `core::prelude::v1`.

Calling it prelude is somewhat of a misnomer since (unlike those modules
in `std` or `core`) its contents are never implicitly imported in modules.
Rather it is intended to be used with an explicit glob import like
`use alloc::prelude::*;`.
However there is precedent for the same misnomer with `std::io::prelude`,
for example.

This new module is unstable with the same feature name as the `alloc` care.
They are proposed for stabilization together in RFC
https://github.com/rust-lang/rfcs/pull/2480
2018-07-07 23:08:43 +02:00
bors 9fd3d7899a Auto merge of #52132 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 3 pull requests

Successful merges:

 - #52087 (Update musl to 1.1.19 and add patch to fix tls issue)
 - #52107 (removed redundant header file import in rustllvm.h)
 - #52131 (Ship clippy in manifests)

Failed merges:

r? @ghost
2018-07-07 16:21:28 +00:00
Mark Rousskov cea56a109d
Rollup merge of #52131 - Mark-Simulacrum:ship-clippy, r=kennytm
Ship clippy in manifests

cc @Manishearth
r? @kennytm
2018-07-07 08:27:02 -06:00
Mark Rousskov f532daa2e5
Rollup merge of #52107 - PramodBisht:feature/52105, r=rkruppe
removed redundant header file import in rustllvm.h

fix #52105
removed redundant header file import in rustllvm.h
cc @wqweto
2018-07-07 08:27:01 -06:00
Mark Rousskov 6cc38a599a
Rollup merge of #52087 - malbarbo:musl-1.1.19, r=alexcrichton
Update musl to 1.1.19 and add patch to fix tls issue

This fixes https://github.com/rust-lang/rust/issues/48967
2018-07-07 08:27:00 -06:00
Mark Rousskov c98f25b373 Ship clippy in manifests 2018-07-07 08:17:24 -06:00
bors e44906e80c Auto merge of #52109 - michaelwoerister:ir-objs, r=alexcrichton
When doing linker-plugin based LTO, write LLVM bitcode obj-files instead of embedding the bitcode into the regular object file.

This PR makes the compiler emit LLVM bitcode object files instead of regular object files with the IR embed when compiling for linker-plugin-based LTO. The reasoning for switching the strategy is this:
- Embedding bitcode in a section of the object file actually makes us save bitcode twice in rlibs and Rust dylibs, once for linker-based LTO and once for rustc-based LTO. That's a waste of space.
- When compiling for plugin-based LTO, one usually has no use for the machine code also present in the object file. Generating it is a waste of time.
- When compiling for plugin-based LTO, `rustc` will skip running ThinLTO because the linker will do that anyway. This has the side effect of then generating poorly optimized machine code, which makes it even less useful (and may lead to users not knowing why their code is slow instead of getting an error).
- Not having machine code available makes it impossible for the linker to silently fall back to not inlining stuff across language boundaries.
- This is what Clang does and according to [the documentation](https://llvm.org/docs/BitCodeFormat.html#native-object-file-wrapper-format) is the better supported option.
- The current behavior (minus the runtime performance problems) is still available via `-Z embed-bitcode` (we might want to do this for `libstd` at some point).

r? @alexcrichton
2018-07-07 14:09:49 +00:00
Pramod Bisht ab767eecb0 Added UI testcases for #52049 2018-07-07 15:51:50 +05:30
bors 5a7e0f8764 Auto merge of #51993 - TheDarkula:master, r=oli-obk
Omitted the walks in visit_expr() and visit_stmt()

@oli-obk
2018-07-07 09:09:43 +00:00
bjorn3 23c0b3b75c Update Cargo.lock 2018-07-07 11:05:21 +02:00
bjorn3 ff12beb875 Revert changes to bootstrap, rustc_driver and fix {core,std}simd 2018-07-07 10:56:07 +02:00
bjorn3 163cb572a4 Hopefully fix it 2018-07-07 10:56:06 +02:00
bjorn3 a5330415aa Only use coresimd when codegen_backend is LLVM 2018-07-07 10:56:06 +02:00
bjorn3 c7c534fa0e Move llvm_target_features back to llvm_util 2018-07-07 10:55:47 +02:00
bjorn3 c504d26c1c Move time_graph.rs to rustc/util 2018-07-07 10:52:31 +02:00
bjorn3 c5a6b51e44 Update Cargo.lock and move size_and_align_of_dst back 2018-07-07 10:52:29 +02:00
bjorn3 c61531dc55 Remove unused rustc_driver dependency on ar 2018-07-07 10:52:19 +02:00
bjorn3 cd4989ee94 Leave fixme comment 2018-07-07 10:52:18 +02:00
bjorn3 e65db8161d Fix test 2018-07-07 10:52:18 +02:00
bjorn3 097de536e4 Fix metadata_only metadata encoding 2018-07-07 10:52:15 +02:00
bjorn3 d7bc293746 Solve review comment 2018-07-07 10:51:54 +02:00
bjorn3 f44ec6439b Undo unnecessary change 2018-07-07 10:51:54 +02:00
bjorn3 edd6ed571f Fix some errors 2018-07-07 10:51:54 +02:00
bjorn3 95ed511514 Mostly fix compiling without LLVM (with metadata_only backend) 2018-07-07 10:51:51 +02:00
bjorn3 6ceb1637b2 Move some functions out of rustc_codegen_llvm and fix metadata_only backend 2018-07-07 10:47:22 +02:00
bors 599d2c01e0 Auto merge of #52037 - lqd:skipping-regionless-types, r=nikomatsakis
NLL Liveness: Skip regionless types when visiting free regions

The tuple-stress benchmark exercises the liveness constraint generation code for types which do not have regions

Closes #52027
2018-07-07 07:06:14 +00:00
jD91mZM2 c007a78d23
Add is_unnamed 2018-07-07 06:52:03 +02:00
jD91mZM2 abac5e722f
Revert unification of interfaces 2018-07-07 06:50:55 +02:00
Pramod Bisht 63c3fddc96 removed redundant header file import in rustllvm.h 2018-07-07 09:37:41 +05:30
Pramod Bisht d5f443d81d Addresses #52049 2018-07-07 09:32:41 +05:30
csmoe f5f97b37a7 update tests 2018-07-07 11:57:04 +08:00
bors 4f0ca9248f Auto merge of #52123 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 9 pull requests

Successful merges:

 - #51901 (Rc: remove unused allocation and fix segfault in Weak::new())
 - #52058 (Use of unimplemented!() causing ICE with NLL)
 - #52067 (Visit the mir basic blocks in reverse-postfix order)
 - #52083 (Dont run ast borrowck on mir mode)
 - #52099 (fix typo in stable `--edition` error message)
 - #52103 (Stabilize rc_downcast)
 - #52104 (Remove unnecessary feature gate.)
 - #52117 (Dedupe filetime)
 - #52120 (ARM: expose the "mclass" target feature)

Failed merges:

r? @ghost
2018-07-07 03:55:28 +00:00
Mark Rousskov cd7ddae695
Rollup merge of #52120 - japaric:mclass, r=alexcrichton
ARM: expose the "mclass" target feature

This let us differentiate, in conditional compilation context, between ARM Cortex-M targets, like
the `thumbv*` targets, and other ARM targets, like the ARM Cortex-A Linux targets.

r? @alexcrichton
cc @gnzlbg
cc rust-lang-nursery/stdsimd#437
2018-07-06 21:29:20 -06:00
Mark Rousskov 4784883e52
Rollup merge of #52117 - Eijebong:filetime, r=alexcrichton
Dedupe filetime
2018-07-06 21:29:19 -06:00
Mark Rousskov f69baa92e4
Rollup merge of #52104 - tmccombs:repr_trans_stable, r=Mark-Simulacrum
Remove unnecessary feature gate.

To fix a warning.
2018-07-06 21:29:18 -06:00
Mark Rousskov e3823388a8
Rollup merge of #52103 - tmccombs:rc_downcast, r=Mark-Simulacrum
Stabilize rc_downcast

Fixes #44608
2018-07-06 21:29:17 -06:00
Mark Rousskov 9672933639
Rollup merge of #52099 - zackmdavis:and_the_case_of_the_typ, r=oli-obk
fix typo in stable `--edition` error message

(diff is self-explanatory)
2018-07-06 21:29:16 -06:00
Mark Rousskov 54a440b469
Rollup merge of #52083 - spastorino:dont-run-ast-borrowck-on-mir-mode, r=nikomatsakis
Dont run ast borrowck on mir mode

r? @nikomatsakis
2018-07-06 21:29:14 -06:00
Mark Rousskov ec6bba319b
Rollup merge of #52067 - csmoe:issue-51167, r=nikomatsakis
Visit the mir basic blocks in reverse-postfix order

cc #51167
r? @nikomatsakis
2018-07-06 21:29:13 -06:00
Mark Rousskov b71b92199c
Rollup merge of #52058 - davidtwco:issue-51345, r=nikomatsakis
Use of unimplemented!() causing ICE with NLL

Fixes #51345.

r? @nikomatsakis
2018-07-06 21:29:12 -06:00
Mark Rousskov 9b3ec57c16
Rollup merge of #51901 - rust-lang:weak-unboxing, r=alexcrichton
Rc: remove unused allocation and fix segfault in Weak::new()

Same as https://github.com/rust-lang/rust/pull/50357 did for `Arc`.

Fixes https://github.com/rust-lang/rust/issues/48493
2018-07-06 21:29:11 -06:00
csmoe b9c6dba5c4 extend where clauses 2018-07-07 11:02:47 +08:00
bors 99b0ddb88a Auto merge of #51656 - soc:topic/fix-home-dir, r=SimonSapin
Deprecate `std::env::home_dir` and fix incorrect documentation

Compare `std::env::home_dir`s claim:

> Returns the value of the 'HOME' environment variable if it is set and not equal to the empty string.

... with its actual behavior:

```
std::env::set_var("HOME", "");
println!("{:?}", std::env::var_os("HOME")); // Some("")
println!("{:?}", std::env::home_dir());     // Some("")
```

The implementation is incorrect in two cases:
- `$HOME` is set, but empty.
- An entry for the user exists in `/etc/passwd`, but it's `pw_dir` is empty.

In both cases Rust considers an empty string to be a valid home directory. This contradicts the documentation, and is wrong in general.
2018-07-07 01:51:08 +00:00
Meade Kincke f629eb3595 General fixes and cleanup. 2018-07-07 01:09:09 +01:00
Meade Kincke 75bc0649b8 Omitted the walk in visit_expr() 2018-07-07 01:09:09 +01:00
Simon Sapin 67202b8b68 Fix is_dangling import when Arc is #[cfg]’ed out 2018-07-07 01:44:57 +02:00
Simon Sapin 5717d99d1b Add some unit tests for dangling Weak references 2018-07-07 01:41:30 +02:00
Simon Sapin 21526c5403 Add a test for Weak::new() not crashing for uninhabited types 2018-07-07 01:41:30 +02:00
Simon Sapin 41730b7e2e Rc: remove unused allocation from Weak::new()
Same as https://github.com/rust-lang/rust/pull/50357
2018-07-07 01:41:30 +02:00
Simon Sapin 6e2c49ff0e Use an aligned dangling pointer in Weak::new, rather than address 1 2018-07-07 01:41:30 +02:00
bors a178cba9f1 Auto merge of #52021 - nikomatsakis:nll-region-errors, r=estebank
refactor and cleanup region errors for NLL

This is a WIP commit. It simplifies some of the code from https://github.com/rust-lang/rust/pull/51536 and extends a few more steps towards the errors that @davidtwco and I were shooting for. These are intended as a replacement for the general "unable to infer lifetime" messages -- one that is actually actionable. We're certainly not there yet, but the overall shape hopefully gets a bit clearer.

I'm thinking about trying to open up an internals thread to sketch out the overall plan and perhaps discuss how to get the wording right, which special cases to handle, etc.

r? @estebank
cc @davidtwco
2018-07-06 23:36:16 +00:00
Jorge Aparicio b7047bb89f ARM: expose the "mclass" target feature 2018-07-06 18:28:38 -05:00
Simon Ochsenreither 0afc16a039 Deprecate `std::env::home_dir` and fix incorrect documentation 2018-07-07 01:28:37 +02:00
Bastien Orivel 933c299443 Dedupe filetime 2018-07-06 22:52:40 +02:00
bors e06c875442 Auto merge of #51757 - nielx:fix/haiku-fixes, r=nagisa
Haiku: several smaller fixes to build and run rust on Haiku

This PR combines three small patches that help Rust build and run on the Haiku platform. These patches do not intend to impact other platforms.
2018-07-06 20:05:23 +00:00
Matt Brubeck cdff2f3b30 impl Clone for Box<CStr>, Box<OsStr>, Box<Path>
Implements #51908.
2018-07-06 12:57:47 -07:00
bors 3ea16c3493 Auto merge of #52018 - flip1995:rfc2103, r=oli-obk
Implementation of tool lints.

Tracking issue: #44690
2018-07-06 18:03:46 +00:00
bors 062a416dd4 Auto merge of #52010 - toidiu:ak-crossCrateOutlives, r=nikomatsakis
Fix: infer outlives requirements across crates

Fixes https://github.com/rust-lang/rust/issues/51858
2018-07-06 16:01:25 +00:00
csmoe 88f475c808 suggests with whole macro call 2018-07-06 22:31:55 +08:00
bors 50302821c4 Auto merge of #51894 - mikhail-m1:8636, r=nikomatsakis
fix for issue #8636

r? @nikomatsakis

Fix #8636

also fixes #42291
2018-07-06 12:54:45 +00:00
Michael Woerister 4a269642c9 Remove CrossLangLto::NoLink which does not have a use case anymore. 2018-07-06 14:08:40 +02:00
Michael Woerister 72df804d8e When doing linker-plugin based LTO, write LLVM bitcode obj-files
instead of embedding the bitcode into the regular object file.
2018-07-06 13:58:25 +02:00
bors ded86ccc2c Auto merge of #51677 - nrc:update, r=kennytm
Update RLS and Rustfmt

r? @Mark-Simulacrum
2018-07-06 10:55:02 +00:00
csmoe a6d4d2b945 refactor 2018-07-06 18:44:42 +08:00
Niko Matsakis 6d0644c65a
tweak comment 2018-07-06 06:33:38 -04:00
bors 0072c95aff Auto merge of #51953 - japaric:atomic-load-store, r=alexcrichton
enable Atomic*.{load,store} for ARMv6-M / MSP430

closes #45085

as proposed in https://github.com/rust-lang/rust/issues/45085#issuecomment-384825434

this commit adds an `atomic_cas` target option and extends the `#[cfg(target_has_atomic)]`
attribute to enable a subset of the `Atomic*` API on architectures that don't support atomic CAS
natively, like MSP430 and ARMv6-M.

r? @alexcrichton
2018-07-06 08:59:22 +00:00
Nick Cameron 7717705c35 Update RLS, Rustfmt, Cargo, and Clippy 2018-07-06 20:58:21 +12:00
Thayne McCombs 15a196ec36 Remove unnecessary feature gate.
To fix a warning.
2018-07-06 01:06:17 -06:00
Thayne McCombs 7fbc3895e3 Stabilize rc_downcast
Fixes #44608
2018-07-06 01:00:40 -06:00
bors 4d9fa2326e Auto merge of #52088 - kennytm:rollup, r=kennytm
Rollup of 14 pull requests

Successful merges:

 - #51619 (rust: add initial changes to support powerpc64le musl)
 - #51793 (Fix variant background color on hover in search results)
 - #52005 (Update LLVM to bring in a wasm codegen fix)
 - #52016 (Deduplicate error reports for statics)
 - #52019 ([cross-lang-lto] Allow the linker to choose the LTO-plugin (which is useful when using LLD))
 - #52030 (Any docs preposition change)
 - #52031 (Strenghten synchronization in `Arc::is_unique`)
 - #52033 ([Gardening] Update outdated comments: ByVal -> Scalar)
 - #52055 (Include VS 2017 in error message.)
 - #52063 (Add a link to the rustc docs)
 - #52073 (Add a punch card to weird expressions test)
 - #52080 (Improve dependency deduplication diagnostics)
 - #52093 (rustc: Update tracking issue for wasm_import_module)
 - #52096 (Fix typo in cell.rs)

Failed merges:
2018-07-06 06:48:12 +00:00
Niels Sascha Reedijk 90e32e2ac6 Haiku: work around the lack of setrlimit
By default, Haiku has the desired 16 MB stack, therefore in general
we do not have to spawn a new thread. The code has been written in
such a way that any changes in Haiku or in Rust will be adapted to.
2018-07-06 07:19:11 +02:00
kennytm 1a8011f617
Rollup merge of #52093 - alexcrichton:update-issue, r=kennytm
rustc: Update tracking issue for wasm_import_module

It's now https://github.com/rust-lang/rust/issues/52090
2018-07-06 13:02:06 +08:00
kennytm 3c21349e07
Rollup merge of #52055 - crlf0710:patch-3, r=Mark-Simulacrum
Include VS 2017 in error message.

Update error prompt message to indicate that VS 2017 is supported (for a while now).
2018-07-06 12:56:26 +08:00
kennytm f1a36fc29f
Rollup merge of #52080 - oli-obk:dep_dedup_diagnostics, r=kennytm
Improve dependency deduplication diagnostics

r? @kennytm

this is obviously hard to test 😆

cc #52072
2018-07-06 12:56:24 +08:00
kennytm 596d1a782d
Rollup merge of #52073 - xfix:patch-7, r=oli-obk
Add a punch card to weird expressions test
2018-07-06 12:56:23 +08:00
Zack M. Davis bbfdea28cd typo-fix stable ed'n error: "an onlyavailable" → "and only available" 2018-07-05 21:52:07 -07:00
Alex Crichton 23fbfb57cf rustc: Update tracking issue for wasm_import_module
It's now https://github.com/rust-lang/rust/issues/52090
2018-07-05 21:27:27 -07:00
Jorge Aparicio f9145d01e1 update run-pass test 2018-07-05 20:18:19 -05:00
kennytm 6d35505b9b
Rollup merge of #52033 - zachrwolfe:outdated_value_comment, r=oli-obk
[Gardening] Update outdated comments: ByVal -> Scalar

ByVal enum cases in mir::interpret::value were renamed to Scalar a while ago but comments still refer to the old names.
2018-07-06 08:49:25 +08:00
kennytm b87b22e53c
Rollup merge of #52031 - RalfJung:arc, r=sfackler
Strenghten synchronization in `Arc::is_unique`

Previously, `is_unique` would not synchronize at all with a `drop` that returned
early because it was not the last reference, leading to a data race.

Fixes #51780

Unfortunately I have no idea how to add a test for this.

Cc @jhjourdan
2018-07-06 08:49:23 +08:00
kennytm 7ce7bf0e37
Rollup merge of #52030 - bowbahdoe:patch-1, r=alexcrichton
Any docs preposition change

This changes the docs referring to where a user should be wary of depending on "Any" trait impls from warning about relying on them "outside" of their code to warning about relying on them "inside" of their code.
2018-07-06 08:49:22 +08:00
kennytm ffc453abf7
Rollup merge of #52019 - michaelwoerister:cross-lto-auto-plugin, r=alexcrichton
[cross-lang-lto] Allow the linker to choose the LTO-plugin (which is useful when using LLD)

This PR allows for not specifying an LTO-linker plugin but still let `rustc` invoke the linker with the correct plugin arguments. This is useful when using LLD which does not need the `-plugin` argument. Since LLD is the best linker for this scenario anyway, this change should improve ergonomics quite a bit.

r? @alexcrichton
2018-07-06 08:49:20 +08:00
kennytm a4846aebd8
Rollup merge of #52016 - oli-obk:dedup_static_errors, r=estebank
Deduplicate error reports for statics

fixes #51970
2018-07-06 08:49:19 +08:00
kennytm 1568b5e6d7
Rollup merge of #52005 - alexcrichton:update-llvm-for-wasm, r=kennytm
Update LLVM to bring in a wasm codegen fix

Closes #51986
2018-07-06 08:49:18 +08:00
bors a8403e1cda Auto merge of #51861 - GuillaumeGomez:prevent-some-markdown-short-doc, r=QuietMisdreavus
Prevent some markdown transformation on short docblocks

Before:

<img width="1440" alt="screen shot 2018-06-28 at 01 46 01" src="https://user-images.githubusercontent.com/3050060/42005762-7d533bbe-7a76-11e8-8361-027886803399.png">

After:

<img width="1440" alt="screen shot 2018-06-28 at 01 46 02" src="https://user-images.githubusercontent.com/3050060/42005768-81bd59a0-7a76-11e8-819b-9b4be72579d6.png">

This is only performed on short doc blocks, not on plain ones. Not all transformations are prevented (you still have a few like urls, code blocks, etc...).

cc @nical

r? @QuietMisdreavus
2018-07-06 00:36:34 +00:00
Marco A L Barbosa f969b61bd6 Update musl to 1.1.19 and add patch to fix tls issue 2018-07-05 20:17:57 -03:00
kennytm 6650d7f1a2
Rollup merge of #51793 - GuillaumeGomez:search-result-hover, r=QuietMisdreavus
Fix variant background color on hover in search results

Fixes #51792.

<img width="1440" alt="screen shot 2018-06-26 at 00 37 24" src="https://user-images.githubusercontent.com/3050060/41879313-60ecf3be-78d9-11e8-9986-21af529ab758.png">

r? @QuietMisdreavus
2018-07-06 07:07:11 +08:00
kennytm 185fb7b77c
Rollup merge of #51619 - mksully22:ppc64le_rust, r=alexcrichton
rust: add initial changes to support powerpc64le musl

Initial changes to support rustc building on ppc64le with musl. A PR was also submitted to libc component https://github.com/rust-lang/libc/pull/1023 to add changes to libc musl definitions.

A PR was submitted on Alpine https://github.com/alpinelinux/aports/pull/4549 with equivalent temporary patches for building on Alpine for now.

As a verification test a github project was put together to build ppc64le versions of rustc, rust-stdlib, and cargo on Alpine, https://github.com/mksully22/ppc64le_alpine_rust_1.26.2
2018-07-06 07:07:10 +08:00
bors 00f49728e0 Auto merge of #51732 - GuillaumeGomez:cmd-line-lint-rustdoc, r=QuietMisdreavus
Add command line lint manipulation in rustdoc

Fixes #50082.

r? @QuietMisdreavus
2018-07-05 22:28:53 +00:00
Jorge Aparicio 0ed32313a2 #[cfg(target_has_atomic_cas)] -> #[cfg(target_has_atomic = "cas")] 2018-07-05 16:52:46 -05:00
Jorge Aparicio bbf688a84d enable Atomic*.{load,store} for ARMv6-M / MSP430
closes #45085

this commit adds an `atomic_cas` target option and an unstable `#[cfg(target_has_atomic_cas)]`
attribute to enable a subset of the `Atomic*` API on architectures that don't support atomic CAS
natively, like MSP430 and ARMv6-M.
2018-07-05 16:44:29 -05:00
Josh Stone 557736befc Update scalar pairs per review comments 2018-07-05 14:22:09 -07:00
Eduard-Mihai Burtescu ce94518ed3 rustc_codegen_llvm: replace the first argument early in FnType::new_vtable. 2018-07-06 00:17:13 +03:00
bors 2d5a295d51 Auto merge of #51917 - alexcrichton:update, r=Mark-Simulacrum
Update crates in `Cargo.lock`

This is a "hopefully routine" update of our crates.io-based crates in
`Cargo.lock`, and let's see how it fares on CI...
2018-07-05 20:25:00 +00:00
Santiago Pastorino 25266c1840
Do not run AST borrowck when -Zborrowck=mir 2018-07-05 16:57:32 -03:00
Guillaume Gomez e221be89e0 Add command line lint manipulation in rustdoc 2018-07-05 21:07:51 +02:00
bors 478226cc2a Auto merge of #51599 - GuillaumeGomez:reduce-search-index, r=QuietMisdreavus
reduce search-index size

Reduce size of `search-index.js` of around 16%:

Going from `2996785` bytes to `2545583`.

r? @QuietMisdreavus
2018-07-05 18:21:25 +00:00
Guillaume Gomez 92cda8c7da Whitelist lints 2018-07-05 20:06:33 +02:00
Oliver Schneider f352e98ddc Address review comments 2018-07-05 19:30:06 +02:00
Oliver Schneider f1e3a5a24b Only display difference of features, not all features 2018-07-05 19:02:43 +02:00
Josh Stone e578976560 Store scalar pair bools as i8 in memory
We represent `bool` as `i1` in a `ScalarPair`, unlike other aggregates,
to optimize IR for checked operators and the like.  With this patch, we
still do so when the pair is an immediate value, but we use the `i8`
memory type when the value is loaded or stored as an LLVM aggregate.

So `(bool, bool)` looks like an `{ i1, i1 }` immediate, but `{ i8, i8 }`
in memory.  When a pair is a direct function argument, `PassMode::Pair`,
it is still passed using the immediate `i1` type, but as a return value
it will use the `i8` memory type.  Also, `bool`-like` enum tags will now
use scalar pairs when possible, where they were previously excluded due
to optimization issues.
2018-07-05 09:59:52 -07:00
Oliver Schneider 82a1328740 Vertical list of tools to check 2018-07-05 18:48:56 +02:00
Alex Crichton d825115978 Update Cargo.lock dependencies
Run `cargo update` and let's see how far we can get!
2018-07-05 09:30:27 -07:00
Val Markovic dc425e2e64
Clarifying how the alignment of the struct works
The docs were not specifying how to compute the alignment of the struct, so I had to spend some time trying to figure out how that works. Found the answer [on this page](http://camlorn.net/posts/April%202017/rust-struct-field-reordering.html):

> The total size of this struct is 5, but the most-aligned field is b with alignment 2, so we round up to 6 and give the struct an alignment of 2 bytes.
2018-07-05 09:24:03 -07:00
Guillaume Gomez 1ff7f04120 Fix rustdoc run failures by shutting down definitely some lints 2018-07-05 17:18:45 +02:00
bors 94eb176055 Auto merge of #52012 - oli-obk:clippy, r=kennytm
Update the clippy submodule
2018-07-05 11:44:08 +00:00
Oliver Schneider d5dbeda9ef Update the clippy submodule 2018-07-05 13:42:12 +02:00
csmoe ff83ef0c24 merge wellformed(wc)s 2018-07-05 18:49:02 +08:00
csmoe dabd3f6935 split IntoWellFormedGoal 2018-07-05 18:47:00 +08:00
csmoe 329d03ac1f update test 2018-07-05 18:47:00 +08:00
csmoe e2f3577131 wellformed wc 2018-07-05 18:46:43 +08:00
Mikhail Modin f247a3e490 fix for issue #8636 2018-07-05 11:34:10 +01:00
Konrad Borowski 0ce01776ba Add a punch card to weird expressions test 2018-07-05 12:31:09 +02:00
bors 69b9e1e8f9 Auto merge of #51967 - varkor:const-body-break-continue, r=estebank
Fix various issues with control-flow statements inside anonymous constants

Fixes #51761.
Fixes #51963 (and the host of other reported issues there).
(Might be easiest to review per commit, as they should be standalone.)

r? @estebank
2018-07-05 09:40:08 +00:00
csmoe e7e8c72fdd update test 2018-07-05 17:38:44 +08:00
bors 6fc21e5576 Auto merge of #51936 - japaric:rust-lld, r=alexcrichton
rename rustc's lld to rust-lld

to not shadow the system installed LLD when linking with LLD.

Before:

- `-C linker=lld -Z linker-flavor=ld.lld` uses rustc's LLD
- It's not possible to use a system installed LLD that's named `lld`

With this commit:

- `-C linker=rust-lld -Z linker-flavor=ld.lld` uses rustc's LLD
- `-C linker=lld -Z linker-flavor=ld.lld` uses the system installed LLD

we don't offer guarantees about the availability of LLD in the rustc sysroot so we can rename the tool as long as we don't break the wasm32-unknown-unknown target which depends on it.

r? @alexcrichton we discussed this before
2018-07-05 06:44:16 +00:00
Jorge Aparicio 31ed5c7a01 in the second copy lld is already named rust-lld 2018-07-04 23:10:10 -05:00
bors c865d3934c Auto merge of #51938 - zackmdavis:and_the_case_of_the_leaking_desugar, r=estebank
in which we plug the crack where `?`-desugaring leaked into errors

Most of the time, it's not a problem that the types of the arm bodies in
a desugared-from-`?` match are different (that is, specifically: in `x?`
where x is a `Result<A, B>`, the `Ok` arm body is an `A`, whereas the
`Err` arm diverges to return a `Result<A, B>`), because they're being
assigned to different places. But in tail position, the types do need to
match, and our error message was explicitly referring to "match arms",
which is confusing when there's no `match` in the sweetly sugared
source.

It is not without some misgivings that we pollute the clarity-of-purpose
of `note_error_origin` with the suggestion to wrap with `Ok` (the other
branches are pointing out the odd-arm-out in the HIR that is the origin
of the error; the new branch that issues the `Ok` suggestion is serving
a different purpose), but it's the natural place to do it given that
we're already matching on `ObligationCauseCode::MatchExpressionArm {
arm_span, source }` there.

Resolves #51632.
2018-07-05 02:35:25 +00:00
Santiago Pastorino 0e31e2fa9b
Remove rustc_mir_borrowck attribute and use rustc_mir instead 2018-07-04 23:10:28 -03:00
csmoe 37228fe632 reverse_postorder 2018-07-05 09:46:10 +08:00
Benjamin Peterson 70a6aeac0d Remove obsolete documentation from FufillmentContext::select comment.
The `only_new_obligations` parameter has not existed since 43756934d2.
2018-07-04 18:25:04 -07:00
bors b51ca20ce5 Auto merge of #51964 - matthewjasper:unused-mut-mir-generation, r=nikomatsakis
[NLL] Fix various unused mut errors

Closes #51801
Closes #50897
Closes #51830
Closes #51904
cc #51918 - keeping this one open in case there are any more issues

This PR contains multiple changes. List of changes with examples of what they fix:

* Change mir generation so that the parameter variable doesn't get a name when a `ref` pattern is used as an argument
```rust
fn f(ref y: i32) {} // doesn't trigger lint
```
* Change mir generation so that by-move closure captures don't get first moved into a temporary.
```rust
let mut x = 0; // doesn't trigger lint
move || {
    x = 1;
};
```
* Treat generator upvars the same as closure upvars
```rust
let mut x = 0; // This mut is now necessary and is not linted against.
move || {
    x = 1;
    yield;
};
```

r? @nikomatsakis
2018-07-05 00:22:14 +00:00
Dylan MacKenzie cf5eaa75bb Move `Eq + Hash + Clone` bounds to `Machine` 2018-07-04 14:36:07 -07:00
Dylan MacKenzie c395044a50 Shorten error message and add link to test
Implements @bjorn3's suggestions.
2018-07-04 14:36:07 -07:00
Dylan MacKenzie 0d0e021b1c Derive Eq and Hash for types used in Miri's evaluator 2018-07-04 14:36:07 -07:00
Dylan MacKenzie b3b04b8cc6 Avoid overflow in step counter
This removes the `usize` argument to `inc_step_counter`. Now, the step
counter increments by exactly one for every terminator evaluated. After
`STEPS_UNTIL_DETECTOR_ENABLED` steps elapse, the detector is run every
`DETECTOR_SNAPSHOT_PERIOD` steps. The step counter is only kept modulo
this period.
2018-07-04 14:36:07 -07:00
Dylan MacKenzie 647ba29b90 Explain reason behind error span
We can't expand the span of the error reliably according to @oli-obk, so
just mention why it points to this particular expression.
2018-07-04 14:36:07 -07:00
Dylan MacKenzie d36302da53 Add a UI test for #50637
This test relies on the fact that restrictions on expressions in `const
fn` do not apply when computing array lengths. It is more difficult to
statically analyze than the simple `loop{}` mentioned in #50637.

This test should be updated to ignore the warning after #49980 is resolved.
2018-07-04 14:36:07 -07:00
Dylan MacKenzie 10f217159b Rename `bloom` to `hashes` 2018-07-04 14:36:07 -07:00
Dylan MacKenzie c6aea935cf Enable loop detector in step loop
The detector runs every `DETECTOR_SNAPSHOT_PERIOD` steps. Since the
number of steps can increase by more than 1 (I'd like to remove this),
the detector may fail if the step counter is incremented past the
scheduled detection point during the loop.
2018-07-04 14:36:07 -07:00
Dylan MacKenzie f7e9d2ac3e Add an `InfiniteLoop` variant to `EvalErrorKind` 2018-07-04 14:36:07 -07:00
Dylan MacKenzie 0f1c61cb7f Improve correctness of `Frame` and `Memory` equality
Incorporate a subset of the suggestions from @oli-obk. More to come.
2018-07-04 14:36:07 -07:00
Dylan MacKenzie 788c5f3c8b Revert "Refactor EvalContext stack and heap into inner struct"
This reverts commit 59d21c526c036d7097d05edd6dffdad9c5b1cb62, and uses
tuple to store the mutable parts of an EvalContext (which now includes
`Machine`). This requires that `Machine` be `Clone`.
2018-07-04 14:36:07 -07:00
Dylan MacKenzie 7f9b01a0fc Add miri infinite loop detection
Use the approach suggested by @oli-obk, a table holding `EvalState`
hashes and a table holding full `EvalState` objects. When a hash
collision is observed, the state is cloned and put into the full
table. If the collision was not spurious, it will be detected during the
next iteration of the infinite loop.
2018-07-04 14:36:07 -07:00
Dylan MacKenzie 6c0f502fe6 Implement Clone, Eq and Hash for the heap and stack
I use a pattern binding in each custom impl, so that adding fields to
`Memory` or `Frame` will cause a compiler error instead of causing e.g.
`PartialEq` to become invalid. This may be too cute.

This adds several requirements to `Machine::MemoryData`. These can be
removed if we don't want this associated type to be part of the equality
of `Memory`.
2018-07-04 14:36:07 -07:00
Dylan MacKenzie db025c14ec Refactor EvalContext stack and heap into inner struct
Change surrounding code to use accessor methods to refer to these fields.
Similar changes have not yet been made in tools/miri
2018-07-04 14:36:07 -07:00
David Wood f90eada1c9
Improve comments. 2018-07-04 21:48:25 +01:00
David Wood aeb1682894
Ensure that borrows wind up unactivated. 2018-07-04 21:35:38 +01:00
bors afaa406465 Auto merge of #51803 - lucasem:rustdoc-code-hash-escape, r=GuillaumeGomez
rustdoc codeblock hash escape

So that docstring text such as the following (in a code block) can be created ergonomically:

```rust
let s = "
    foo
    # bar
    baz
";
```

Such code in a docstring hide the <code>&nbsp;&nbsp;&nbsp;&nbsp;# bar</code> line.

Previously, using two consecutive hashes <code>&nbsp;&nbsp;&nbsp;&nbsp;## bar</code> would turn the line into _shown_ `# bar`, losing the leading whitespace. A line of code like <code>&nbsp;&nbsp;&nbsp;&nbsp;# bar</code> (such as in the example above) **could not be represented** in the docstring text.

This commit makes the two consecutive hashes not also trim the leading whitespace — the two hashes simply **escape** into a single hash and do not hide the line, leaving the rest of that line unaffected. The new docstring text to achieve the above code block is:

```rust
/// ```
/// let s = "
///     foo
///     ## bar
///     baz
/// ";
/// ```
```
2018-07-04 20:21:01 +00:00
David Wood 7eba13f451
Correctly handle an activation from dead code. 2018-07-04 20:08:15 +01:00
bors 4af9132a02 Auto merge of #51611 - QuietMisdreavus:slippery-macros, r=ollie27
rustdoc: import cross-crate macros alongside everything else

The thrilling conclusion of the cross-crate macro saga in rustdoc! After https://github.com/rust-lang/rust/pull/51425 made sure we saw all the namespaces of an import (and prevented us from losing the `vec!` macro in std's documentation), here is the PR to handle cross-crate macro re-exports at the same time as everything else. This way, attributes like `#[doc(hidden)]` and `#[doc(no_inline)]` can be used to control how the documentation for these macros is seen, rather than rustdoc inlining every macro every time.

Fixes https://github.com/rust-lang/rust/issues/50647
2018-07-04 18:15:14 +00:00
Lucas Morales ff2ff2b2b8
rustdoc book on codeblock hash escaping 2018-07-04 12:41:45 -04:00
bors 0ad8f9e5b1 Auto merge of #51395 - SimonSapin:repr-transparent, r=SimonSapin
Add #[repr(transparent)] to some libcore types

* `UnsafeCell`
* `Cell`
* `NonZero*`
* `NonNull`
* `Unique`

CC https://github.com/rust-lang/rust/issues/43036
2018-07-04 16:21:42 +00:00
CrLF0710 30063ae2a5
Shorten the line
Shorten the line to make tidy happy.
2018-07-04 23:36:51 +08:00
CrLF0710 1dae60ea4c
Include VS 2017 in error message.
Update error prompt message to indicate that VS 2017 is supported (for a while now).
2018-07-04 22:49:35 +08:00
bors eded1aa14c Auto merge of #51870 - nnethercote:reuse-DefsUsesVisitor, r=nikomatsakis
Reuse the `DefsUsesVisitor` in `simulate_block()`.

This avoids a bunch of allocations for the bitsets within it,
speeding up a number of NLL benchmarks, the best by 1%.

r? @nikomatsakis
2018-07-04 14:12:14 +00:00
flip1995 c3949009ad
Improving span of unknown lint tool error message 2018-07-04 14:28:44 +02:00
bors a22bcd8aab Auto merge of #51935 - cramertj:unpin-references, r=withoutboats
Unpin references

I also considered adding an impl for raw pointers as well, but that makes it easy to accidentally have unsound owning-collections that might otherwise be able to project pinned-ness (e.g. `Box`).

cc @RalfJung

r? @withoutboats
2018-07-04 11:32:40 +00:00
flip1995 a9634fcd01
Unstable book documentation of tool lints 2018-07-04 12:16:46 +02:00
flip1995 dddb8d2eba
Implementation of tool lints 2018-07-04 12:16:46 +02:00
flip1995 ed29e86c39
Tests for tool_lints 2018-07-04 12:16:45 +02:00
bors 8dd715ee5e Auto merge of #51895 - nikomatsakis:move-self-trait-predicate-to-items, r=scalexm
Move self trait predicate to items

This is a "reimagination" of @tmandry's PR #50183. The main effect is described in this comment from one of the commits:

---

Before we had the following results for `predicates_of`:

```rust
trait Foo { // predicates_of: Self: Foo
  fn bar(); // predicates_of: Self: Foo (inherited from trait)
}
```

Now we have removed the `Self: Foo` from the trait. However, we still
add it to the trait ITEM. This is because when people do things like
`<T as Foo>::bar()`, they still need to prove that `T: Foo`, and
having it in the `predicates_of` seems to be the cleanest way to
ensure that happens right now (otherwise, we'd need special case code
in various places):

```rust
trait Foo { // predicates_of: []
  fn bar(); // predicates_of: Self: Foo
}
```

However, we sometimes want to get the list of *just* the predicates
truly defined on a trait item (e.g., for chalk, but also for a few
other bits of code). For that, we define `predicates_defined_on`,
which does not contain the `Self: Foo` predicate yet, and we plumb
that through metadata and so forth.

---

I'm assigning @eddyb as the main reviewer, but I thought I might delegate to scalexm for this one in any case. I also want to post an alternative that I'll leave in the comments; it occurred to me as I was writing. =)

r? @eddyb
cc @scalexm @tmandry @leodasvacas
2018-07-04 09:33:33 +00:00
Niko Matsakis 727f01700b write code to extract region names and emit new style message 2018-07-04 05:09:33 -04:00
Rémy Rakic 0190286d48 NLL Liveness: Skip regionless types when visiting free regions
The tuple-stress benchmark exercises the liveness constraint generation code for types which do not have regions
2018-07-04 08:50:12 +02:00
Nicholas Nethercote b0c78120e3 Reuse the `DefsUsesVisitor` in `simulate_block()`.
This avoids a bunch of allocations for the bitsets within it,
speeding up a number of NLL benchmarks, the best by 1%.
2018-07-04 13:05:03 +10:00
Alex Crichton ef41cf0288 Compile stage0 tools with the raw bootstrap compiler
This commit updates the stage0 build of tools to use the libraries of the stage0
compiler instead of the compiled libraries by the stage0 compiler. This should
enable us to avoid any stage0 hacks (like missing SIMD).
2018-07-03 18:06:29 -07:00
csmoe c999b253b7 add span note 2018-07-04 09:01:11 +08:00
bors a739c51d10 Auto merge of #51926 - matthewjasper:Initialization-span, r=nikomatsakis
[NLL] Use better span for initializing a variable twice

Closes #51217

When assigning to a (projection from a) local immutable local which starts initialised (everything except `let PATTERN;`):

* Point to the declaration of that local
* Make the error message refer to the local, rather than the projection.

r? @nikomatsakis
2018-07-03 23:54:25 +00:00
Niko Matsakis fa02d68eec universal_regions: rustfmt 2018-07-03 18:10:08 -04:00
Niko Matsakis 8b3ce9ca68 always create a category, even it is just "boring" 2018-07-03 18:10:08 -04:00
Niko Matsakis aae177e005 promote `error-reporting` to a module 2018-07-03 18:10:08 -04:00
Niko Matsakis 351e78de26 add `assert_crate_local` method to `ClearCrossCrate` 2018-07-03 18:10:08 -04:00
Niko Matsakis 37db94d3f2 store the `HirId` of the upvar 2018-07-03 18:10:08 -04:00
Niko Matsakis f03c0366ad add "free region helpers" 2018-07-03 18:10:08 -04:00
Niko Matsakis dddd4075b1 generalize `find_constraint_paths_between_regions` 2018-07-03 18:10:08 -04:00
Niko Matsakis 09f431fad5 simplify and cleanup error-reporting walk code 2018-07-03 18:10:08 -04:00
Niko Matsakis ea0224f5ab error_report: rustfmt 2018-07-03 18:10:08 -04:00
bors fb97bb50d1 Auto merge of #51900 - PramodBisht:51813_b, r=nikomatsakis
introduce dirty list to dataflow

@nikomatsakis my naive implementation never worked, So, I decided to implement using `work_queue` data structure. This PR also includes your commits from `nll-liveness-dirty-list` branch. Those commits should not visible once your branch is merged.

r? @nikomatsakis
2018-07-03 21:48:37 +00:00
Zach Wolfe ecaa7bc490
Update outdated comment: ByVal -> Scalar. 2018-07-03 16:09:13 -05:00
Ralf Jung f96c246869 Strenghten synchronization in `Arc::is_unique`
Previously, `is_unique` would not synchronize at all with a `drop` that returned
early because it was not the last reference, leading to a data race.

Fixes #51780
2018-07-03 22:33:17 +02:00
Ethan McCue 6f223cfc07
Any docs preposition change
This changes the docs referring to where a user should be wary of depending on "Any" trait impls from warning about relying on them "outside" of their code to warning about relying on them "inside" of their code.
2018-07-03 13:13:49 -07:00
Matthew Jasper 125c9d99e5 Fix various nll unused mut errors 2018-07-03 20:12:09 +01:00
Mike Sullivan dd069ea9f6 rust: add initial changes to support powerpc64le musl
amend powerpc64le_unknown_linux_musl.rs to fix copyright date
2018-07-03 18:18:03 +00:00
bors 739320a601 Auto merge of #51450 - estebank:inner-fn-test, r=@pnkfelix
Add lint warning for inner function marked as `#[test]`

Fix #36629.
2018-07-03 18:00:16 +00:00