Commit Graph

87900 Commits

Author SHA1 Message Date
Guillaume Gomez
dbcf68951c Add no-crate filter option on rustdoc 2018-12-24 18:19:36 +01:00
Alex Crichton
8d500572fa std: Use backtrace-sys from crates.io
This commit switches the standard library to using the `backtrace-sys`
crate from crates.io instead of duplicating the logic here in the Rust
repositor with the `backtrace-sys`'s crate's logic.

Eventually this will hopefully be a good step towards using the
`backtrace` crate directly from crates.io itself, but we're not quite
there yet! Hopefully this is a small incremental first step we can take.
2018-12-24 08:32:57 -08:00
bors
37551e9396 Auto merge of #56770 - satyarohith:patch-1, r=Centril
docs(rustc): make hello() public

Running the example code [here](https://doc.rust-lang.org/rustc/what-is-rustc.html#basic-usage) throws error:
```
error[E0603]: function `hello` is private
 --> src/main.rs:4:10
  |
4 |     foo::hello();
  |          ^^^^^
```
Making  `hello()` public fixes the problem.
2018-12-24 16:16:07 +00:00
bors
50f3d6eccb Auto merge of #57094 - Centril:rollup, r=Centril
Rollup of 10 pull requests

Successful merges:

 - #55470 (box: Add documentation for `From` impls)
 - #56242 (Add missing link in docs)
 - #56944 (bootstrap: Link LLVM as a dylib with ThinLTO)
 - #56978 (Add `std::os::fortanix_sgx` module)
 - #56985 (Allow testing pointers for inboundedness while forbidding dangling pointers)
 - #56986 (rustc: Move jemalloc from rustc_driver to rustc)
 - #57010 (Actually run compiletest tests on CI)
 - #57021 (Enable emission of alignment attrs for pointer params)
 - #57074 (Fix recursion limits)
 - #57085 (librustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64)

Failed merges:

r? @ghost
2018-12-24 12:31:41 +00:00
Mazdak Farrokhzad
6ce748ac38
Rollup merge of #57085 - glaubitz:sparc64-abi-fix, r=nagisa
librustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64

This is in accordance with the SPARC Compliance Definition 2.4.1,
Page 3P-12. It says that structs of up to 8 bytes (which applies
to empty structs as well) are to be passed in one register.
2018-12-24 13:29:37 +01:00
Mazdak Farrokhzad
8b0b70d327
Rollup merge of #57074 - Zoxc:pq-rec-limits, r=oli-obk
Fix recursion limits

r? @michaelwoerister
2018-12-24 13:29:36 +01:00
Mazdak Farrokhzad
c44bb0230e
Rollup merge of #57021 - nikic:arg-pointer-align, r=nagisa
Enable emission of alignment attrs for pointer params

Instead disable creation of assumptions during inlining using an LLVM opt flag. For non-inlined functions, this gives us alignment information, while not inserting any assumes that kill other optimizations.

The `-Z arg-align-attributes` option which previously controlled this behavior is removed.

Fixes #54982.

r? @nagisa

cc @eddyb who added the current behavior, and @scottmcm, who added the `-Z arg-align-attributes` flag.
2018-12-24 13:29:35 +01:00
Mazdak Farrokhzad
7011035c1c
Rollup merge of #57010 - phansch:run_compiletest_tests_on_ci, r=kennytm
Actually run compiletest tests on CI

I was assuming that https://github.com/rust-lang/rust/pull/56792 would
have resulted in compiletest tests being executed on CI. However, I
couldn't find any mentions of the unit test names in any CI logs.

This adds the compiletest test execution to the checktools.sh script.
2018-12-24 13:29:33 +01:00
Mazdak Farrokhzad
a0538c8f79
Rollup merge of #56986 - alexcrichton:move-jemalloc, r=Mark-Simulacrum
rustc: Move jemalloc from rustc_driver to rustc

This commit moves jemalloc to just the rustc binary rather than the
rustc_driver shared library, enusring that it's only used for binaries
that opt-in to it like rustc rather than other binaries using
librustc_driver like rustdoc/rls/etc. This will hopefully address #56980
2018-12-24 13:29:32 +01:00
Mazdak Farrokhzad
51f90a1313
Rollup merge of #56985 - oli-obk:const_check_bounds, r=RalfJung
Allow testing pointers for inboundedness while forbidding dangling pointers

r? @RalfJung
2018-12-24 13:29:31 +01:00
Mazdak Farrokhzad
05f3b3cbce
Rollup merge of #56978 - jethrogb:jb/sgx-os-mod, r=joshtriplett
Add `std::os::fortanix_sgx` module

This PR adds the `std::os::sgx` module to expose platform-specific APIs behind the `sgx_platform` feature gate.

Depends on https://github.com/rust-lang/rust/pull/56972 to be able to meaningfully build `std::os` documentation for non-standard targets.

Tracking issue: https://github.com/rust-lang/rust/issues/56975
2018-12-24 13:29:30 +01:00
Mazdak Farrokhzad
f1051b574c
Rollup merge of #56944 - alexcrichton:less-thin2, r=michaelwoerister
bootstrap: Link LLVM as a dylib with ThinLTO

When building a distributed compiler on Linux where we use ThinLTO to
create the LLVM shared object this commit switches the compiler to
dynamically linking that LLVM artifact instead of statically linking to
LLVM. The primary goal here is to reduce CI compile times, avoiding two+
ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll
reuse the one ThinLTO step done by LLVM's build itself.

Lots of discussion about this change can be found [here] and down. A
perf run will show whether this is worth it or not!

[here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334
2018-12-24 13:29:28 +01:00
Mazdak Farrokhzad
833e0b3b8a
Rollup merge of #56242 - GuillaumeGomez:iterator-missing-link, r=Centril
Add missing link in docs

r? @steveklabnik
2018-12-24 13:29:27 +01:00
Mazdak Farrokhzad
1eb87869d1
Rollup merge of #55470 - daniellimws:box-from-docs, r=Centril
box: Add documentation for `From` impls

This is a part of #51430. A brief description of the behaviour and examples are added to the documentation.

I am not sure what sort of examples to put for the `From` for `Pin` as my [code](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2015&gist=97c908f44e41c9faeffec5b61d72a03e) doesn't even manage to compile using the nightly build.

Somehow I feel that I missed out something so do let me know if more information is needed in the documentation or any of the examples require change.
2018-12-24 13:29:26 +01:00
bors
94bf2c15eb Auto merge of #57087 - Centril:rollup, r=Centril
Rollup of 14 pull requests

Successful merges:

 - #56188 (enum type instead of variant suggestion unification )
 - #56342 (Improve docs for collecting into `Option`s)
 - #56916 (Fix mutable references in `static mut`)
 - #56917 (Simplify MIR generation for logical operations)
 - #56939 (Pin stabilization)
 - #56953 (Mark tuple structs as live if their constructors are used)
 - #56964 (Remove `TokenStream::JointTree`.)
 - #56966 (Correct strings for raw pointer deref and array access suggestions)
 - #57020 (Point to cause of `fn` expected return type)
 - #57032 (fix deprecation warnings in liballoc benches)
 - #57053 (Fix alignment for array indexing)
 - #57062 (Fix a comment)
 - #57067 (Stabilize min_const_unsafe_fn in 1.33)
 - #57078 (Ignore two tests on s390x)

Failed merges:

r? @ghost
2018-12-24 07:26:19 +00:00
bors
e16928082a Auto merge of #57079 - matthiaskrgr:clippy, r=oli-obk
submodules: update clippy from a416c5e0 to fc24fce7

Fixes clippy tool state

Changes:
````
FIXME > TODO
rustup https://github.com/rust-lang/rust/pull/56992
Document map_clone known problems #498
Remove header link
test: panic at map_unit_fn.rs:202 for map() without args
rm unused file map_unit_fn.stderr
panic at map_unit_fn.rs:202 for map() without args
Change contrib.md hierarchy, link to it from readme
Workaround rust-lang/rust#43081
Teach `suspicious_else_formatting` about `if .. {..} {..}`
Link to `rustc_driver` crate in plugin
mutex_atomic: Correct location of AtomicBool and friends
Update README local run command to specify syspath
Do not mark as_ref as useless if it's followed by a method call
Changes lint sugg to bitwise and operator `&`
Run update_lints after renaming
Rename lint to MODULE_NAME_REPETITIONS
Add renaming tests
Move renaming to the right place
Implements lint for order comparisons against bool
fix(module_name_repeat): Try to register renamed lint, not valid yet
Fix an endless loop in the tests.
Fix `implicit_return` false positives.
chore(moduel_name_repeat): Rename stutter lint to module_name_repeat to avoid ableist language
Make integration tests fail on 'E0463'
base tests: make sure cargo-clippy binary can be called directly
Revert "Merge pull request #3257 from o01eg/remove-sysroot"
````

r? @oli-obk
2018-12-24 03:41:25 +00:00
Michael Karcher
65dabd6eaf librustc_codegen_llvm: Don't eliminate empty structs in C ABI on linux-sparc64
This is in accordance with the SPARC Compliance Definition 2.4.1,
Page 3P-12. It says that structs of up to 8 bytes (which applies
to empty structs as well) are to be passed in one register.
2018-12-23 23:46:45 +01:00
Mazdak Farrokhzad
dff3e41914
Rollup merge of #57078 - glaubitz:ignore-tests, r=nikic
Ignore two tests on s390x

Ignore two tests on s390x which don't make sense on s390x as they are x86-specific.
2018-12-23 23:09:15 +01:00
Mazdak Farrokhzad
975a7f01f0
Rollup merge of #57067 - Centril:stabilize-min_const_unsafe_fn, r=oli-obk
Stabilize min_const_unsafe_fn in 1.33

Fixes #55607

r? @oli-obk
2018-12-23 23:09:14 +01:00
Mazdak Farrokhzad
e4826775f2
Rollup merge of #57062 - bjorn3:patch-1, r=varkor
Fix a comment
2018-12-23 23:09:13 +01:00
Mazdak Farrokhzad
4ebc7b7e63
Rollup merge of #57053 - nikic:fix-gep-align, r=nagisa
Fix alignment for array indexing

We need to reduce the alignment with the used offset. If the offset isn't known, use the element size, as this will yield the minimum possible alignment.

This handles both direct array indexing, and array repeat expressions.

Fixes #56927.

r? @nagisa
2018-12-23 23:09:12 +01:00
Mazdak Farrokhzad
93bc72f19f
Rollup merge of #57032 - RalfJung:alloc-bench-deprecations, r=Centril
fix deprecation warnings in liballoc benches
2018-12-23 23:09:10 +01:00
Mazdak Farrokhzad
0c1ba07a77
Rollup merge of #57020 - estebank:return-span, r=zackmdavis
Point to cause of `fn` expected return type

Fix #48136.
2018-12-23 23:09:09 +01:00
Mazdak Farrokhzad
eb24b33b66
Rollup merge of #56966 - varkor:raw-pointer-deref-parens, r=zackmdavis
Correct strings for raw pointer deref and array access suggestions

Fixes https://github.com/rust-lang/rust/issues/56714.
Fixes https://github.com/rust-lang/rust/issues/56963.

r? @zackmdavis
2018-12-23 23:09:08 +01:00
Mazdak Farrokhzad
61f50d9d2e
Rollup merge of #56964 - nnethercote:TokenStream-IsJoint, r=petrochenkov
Remove `TokenStream::JointTree`.

This is done by adding a new `IsJoint` field to `TokenStream::Tree`,
which simplifies a lot of `match` statements. And likewise for
`CursorKind`.

The commit also adds a new method `TokenTree:stream()` which can replace
a choice between `.into()` and `.joint()`.
2018-12-23 23:09:07 +01:00
Mazdak Farrokhzad
5157c22eba
Rollup merge of #56953 - oli-obk:dead_const, r=petrochenkov
Mark tuple structs as live if their constructors are used

fixes https://github.com/rust-lang/rust/issues/56281
2018-12-23 23:09:05 +01:00
Mazdak Farrokhzad
93af1e7369
Rollup merge of #56939 - cramertj:pin-stabilization, r=alexcrichton
Pin stabilization

This implements the changes suggested in https://github.com/rust-lang/rust/issues/55766#issue-378417538 and stabilizes the `pin` feature. @alexcrichton also listed several "blockers" in that issue, but then in [this comment](https://github.com/rust-lang/rust/issues/55766#issuecomment-445074980) mentioned that they're more "TODO items":
>  In that vein I think it's fine for a stabilization PR to be posted at any time now with FCP lapsed for a week or so now. The final points about self/pin/pinned can be briefly discussed there (if even necessary, they could be left as the proposal above).

Let's settle these last bits here and get this thing stabilized! :)

r? @alexcrichton
cc @withoutboats
2018-12-23 23:09:04 +01:00
Mazdak Farrokhzad
6ce5ecbc2a
Rollup merge of #56917 - sinkuu:mir_build_logicop, r=davidtwco
Simplify MIR generation for logical operations

Reduces one block and one branch from MIR generated for a logical operator.
2018-12-23 23:09:03 +01:00
Mazdak Farrokhzad
84bc34e70e
Rollup merge of #56916 - oli-obk:static_mut_beta_regression, r=davidtwco
Fix mutable references in `static mut`

fixes #56903
2018-12-23 23:09:02 +01:00
Mazdak Farrokhzad
90a35861dd
Rollup merge of #56342 - killercup:collect-into-option-docs, r=bluss
Improve docs for collecting into `Option`s

Changes the original example to use more idiomatic formatting as well
as `.checked_add`. Also adds a second example to show a case where the
`.collect` returns `None`.
2018-12-23 23:09:00 +01:00
Mazdak Farrokhzad
4c971620e4
Rollup merge of #56188 - zackmdavis:if_i_may_suggest, r=davidtwco
enum type instead of variant suggestion unification

Fixes #56028.

Weirdly, we were deciding between a help note and a structured suggestion based on whether the import candidate span was a dummy—but we weren't using that span in any case! The dummy-ness of the span (which appears to be a matter of this-crate vs. other-crate definition) isn't the right criterion by which we should decide whether it's germane to mention that "there is an enum variant"; instead, let's use the someness of `def` (which is used as the `has_unexpected_resolution` argument to `error_code`).

Since `import_candidate_to_paths` has no other callers, we are free to stop returning the span and rename the function. By using `span_suggestions_`, we leverage the max-suggestions output limit already built in to the emitter, thus resolving #56028.

In the matter of message wording, "you can" is redundant (and perhaps too informal); prefer the imperative.

In a second commit, we do some unprincipled special-casing to correct and beautify suggestions for `Option` and `Result` (where the existing code was being confused by their being reexported in the prelude).

r? @davidtwco
2018-12-23 23:08:59 +01:00
Konrad Borowski
8ac5380ea0
Merge branch 'master' into copied 2018-12-23 16:47:11 +01:00
Pascal Hertleif
2c0f011ca2 Improve docs for collecting into Options
Changes the original example to use more idiomatic formatting as well
as `.checked_add`. Also adds a second example to show a case where the
`.collect` returns `None`.
2018-12-23 15:41:49 +01:00
Matthias Krüger
2036924c83 submodules: update clippy from a416c5e0 to fc24fce7
Fixes clippy tool state

Changes:
````
FIXME > TODO
rustup https://github.com/rust-lang/rust/pull/56992
Document map_clone known problems #498
Remove header link
test: panic at map_unit_fn.rs:202 for map() without args
rm unused file map_unit_fn.stderr
panic at map_unit_fn.rs:202 for map() without args
Change contrib.md hierarchy, link to it from readme
Workaround rust-lang/rust#43081
Teach `suspicious_else_formatting` about `if .. {..} {..}`
Link to `rustc_driver` crate in plugin
mutex_atomic: Correct location of AtomicBool and friends
Update README local run command to specify syspath
Do not mark as_ref as useless if it's followed by a method call
Changes lint sugg to bitwise and operator `&`
Run update_lints after renaming
Rename lint to MODULE_NAME_REPETITIONS
Add renaming tests
Move renaming to the right place
Implements lint for order comparisons against bool
fix(module_name_repeat): Try to register renamed lint, not valid yet
Fix an endless loop in the tests.
Fix `implicit_return` false positives.
chore(moduel_name_repeat): Rename stutter lint to module_name_repeat to avoid ableist language
Make integration tests fail on 'E0463'
base tests: make sure cargo-clippy binary can be called directly
Revert "Merge pull request #3257 from o01eg/remove-sysroot"
````
2018-12-23 13:55:20 +01:00
John Paul Adrian Glaubitz
ecdbcada5d test: Ignore codegen/x86_mmx.rs on s390x 2018-12-23 13:32:03 +01:00
John Paul Adrian Glaubitz
db542b884d test: Ignore ui/target-feature-gate on s390x 2018-12-23 13:29:40 +01:00
John Kåre Alsaker
0c4d551146 Fix recursion limits 2018-12-23 10:46:03 +01:00
Mazdak Farrokhzad
7ae6fb2152 stabilize min_const_unsafe_fn -- revert const-size_of-cycle changes 2018-12-23 10:29:38 +01:00
Mazdak Farrokhzad
bd1d5bc629 stabilize min_const_unsafe_fn --bless tests. 2018-12-23 10:29:38 +01:00
Mazdak Farrokhzad
b42a3acaec stabilize min_const_unsafe_fn in 1.33. 2018-12-23 10:29:38 +01:00
Niv Kaminer
e32c63eedc bless ui tests in compare mode 2018-12-23 09:23:50 +02:00
bors
ddab10a692 Auto merge of #56892 - alexcrichton:new-llvm, r=michaelwoerister
rustc: Update Clang used to build LLVM on Linux

This commit updates from LLVM 7.0.0 to git revisions of clang/llvm/lld
to build LLVM on our dist builders for Linux. The goal of this is to
fix #56849 by picking up a fix [1] in LLD.

Closes #56849

[1]: 3be4e82db7
2018-12-23 06:56:10 +00:00
Esteban Küber
2820dc868a Remove dead code 2018-12-22 19:21:51 -08:00
Zack M. Davis
64ad3e2c42 adjust enum type instead of variant suggestions for prelude enums
The present author regrets not thinking of a more eloquent way to do
this.
2018-12-22 19:04:29 -08:00
Zack M. Davis
3986c96448 enum type instead of variant suggestion unification
Weirdly, we were deciding between a help note and a structured
suggestion based on whether the import candidate span was a dummy—but
we weren't using that span in any case! The dummy-ness of the span
(which appears to be a matter of this-crate vs. other-crate
definition) isn't the right criterion by which we should decide
whether it's germane to mention that "there is an enum variant";
instead, let's use the someness of `def` (which is used as the
`has_unexpected_resolution` argument to `error_code`).

Since `import_candidate_to_paths` has no other callers, we are free to
stop returning the span and rename the function. By using
`span_suggestions_`, we leverage the max-suggestions output limit
already built in to the emitter, thus resolving #56028.

In the matter of message wording, "you can" is redundant (and perhaps
too informal); prefer the imperative.
2018-12-22 17:40:48 -08:00
bors
16329b0ad3 Auto merge of #57063 - kennytm:rollup, r=kennytm
Rollup of 25 pull requests

Successful merges:

 - #56802 (Add DoubleEndedIterator::nth_back)
 - #56909 (static eval: Do not ICE on layout size overflow)
 - #56914 (Ignore ui/target-feature-gate on sparc, sparc64, powerpc, powerpc64 and powerpc64le)
 - #56919 (Remove a wrong multiplier on relocation offset computation)
 - #56933 (Add --progress to git submodule commands in x.py)
 - #56936 (rename div_euc -> div_euclid, and mod_euc -> rem_euclid)
 - #56941 (deny intra-doc link resolution failures in libstd)
 - #56945 (Fix rustdoc-js tests)
 - #56967 (Replace current crate's searchIndex when regenerating)
 - #56970 (Mem uninit doc ptr drop)
 - #56973 (make basic CTFE tracing available on release builds)
 - #56979 (Adding unwinding support for x86_64_fortanix_unknown_sgx target.)
 - #56981 (miri: allocation is infallible)
 - #56984 (A few tweaks to dropck_outlives)
 - #56989 (Fix compiletest `trim` deprecation warnings)
 - #56992 (suggest similar lint names for unknown lints)
 - #57002 (Stabilize Vec(Deque)::resize_with)
 - #57011 (rustdoc: add new CLI flag to load static files from a different location)
 - #57027 (Optimize away a move)
 - #57034 (Inline tweaks)
 - #57039 (Update migrate warning wording.)
 - #57040 (Fix feature gate to point to 1.32.0 for `path_from_str`)
 - #57049 (Stabilize #[repr(packed(N))])
 - #57050 (Fixed typo in HashMap documentation)
 - #57052 (Fix stabilization version numbers (exhaustive_integer_patterns + macro_literal_matcher))
2018-12-22 23:12:23 +00:00
bors
2d3e909e4e Auto merge of #56887 - emilio:enum-field-reordering, r=eddyb
Disable field reordering for repr(int).

This fixes the problem that the test in #56619 uncovers.

Closes #56619.
2018-12-22 20:35:30 +00:00
kennytm
628c6d89e1
Rollup merge of #56945 - JohnHeitmann:rustdoc-js-tester-fix, r=GuillaumeGomez
Fix rustdoc-js tests

Fixes rustdoc-js tests by teaching tester.js how to handle single-line js comments.

Also, added speculative support for template strings, and warnings for future debuggers.
2018-12-23 02:12:30 +08:00
kennytm
26842aeac6
Rollup merge of #57039 - davidtwco:migrate-warning-wording, r=pnkfelix
Update migrate warning wording.

This PR modifies the wording of the warning for backwards-incompatible changes in migrate mode. The warning messages are changed to be lowercase and not include line-breaks in order to be consistent with other compiler diagnostics.
2018-12-23 02:12:28 +08:00
kennytm
5ffd1a63e6
Rollup merge of #57052 - Centril:fix-eip-stable-version, r=varkor
Fix stabilization version numbers (exhaustive_integer_patterns + macro_literal_matcher)

+ `exhaustive_integer_patterns` slipped 1.32; merged in 1.33 -- https://github.com/rust-lang/rust/pull/56362
+ `macro_literal_matcher` isn't stable on current stable (1.31) but is on beta (1.32).

r? @varkor
2018-12-23 02:12:27 +08:00