Commit Graph

126688 Commits

Author SHA1 Message Date
bors b40abfd485 Auto merge of #76326 - mati865:use_lld-no-linker, r=Mark-Simulacrum
Fix rust.use-lld when linker is not set

Fixes https://github.com/rust-lang/rust/pull/76127#issuecomment-685419195

Previously when `[<target>].linker` was not configured `rust.use-lld` would set it to `rust-lld` on platforms where it should not.
2020-09-06 04:00:56 +00:00
bors 94b8eb80ab Auto merge of #76307 - sunfishcode:wasm-no-eh-frame-header, r=alexcrichton
Disable use of `--eh-frame-hdr` on wasm32.

Set wasm32's `TargetOptions::eh_frame_header` to false so that we don't pass `--eh-frame-hdr` to `wasm-ld`, which doesn't support that flag.

r? @alexcrichton
2020-09-06 01:58:35 +00:00
bors d39b076489 Auto merge of #76385 - calebcartwright:update-rls-rustfmt, r=Xanewok
Update RLS and Rustfmt

Fixes #76145 and fixes #76146

cc @Xanewok @topecongiro
2020-09-05 23:29:05 +00:00
bors cdc8f0606d Auto merge of #76217 - RalfJung:maybe-uninit-slice, r=KodrAus
rename MaybeUninit slice methods

The `first` methods conceptually point to the whole slice, not just its first element, so rename them to be consistent with the raw ptr methods on ref-slices.

Also, do the equivalent of https://github.com/rust-lang/rust/pull/76047 for the slice reference getters, and make them part of https://github.com/rust-lang/rust/issues/63569 (so far they somehow had no tracking issue).

* first_ptr -> slice_as_ptr
* first_ptr_mut -> slice_as_mut_ptr
* slice_get_ref -> slice_assume_init_ref
* slice_get_mut -> slice_assume_init_mut
2020-09-05 21:02:18 +00:00
Caleb Cartwright 1ceb82488f Update RLS and Rustfmt 2020-09-05 15:40:07 -05:00
bors de921ab3c3 Auto merge of #75428 - the8472:fix-copy-eopnotsupp, r=joshtriplett
Workarounds for copy_file_range issues

fixes #75387
fixes #75446
2020-09-05 19:09:22 +00:00
bors 04f44fb923 Auto merge of #75872 - mati865:pgo-tests, r=petrochenkov
Enable some of profiler tests on Windows-gnu

CC https://github.com/rust-lang/rust/issues/61266

Because of force-push GitHub didn't let me reopen https://github.com/rust-lang/rust/pull/75184

Because of the GCC miscompilation, generated binaries either segfault or `.profraw` is malformed. Clang works fine but we can't use it on the CI.
However we can still test the IR for the proper instrumentation so let's do it.
2020-09-05 17:18:26 +00:00
Ralf Jung 35068326b5 document remaining unsafety in maybe_uninit.rs 2020-09-05 17:24:22 +02:00
Ralf Jung cff5f56886 rename MaybeUninit slice methods
first_ptr -> slice_as_ptr
first_ptr_mut -> slice_as_mut_ptr
slice_get_ref -> slice_assume_init_ref
slice_get_mut -> slice_assume_init_mut
2020-09-05 17:24:22 +02:00
bors 7d289aeade Auto merge of #76376 - Dylan-DPC:rollup-8chsbw9, r=Dylan-DPC
Rollup of 11 pull requests

Successful merges:

 - #75695 (Add a regression test for issue-72793)
 - #75741 (Refactor byteorder to std in rustc_middle)
 - #75954 (Unstable Book: add links to tracking issues for FFI features)
 - #75994 (`impl Rc::new_cyclic`)
 - #76060 (Link vec doc to & reference)
 - #76078 (Remove disambiguators from intra doc link text)
 - #76082 (Fix intra-doc links on pub re-exports)
 - #76254 (Fold length constant in Rvalue::Repeat)
 - #76258 (x.py check checks tests/examples/benches)
 - #76263 (inliner: Check for codegen fn attributes compatibility)
 - #76285 (Move jointness censoring to proc_macro)

Failed merges:

r? @ghost
2020-09-05 14:59:32 +00:00
Dylan DPC 85cee57fd7
Rollup merge of #76285 - matklad:censor-spacing, r=petrochenkov
Move jointness censoring to proc_macro

Proc-macro API currently exposes jointness in `Punct` tokens. That is,
`+` in `+one` is **non** joint.

Our lexer produces jointness info for all tokens, so we need to censor
it *somewhere*

Previously we did this in a lexer, but it makes more sense to do this
in a proc-macro server.

r? @petrochenkov
2020-09-05 16:28:36 +02:00
Dylan DPC b4d3873024
Rollup merge of #76263 - tmiasko:inline-codegen-fn-attrs, r=ecstatic-morse
inliner: Check for codegen fn attributes compatibility

* Check for target features compatibility
* Check for no_sanitize attribute compatibility

Fixes #76259.
2020-09-05 16:28:34 +02:00
Dylan DPC 45bdee8fde
Rollup merge of #76258 - Mark-Simulacrum:check-tests, r=ehuss
x.py check checks tests/examples/benches

This also adds a check for bootstrap to x.py.

r? @ehuss
2020-09-05 16:28:32 +02:00
Dylan DPC 79b8f59185
Rollup merge of #76254 - tmiasko:fold-len, r=wesleywiser
Fold length constant in Rvalue::Repeat

Fixes #76248.
2020-09-05 16:28:30 +02:00
Dylan DPC f1eb5f800f
Rollup merge of #76082 - jyn514:top-level-links, r=ollie27,GuillaumeGomez
Fix intra-doc links on pub re-exports

Partial fix for https://github.com/rust-lang/rust/issues/76073 - This removes the incorrect error, but doesn't show the documentation anywhere.
r? @GuillaumeGomez
2020-09-05 16:28:28 +02:00
Dylan DPC ed39e6d60a
Rollup merge of #76078 - jyn514:no-disambiguator, r=manishearth
Remove disambiguators from intra doc link text

Closes https://github.com/rust-lang/rust/issues/65354.
r? @Manishearth

The commits are mostly atomic, but there might be some mix between them here and there. I recommend reading 'refactor ItemLink' and 'refactor RenderedLink' on their own though, lots of churn without any logic changes.
2020-09-05 16:28:26 +02:00
Dylan DPC 86cf7976e2
Rollup merge of #76060 - pickfire:patch-12, r=jyn514
Link vec doc to & reference

It is not always obvious that people could see the docs for `&`
especially for beginners, it also helps learnability.
2020-09-05 16:28:24 +02:00
Dylan DPC 4bd3f266b0
Rollup merge of #75994 - mental32:impl-rc-new-cyclic, r=KodrAus
`impl Rc::new_cyclic`

References #75861

r? @Dylan-DPC
2020-09-05 16:28:22 +02:00
Dylan DPC c3a09fba84
Rollup merge of #75954 - ArekPiekarz:unstable_book_ffi_tracking_issues, r=steveklabnik
Unstable Book: add links to tracking issues for FFI features
2020-09-05 16:28:20 +02:00
Dylan DPC e160d2b3e0
Rollup merge of #75741 - workingjubilee:refactor-byteorder, r=matthewjasper
Refactor byteorder to std in rustc_middle

Use std::io::{Read, Write} and {to, from}_{le, be}_bytes methods in
order to remove byteorder from librustc_middle's dependency graph.
2020-09-05 16:28:17 +02:00
Dylan DPC cb33a15c3e
Rollup merge of #75695 - JohnTitor:regression-test, r=Dylan-DPC
Add a regression test for issue-72793

Adds a regression test for #72793, which is fixed by #75443. Note that this won't close the issue as the snippet still shows ICE with `-Zmir-opt-level=2`. But it makes sense to add a test anyway.
2020-09-05 16:28:16 +02:00
bors 81a769f261 Auto merge of #75584 - RalfJung:union-no-deref, r=matthewjasper
do not apply DerefMut on union field

This implements the part of [RFC 2514](https://github.com/rust-lang/rfcs/blob/master/text/2514-union-initialization-and-drop.md) about `DerefMut`. Unlike described in the RFC, we only apply this warning specifically when doing `DerefMut` of a `ManuallyDrop` field; that is really the case we are worried about here.

@matthewjasper suggested I patch `convert_place_derefs_to_mutable` and `convert_place_op_to_mutable` for this, but I could not find anything to do in `convert_place_op_to_mutable` and this is sufficient to make the test pass. However, maybe there are some other cases this misses? I have no familiarity with this code.

This is a breaking change *in theory*, if someone used `ManuallyDrop<T>` in a union field and relied on automatic `DerefMut`. But on stable this means `T: Copy`, so the `ManuallyDrop` is rather pointless.

Cc https://github.com/rust-lang/rust/issues/55149
2020-09-05 11:47:01 +00:00
Mateusz Mikuła 5a51293f4b Update llvm submodule 2020-09-05 12:31:16 +02:00
Mateusz Mikuła ad69e66517 Ignore failing PGO/coverage tests on MinGW 2020-09-05 12:31:16 +02:00
bors 02fe30971e Auto merge of #75888 - GuillaumeGomez:trait-impl-assoc-const-doc-alias, r=ollie27
Add check for doc alias on assoc const in trait impl

Fixes #73721.

r? @ollie27
2020-09-05 09:35:17 +00:00
Jubilee Young 2df552b406 Fix big endian read/write
Co-authored-by: matthewjasper <mjjasper1@gmail.com>
2020-09-04 21:51:29 -07:00
Jubilee Young dc00efff9f Explain contract of {read, write}_target_uint 2020-09-04 21:51:28 -07:00
Jubilee fe2a867125 Be explicit that we're handling bytes
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-09-04 21:51:28 -07:00
Jubilee Young 74b4eea64d Remove reference to byteorder limits 2020-09-04 21:51:28 -07:00
Jubilee Young b97d4131fe Refactor byteorder to std in rustc_middle
Use std::io::{Read, Write} and {to, from}_{le, be}_bytes methods in
order to remove byteorder from librustc_middle's dependency graph.
2020-09-04 21:51:17 -07:00
bors c3364780d2 Auto merge of #75173 - jackh726:chalk-0.21, r=nikomatsakis
Upgrade Chalk to 0.21

Two commits here. First commit actually does the upgrade. Second commit has some changes to make more tests in compare-mode=chalk pass.

The `PlaceholdersCollector` and `RegionsSubstitutor` bits are bit a hacky, but only insomuch as `ParamsSubstitutor` is. These won't be needed eventually.

r? @nikomatsakis
2020-09-05 02:24:05 +00:00
Jack Huey 0aa215305a kind -> kind() 2020-09-04 19:17:57 -04:00
bors 70c5f6efc4 Auto merge of #75200 - ssomers:btree_valmut, r=Mark-Simulacrum
BTreeMap: introduce marker::ValMut and reserve Mut for unique access

The mutable BTreeMap iterators (apart from `DrainFilter`) are double-ended, meaning they have to rely on a front and a back handle that each represent a reference into the tree. Reserve a type category `marker::ValMut` for them, so that we guarantee that they cannot reach operations on handles with borrow type `marker::Mut`and that these operations can assume unique access to the tree.

Including #75195, benchmarks report no genuine change:
```
benchcmp old new --threshold 5
 name                                 old ns/iter  new ns/iter  diff ns/iter   diff %  speedup
 btree::map::iter_100                 3,333        3,023                -310   -9.30%   x 1.10
 btree::map::range_unbounded_vs_iter  36,624       31,569             -5,055  -13.80%   x 1.16
```

r? @Mark-Simulacrum
2020-09-04 23:16:23 +00:00
Jack Huey 3a9a4e8b2d Bless changed test output 2020-09-04 19:12:54 -04:00
Jack Huey f690569465 Review comments 2020-09-04 19:12:54 -04:00
Jack Huey 76c728901e More chalk work 2020-09-04 19:12:54 -04:00
Jack Huey d66452c3e5 Upgrade chalk to 0.21 2020-09-04 19:12:54 -04:00
bors c59199efca Auto merge of #76292 - Aaron1011:fix/proc-macro-panic-hide, r=petrochenkov
Respect `-Z proc-macro-backtrace` flag for panics inside libproc_macro

Fixes #76270

Previously, any panic occuring during a call to a libproc_macro method
(e.g. calling `Ident::new` with an invalid identifier) would always
cause an ICE message to be printed.
2020-09-04 20:58:37 +00:00
bors 42d896afbd Auto merge of #76315 - lcnr:map-track-caller, r=Mark-Simulacrum
add `#[track_caller]` to `local_def_id_to_hir_id`

Improves one of the more frequent ICE
2020-09-04 19:05:20 +00:00
bors d2454643e1 Auto merge of #75077 - LeSeulArtichaut:tys-kind, r=nikomatsakis
Refractor ty.kind -> ty.kind() and ty.flags -> ty.flags()

First step for the ["shared library to represent Rust types"](https://rust-lang.github.io/compiler-team/minutes/design-meeting/2020-03-12-shared-library-for-types/) work (rust-lang/wg-traits#16).

This PR makes the `TyS::kind` field private and adds a `kind()` method to access it.
As noted [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/144729-wg-traits/topic/Looking.20to.20contribute/near/205185412), this refractoring might require a MCP. I am perfectly fine with having to wait until MCP is accepted and resolving the conflicts that pop up afterwards.

r? @nikomatsakis
2020-09-04 17:07:39 +00:00
LeSeulArtichaut 4d28a82c59 ty.flags -> ty.flags() 2020-09-04 18:28:20 +02:00
LeSeulArtichaut 085e417087 `ty.kind` -> `ty.kind()` in rustdoc and clippy 2020-09-04 18:27:33 +02:00
LeSeulArtichaut 3e14b684dd Change ty.kind to a method 2020-09-04 17:47:51 +02:00
bors 80cacd7795 Auto merge of #75655 - nielx:fix/haiku-llvm-libz, r=Mark-Simulacrum
Disable zlib in LLVM on Haiku

PR #72696 enabled the option LLVM_ENABLE_ZLIB for the LLVM builds. Like NetBSD and aarch64-apple-darwin (see PR #75500), the LLVM build system not explicitly linking to libz on these platforms cause issues. For Haiku, this meant the runtime loader complaining about undefined symbols..
2020-09-04 14:32:33 +00:00
Mateusz Mikuła a2fbf39cc8 Fix rust.use-lld when linker is not set 2020-09-04 15:31:53 +02:00
Mateusz Mikuła 1ea121c74f Fix warning whe building profiler_builtins crate 2020-09-04 15:10:29 +02:00
Mateusz Mikuła ed3950ba5a Enable profiler tests on Windows-gnu 2020-09-04 15:10:16 +02:00
Joshua Nelson 18c14fde0d Misc cleanup
- Preserve suffixes when displaying
- Rename test file to match `intra-link*`
- Remove unnecessary .clone()s
- Improve comments and naming
- Fix more bugs and add tests
- Escape intra-doc link example in public documentation
2020-09-04 08:27:56 -04:00
bors ef55a0a92f Auto merge of #75207 - dylni:add-slice-check-range, r=KodrAus
Add `slice::check_range`

This method is useful for [`RangeBounds`] parameters. It's even been [rewritten](22ee68dc58/src/librustc_data_structures/sorted_map.rs (L214)) [many](22ee68dc58/library/alloc/src/vec.rs (L1299)) [times](22ee68dc58/library/core/src/slice/mod.rs (L2441)) in the standard library, sometimes assuming that the bounds won't be [`usize::MAX`].

For example, [`Vec::drain`] creates an empty iterator when [`usize::MAX`] is used as an inclusive end bound:

```rust
assert!(vec![1].drain(..=usize::max_value()).eq(iter::empty()));
```

If this PR is merged, I'll create another to use it for those methods.

[`RangeBounds`]: https://doc.rust-lang.org/std/ops/trait.RangeBounds.html
[`usize::MAX`]: https://doc.rust-lang.org/std/primitive.usize.html#associatedconstant.MAX
[`Vec::drain`]: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.drain
2020-09-04 12:21:43 +00:00
Bastian Kauschke cdd5d60b47 add track_caller to `local_def_id_to_hir_id` 2020-09-04 09:24:44 +02:00