Commit graph

127107 commits

Author SHA1 Message Date
bors
97eb606e4b Auto merge of #76540 - tmandry:rollup-5ogt8x0, r=tmandry
Rollup of 14 pull requests

Successful merges:

 - #75094 (Add `-Z combine_cgu` flag)
 - #75984 (Improve unresolved use error message)
 - #76141 (Address review comments about config.toml from rustc-dev-guide PR)
 - #76313 (Improved the MIR spanview output)
 - #76430 (Add align to rustc-attrs unstable book)
 - #76465 (Add a script to automatically update Rust/Clang versions in documentation)
 - #76473 (Add missed spaces to GCC-WARNING.txt)
 - #76481 (Convert repetitive target_pointer_width checks to const solution.)
 - #76493 (Remove a stray ignore-tidy-undocumented-unsafe)
 - #76504 (Capitalize safety comments)
 - #76515 (SessionDiagnostic: Fix non-determinism in generated format string.)
 - #76516 (Enable GitHub Releases synchronization)
 - #76522 (remove redundant clones)
 - #76523 (Remove unused PlaceContext::NonUse(NonUseContext::Coverage))

Failed merges:

r? `@ghost`
2020-09-09 22:17:42 +00:00
Tyler Mandry
32714eb6bc
Rollup merge of #76523 - tmiasko:non-use-context-coverage, r=wesleywiser
Remove unused PlaceContext::NonUse(NonUseContext::Coverage)

r? @richkadel / @wesleywiser
2020-09-09 15:06:07 -07:00
Tyler Mandry
09c614948f
Rollup merge of #76522 - matthiaskrgr:redundant_clone, r=jonas-schievink
remove redundant clones

(clippy::redundant_clone)
2020-09-09 15:06:05 -07:00
Tyler Mandry
09a364e984
Rollup merge of #76516 - pietroalbini:github-releases, r=Mark-Simulacrum
Enable GitHub Releases synchronization

This PR enables the triagebot feature to automatically populate [GitHub Releases](https://github.com/rust-lang/rust/releases) for this repository based on the changelog. See https://github.com/rust-lang/triagebot/pull/811 for the implementation of this feature on triagebot's side, and more insights on how it works.

Note: once this lands people subscribed to the ~~firehose~~ rust-lang/rust repository will probably receive a ton of notifications for all the releases being created, but this should be a one-time thing.

r? @Mark-Simulacrum
cc @rust-lang/release
2020-09-09 15:06:04 -07:00
Tyler Mandry
98f59bc2aa
Rollup merge of #76515 - jumbatm:issue76496-reproducibility-regression, r=oli-obk
SessionDiagnostic: Fix non-determinism in generated format string.

Fixes #76496.

r? @oli-obk
2020-09-09 15:06:02 -07:00
Tyler Mandry
c18fa460a4
Rollup merge of #76504 - Flying-Toast:master, r=lcnr
Capitalize safety comments
2020-09-09 15:06:00 -07:00
Tyler Mandry
342b406285
Rollup merge of #76493 - moonheart08:unique-quick, r=jyn514
Remove a stray ignore-tidy-undocumented-unsafe

There were no undocumented unsafe blocks in the file. This shouldn't require any special review.
2020-09-09 15:05:59 -07:00
Tyler Mandry
0d20cf8568
Rollup merge of #76481 - moonheart08:vec_deque_constify, r=sfackler
Convert repetitive target_pointer_width checks to const solution.

Simply a quick code tidying change. Not sure if more needs to be said.
2020-09-09 15:05:56 -07:00
Tyler Mandry
09bfb7ea2b
Rollup merge of #76473 - ortem:fix-gcc-warning, r=jonas-schievink
Add missed spaces to GCC-WARNING.txt
2020-09-09 15:05:54 -07:00
Tyler Mandry
df84ac74bd
Rollup merge of #76465 - jyn514:auto-versioning, r=elichai
Add a script to automatically update Rust/Clang versions in documentation

From https://github.com/rust-lang/rust/pull/76402#issuecomment-687974508.

r? @elichai
2020-09-09 15:05:53 -07:00
Tyler Mandry
d0c2a2d37c
Rollup merge of #76430 - pickfire:patch-7, r=steveklabnik
Add align to rustc-attrs unstable book
2020-09-09 15:05:51 -07:00
Tyler Mandry
bab09684b4
Rollup merge of #76313 - richkadel:mir-spanview-2, r=wesleywiser
Improved the MIR spanview output

* Adds missing "tail" spans (spans that continue beyond the end of
overlapping spans)
* Adds a caret to highlight empty spans associated with MIR elements
that have a position, but otherwise would not be visible.
* Adds visual pointing brackets at the beginning and end of each span

<img width="590" alt="Screen Shot 2020-09-03 at 8 38 08 PM" src="https://user-images.githubusercontent.com/3827298/92202571-25510c00-ee34-11ea-89bc-89eea939476d.png">
<img width="1061" alt="Screen Shot 2020-09-03 at 8 41 04 PM" src="https://user-images.githubusercontent.com/3827298/92202629-49145200-ee34-11ea-8fda-fc6e62c80736.png">
<img width="1113" alt="Screen Shot 2020-09-06 at 5 42 57 PM" src="https://user-images.githubusercontent.com/3827298/92339198-ca085f00-f069-11ea-96d1-c01ced50e2ba.png">
<img width="1692" alt="Screen Shot 2020-09-06 at 5 45 54 PM" src="https://user-images.githubusercontent.com/3827298/92339209-d4c2f400-f069-11ea-94c0-b4d36c200878.png">

r? @tmandry
FYI: @wesleywiser
2020-09-09 15:05:49 -07:00
Tyler Mandry
b4b8a52dcc
Rollup merge of #76141 - jyn514:config.toml, r=Mark-Simulacrum
Address review comments about config.toml from rustc-dev-guide PR

This info was lost in https://github.com/rust-lang/rust/pull/74334. See also https://github.com/rust-lang/rustc-dev-guide/pull/795#pullrequestreview-478197674.
r? @Mark-Simulacrum or @eddyb
2020-09-09 15:05:47 -07:00
Tyler Mandry
5ea55518bc
Rollup merge of #75984 - kornelski:typeormodule, r=matthewjasper
Improve unresolved use error message

"use of undeclared type or module `foo`" doesn't mention that it could be a crate.

This error can happen when users forget to add a dependency to `Cargo.toml`, so I think it's important to mention that it could be a missing crate.

I've used a heuristic based on Rust's naming conventions. It complains about an unknown type if the ident starts with an upper-case letter, and crate or module otherwise. It seems to work very well. The expanded error help covers both an unknown type and a missing crate case.
2020-09-09 15:05:45 -07:00
Tyler Mandry
07dbe49ce9
Rollup merge of #75094 - 0dvictor:cgu, r=oli-obk
Add `-Z combine_cgu` flag

Introduce a compiler option to let rustc combines all regular CGUs into a single one at the end of compilation.

Part of Issue #64191
2020-09-09 15:05:43 -07:00
Stein Somers
2b54ab880c BTreeMap: pull the map's root out of NodeRef 2020-09-10 00:02:54 +02:00
Rich Kadel
f7aee330c7 Also fixed monospace font for d3-graphviz engine
VS code graphviz extensions use d3-graphviz, which supports `Courier`
fontname but does not support `monospace`. This caused graphs to render
poorly because the text sizes were wrong.
2020-09-09 14:49:32 -07:00
Camelid
884a1b4b9b Fix anchor links
#safety -> self#safety
2020-09-09 13:42:57 -07:00
Vadim Petrochenkov
10d3f8a484 Move rustllvm into rustc_llvm 2020-09-09 23:05:43 +03:00
bors
e2be5f568d Auto merge of #74595 - lcnr:ConstEvaluatable-fut-compat, r=oli-obk
make `ConstEvaluatable` more strict

relevant zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/.60ConstEvaluatable.60.20generic.20functions/near/204125452

Let's see how much this impacts. Depending on how this goes this should probably be a future compat warning.

Short explanation: we currently forbid anonymous constants which depend on generic types, e.g. `[0; std::mem::size_of::<T>]` currently errors.

We previously checked this by evaluating the constant and returned an error if that failed. This however allows things like
```rust
const fn foo<T>() -> usize {
    if std::mem::size_of::<*mut T>() < 8 { // size of *mut T does not depend on T
        std::mem::size_of::<T>()
    } else {
        8
    }
}

fn test<T>() {
    let _ = [0; foo::<T>()];
}
```
which is a backwards compatibility hazard. This also has worrying interactions with mir optimizations (https://github.com/rust-lang/rust/pull/74491#issuecomment-661890421) and intrinsics (#74538).

r? `@oli-obk` `@eddyb`
2020-09-09 20:04:04 +00:00
carbotaniuman
bb57c9f91c Format 2020-09-09 13:44:22 -05:00
carbotaniuman
8f43fa0989 Add WeakInner<'_> and have Weak::inner() return it
This avoids overlapping a reference covering the data field,
which may be changed due in concurrent conditions. This fully
fixed the UB mainfested with `new_cyclic`.
2020-09-09 13:39:48 -05:00
Bastian Kauschke
74e07198a0 fix test on 32 bit systems 2020-09-09 20:10:23 +02:00
bors
d92155bf6a Auto merge of #73971 - ssomers:slice_slasher, r=Mark-Simulacrum
BTreeMap mutable iterators should not take any reference to visited nodes during iteration

Fixes #73915, overlapping mutable references during BTreeMap iteration

r? `@RalfJung`
2020-09-09 17:40:46 +00:00
carbotaniuman
493c037699 Eliminate mut reference UB in Drop impl for Rc<T>
This changes `self.ptr.as_mut()` with `get_mut_unchecked` which
does not use an intermediate reference.  Arc<T> already handled this
case properly.
2020-09-09 12:14:18 -05:00
Mara Bos
43c7a9b72b Fix broken doc links in MaybeUninit. 2020-09-09 18:56:16 +02:00
Mara Bos
a94b2cb034 Add safety docs about T's invariants in MaybeUninit::assume_init_drop. 2020-09-09 18:55:36 +02:00
Matthias Krüger
de195f2d3d print the unit type () in related lint messages. 2020-09-09 17:59:13 +02:00
Tomasz Miąsko
0016405073 Remove unused PlaceContext::NonUse(NonUseContext::Coverage) 2020-09-09 17:02:19 +02:00
Matthias Krüger
4db10297c1 link to the Box docs in related lint documentation. 2020-09-09 16:54:24 +02:00
Matthias Krüger
be28b6235e remove redundant clones
(clippy::redundant_clone)
2020-09-09 16:32:55 +02:00
bors
b4bdc07ff5 Auto merge of #76445 - jyn514:doctests, r=Mark-Simulacrum,ollie27
Make rustdoc output deterministic for UI tests

Closes https://github.com/rust-lang/rust/issues/76442 (hopefully, since it's non-deterministic I don't have a way to test).

r? `@Mark-Simulacrum`
cc `@GuillaumeGomez`
2020-09-09 13:33:01 +00:00
Stein Somers
8158d5623e BTreeMap: avoid aliasing by avoiding slices 2020-09-09 08:58:02 -04:00
Ralf Jung
7889373730 make as_leaf return a raw pointer, to reduce aliasing assumptions 2020-09-09 08:38:34 -04:00
Hameer Abbasi
5d7e7c25e4 Add revisions to const generic issue UI tests. 2020-09-09 13:28:41 +02:00
bors
683d1bcd40 Auto merge of #76513 - rust-lang:rust-analyzer-2020-09-09, r=jonas-schievink
⬆️ rust-analyzer

r? `@ghost`
2020-09-09 11:28:17 +00:00
jumbatm
8b392505ae Fix non-determinism in generated format string. 2020-09-09 21:23:25 +10:00
Jonas Schievink
e215e7901e ⬆️ rust-analyzer 2020-09-09 12:41:32 +02:00
Mara Bos
a14efd1d0a Rename MaybeUninit::read to assume_init_read. 2020-09-09 11:27:42 +02:00
Mara Bos
656a17b44d Rename MaybeUninit::drop to assume_init_drop. 2020-09-09 11:27:09 +02:00
bors
3f5e617e36 Auto merge of #76406 - GuillaumeGomez:create-e0774, r=pickfire,jyn514
Create E0774
2020-09-09 08:23:33 +00:00
Victor Ding
c81b43d8ac Add -Z combine_cgu flag
Introduce a compiler option to let rustc combines all regular CGUs into
a single one at the end of compilation.

Part of Issue #64191
2020-09-09 17:32:23 +10:00
bors
0855263dcd Auto merge of #76463 - camelid:improve-E0607-explanation, r=jyn514
Improve wording of E0607 explanation

`@rustbot` modify labels: A-diagnostics C-enhancement
2020-09-09 06:33:03 +00:00
bors
780ca140a0 Auto merge of #76453 - camelid:fix-css-crate-list, r=GuillaumeGomez,ollie27
rustdoc: Fix font CSS for crate lists

I had put it in the wrong file in #76126. This should fix it now. Thank
you to `@ollie27` for pointing this out!

---

`@rustbot` modify labels: T-rustdoc C-bug
2020-09-09 04:35:40 +00:00
bors
78f4cbb1ef Auto merge of #76418 - jyn514:readme, r=Dylan-DPC
Move sections about contributing closer together in the README

This makes it easier to find what to do if you're interested in contributing.
2020-09-09 02:40:27 +00:00
Flying-Toast
2799aec6ab Capitalize safety comments 2020-09-08 22:37:18 -04:00
Flying-Toast
c66789d572 Capitalize safety comments 2020-09-08 22:26:44 -04:00
Camelid
d24026bb6d Fix broken link
`write` is ambiguous because there's also a macro called `write`.

Also removed unnecessary and potentially confusing link to a function in
its own docs.
2020-09-08 19:24:57 -07:00
Matt Brubeck
fb1fab5a67 Tests for HashMap/HashSet::drain_filter 2020-09-08 17:24:28 -07:00
Matt Brubeck
49aef963d3 Add HashMap::drain_filter and HashSet::drain_filter
Implements #59618.
2020-09-08 17:24:28 -07:00