]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAssert there is no duplicate node.
Camille GILLOT [Sun, 14 Mar 2021 20:29:34 +0000 (21:29 +0100)]
Assert there is no duplicate node.

3 years agoRemove dead code.
Camille GILLOT [Sun, 14 Mar 2021 20:28:39 +0000 (21:28 +0100)]
Remove dead code.

3 years agoDo not insert impl_trait_in_bindings opaque definitions twice.
Camille GILLOT [Sun, 14 Mar 2021 19:02:35 +0000 (20:02 +0100)]
Do not insert impl_trait_in_bindings opaque definitions twice.

3 years agoAuto merge of #82878 - sexxi-goose:repr_packed, r=nikomatsakis
bors [Sat, 13 Mar 2021 09:47:07 +0000 (09:47 +0000)]
Auto merge of #82878 - sexxi-goose:repr_packed, r=nikomatsakis

2229: Handle capturing a reference into a repr packed struct

RFC 1240 states that it is unsafe to capture references into a
packed-struct. This PR ensures that when a closure captures a precise
path, we aren't violating this safety constraint.

To acheive so we restrict the capture precision to the struct itself.

An interesting edge case where we decided to restrict precision:
```rust
struct Foo(String);

let foo: Foo;
let c = || {
    println!("{}", foo.0);
    let x = foo.0;
}
```

Given how closures get desugared today, foo.0 will be moved into the
closure, making the `println!`, safe. However this can be very subtle
and also will be unsafe if the closure gets inline.

Closes: https://github.com/rust-lang/project-rfc-2229/issues/33
r? `@nikomatsakis`

3 years agoAuto merge of #82760 - WaffleLapkin:unleak_extend_from_within, r=kennytm
bors [Sat, 13 Mar 2021 07:06:01 +0000 (07:06 +0000)]
Auto merge of #82760 - WaffleLapkin:unleak_extend_from_within, r=kennytm

Fix leak in Vec::extend_from_within

Fixes #82533

3 years agoAuto merge of #82436 - osa1:issue80258, r=nikomatsakis
bors [Sat, 13 Mar 2021 04:38:39 +0000 (04:38 +0000)]
Auto merge of #82436 - osa1:issue80258, r=nikomatsakis

Allow calling *const methods on *mut values

This allows `*const` methods to be called on `*mut` values.

TODOs:

- [x] ~~Remove debug logs~~ Done.
- [x] ~~I haven't tested, but I think this currently won't work when the `self` value has type like `&&&&& *mut X` because I don't do any autoderefs when probing. To fix this the new code in `rustc_typeck::check::method::probe` needs to reuse `pick_method` somehow as I think that's the function that autoderefs.~~ This works, because autoderefs are done before calling `pick_core`, in `method_autoderef_steps`, called by `probe_op`.
- [x] ~~I should probably move the new `Pick` to `pick_autorefd_method`. If not, I should move it to its own function.~~ Done.
- [ ] ~~Test this with a `Pick` with `to_ptr = true` and `unsize = true`.~~ I think this case cannot happen, because we don't have any array methods with `*mut [X]` receiver. I should confirm that this is true and document this. I've placed two assertions about this.
- [x] ~~Maybe give `(Mutability, bool)` a name and fields~~ I now have a `to_const_ptr` field in `Pick`.
- [x] ~~Changes in `adjust_self_ty` is quite hacky. The problem is we can't deref a pointer, and even if we don't have an adjustment to get the address of a value, so to go from `*mut` to `*const` we need a special case.~~ There's still a special case for `to_const_ptr`, but I'm not sure if we can avoid this.
- [ ] Figure out how `reached_raw_pointer` stuff is used. I suspect only for error messages.

Fixes #80258

3 years agoAuto merge of #83067 - JohnTitor:rollup-0wo338i, r=JohnTitor
bors [Sat, 13 Mar 2021 02:08:33 +0000 (02:08 +0000)]
Auto merge of #83067 - JohnTitor:rollup-0wo338i, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #82984 (Simplify ast block lowering)
 - #83012 (Update Clippy)
 - #83020 (Emit the enum range assumption if the range only contains one element)
 - #83037 (Support merge_functions option in NewPM since LLVM >= 12)
 - #83052 (updated vulnerable deps)
 - #83059 (Allow configuring `rustdoc --disable-minification` in config.toml)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #83059 - notriddle:config-toml-disable-minification, r=Mark-Simulacrum
Yuki Okushi [Sat, 13 Mar 2021 00:44:47 +0000 (09:44 +0900)]
Rollup merge of #83059 - notriddle:config-toml-disable-minification, r=Mark-Simulacrum

Allow configuring `rustdoc --disable-minification` in config.toml

This way, you can debug rustdoc's JavaScript and CSS file with normal F12 Dev Tools and you'll have useful line numbers to work with.

3 years agoRollup merge of #83052 - klensy:dep-update, r=Mark-Simulacrum
Yuki Okushi [Sat, 13 Mar 2021 00:44:46 +0000 (09:44 +0900)]
Rollup merge of #83052 - klensy:dep-update, r=Mark-Simulacrum

updated vulnerable deps

* Updated signal-hook-registry 1.2.1 to 1.2.2, as it drops dependency on vulnerable arc-swap 0.4.7 https://rustsec.org/advisories/RUSTSEC-2020-0091
* Updated generic-array 0.12.3 to 0.12.4, vuln https://rustsec.org/advisories/RUSTSEC-2020-0146
* Updated sized-chunks 0.6.2 to 0.6.4, vuln https://rustsec.org/advisories/RUSTSEC-2020-0041 fixed in 0.6.3, in 0.6.4 fixed some UB https://github.com/bodil/sized-chunks/blob/master/CHANGELOG.md#064---2021-02-17

3 years agoRollup merge of #83037 - kubo39:merge-functions-in-llvm-new-pass-manager, r=nikic
Yuki Okushi [Sat, 13 Mar 2021 00:44:45 +0000 (09:44 +0900)]
Rollup merge of #83037 - kubo39:merge-functions-in-llvm-new-pass-manager, r=nikic

Support merge_functions option in NewPM since LLVM >= 12

now we can pass this flag since https://reviews.llvm.org/D93002 has been merged.

3 years agoRollup merge of #83020 - hi-rustin:rustin-patch-enum, r=lcnr
Yuki Okushi [Sat, 13 Mar 2021 00:44:44 +0000 (09:44 +0900)]
Rollup merge of #83020 - hi-rustin:rustin-patch-enum, r=lcnr

Emit the enum range assumption if the range only contains one element

close https://github.com/rust-lang/rust/issues/82871

3 years agoRollup merge of #83012 - flip1995:clippyup, r=Manishearth
Yuki Okushi [Sat, 13 Mar 2021 00:44:43 +0000 (09:44 +0900)]
Rollup merge of #83012 - flip1995:clippyup, r=Manishearth

Update Clippy

Bi-weekly Clippy sync.

r? ``@Manishearth``

3 years agoRollup merge of #82984 - camsteffen:lower-block, r=cjgillot
Yuki Okushi [Sat, 13 Mar 2021 00:44:42 +0000 (09:44 +0900)]
Rollup merge of #82984 - camsteffen:lower-block, r=cjgillot

Simplify ast block lowering

3 years agoAuto merge of #83022 - m-ou-se:mem-replace-no-swap, r=nagisa
bors [Fri, 12 Mar 2021 23:27:23 +0000 (23:27 +0000)]
Auto merge of #83022 - m-ou-se:mem-replace-no-swap, r=nagisa

Don't implement mem::replace with mem::swap.

`swap` is a complicated operation, so this changes the implementation of `replace` to use `read` and `write` instead.

See https://github.com/rust-lang/rust/pull/83019.

I wrote there:

> Implementing the simpler operation (replace) with the much more complicated operation (swap) doesn't make a whole lot of sense. `replace` is just read+write, and the primitive for moving out of a `&mut`. `swap` is for doing that to *two* `&mut` at the same time, which is both more niche and more complicated (as shown by `swap_nonoverlapping_bytes`).

This could be especially interesting for `Option<VeryLargeStruct>::take()`, since swapping such a large structure with `swap_nonoverlapping_bytes` is going to be much less efficient than `ptr::write()`'ing a `None`.

But also for small values where `swap` just reads/writes using temporary variable, this makes a `replace` or `take` operation simpler:
![image](https://user-images.githubusercontent.com/783247/110839393-c7e6bd80-82a3-11eb-97b7-28acb14deffd.png)

3 years agoMake docs-minification default to true
Michael Howell [Fri, 12 Mar 2021 22:03:54 +0000 (15:03 -0700)]
Make docs-minification default to true

3 years agoAdd a `disable-minification` option for rustdoc
Michael Howell [Fri, 12 Mar 2021 18:41:46 +0000 (11:41 -0700)]
Add a `disable-minification` option for rustdoc

This way, you can debug rustdoc's JavaScript and CSS file
with normal F12 Dev Tools and you'll have useful line numbers
to work with.

3 years agoAuto merge of #83024 - Xanewok:update-rls, r=Dylan-DPC
bors [Fri, 12 Mar 2021 16:57:11 +0000 (16:57 +0000)]
Auto merge of #83024 - Xanewok:update-rls, r=Dylan-DPC

Update RLS

Fixes #82932

r? `@ghost`

3 years agoClippy: HACK! Fix bootstrap error
flip1995 [Fri, 12 Mar 2021 14:32:04 +0000 (15:32 +0100)]
Clippy: HACK! Fix bootstrap error

This will be removed in the next sync, once beta is at 1.52. Until then
this hack avoids to put `cfg(bootstrap)` into Clippy.

3 years agoUpdate Cargo.lock
flip1995 [Fri, 12 Mar 2021 14:31:11 +0000 (15:31 +0100)]
Update Cargo.lock

3 years agoMerge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyup
flip1995 [Fri, 12 Mar 2021 14:30:50 +0000 (15:30 +0100)]
Merge commit '6ed6f1e6a1a8f414ba7e6d9b8222e7e5a1686e42' into clippyup

3 years agoAuto merge of #83030 - nikic:update-llvm, r=nagisa
bors [Fri, 12 Mar 2021 14:16:01 +0000 (14:16 +0000)]
Auto merge of #83030 - nikic:update-llvm, r=nagisa

Update llvm-project submodule

Fixes #82833. Fixes #82859. Probably also `fixes` #83025. This also merges in the current upstream 12.x branch.

r? `@nagisa`

3 years agoupdated vulnerable deps
klensy [Fri, 12 Mar 2021 13:33:02 +0000 (16:33 +0300)]
updated vulnerable deps

3 years agoAuto merge of #82422 - petrochenkov:allunst, r=oli-obk
bors [Fri, 12 Mar 2021 11:46:50 +0000 (11:46 +0000)]
Auto merge of #82422 - petrochenkov:allunst, r=oli-obk

expand: Do not allocate `Lrc` for `allow_internal_unstable` list unless necessary

This allocation is done for any macro defined in the current crate, or used from a different crate.
EDIT: This also removes an `Lrc` increment from each *use* of such macro, which may be more significant.
Noticed when reviewing https://github.com/rust-lang/rust/pull/82367.
This probably doesn't matter, but let's do a perf run.

3 years agoAuto merge of #82935 - henryboisdequin:diagnostic-cleanups, r=estebank
bors [Fri, 12 Mar 2021 09:05:38 +0000 (09:05 +0000)]
Auto merge of #82935 - henryboisdequin:diagnostic-cleanups, r=estebank

Diagnostic cleanups

Follow up to #81503
Helps with #82916 (don't show note if `span` is `DUMMY_SP`)

3 years agoEmit the enum range assumption if the range only contains one element
hi-rustin [Thu, 11 Mar 2021 15:30:39 +0000 (23:30 +0800)]
Emit the enum range assumption if the range only contains one element

test: add test case

make tidy happy

3 years agoDon't show note if `span` is `DUMMY_SP`
Henry Boisdequin [Tue, 9 Mar 2021 14:42:47 +0000 (20:12 +0530)]
Don't show note if `span` is `DUMMY_SP`

3 years agoAuto merge of #83042 - JohnTitor:rollup-s8efv94, r=JohnTitor
bors [Fri, 12 Mar 2021 00:23:05 +0000 (00:23 +0000)]
Auto merge of #83042 - JohnTitor:rollup-s8efv94, r=JohnTitor

Rollup of 11 pull requests

Successful merges:

 - #80385 (Clarify what `Cell::replace` returns)
 - #82571 (Rustdoc Json: Add tests for Reexports, and improve jsondocck)
 - #82860 (Add `-Z unpretty` flag for the THIR)
 - #82950 (convert slice doc link to intra-doc links)
 - #82965 (Add spirv extension handling in compiletest)
 - #82966 (update MSYS2 link in README)
 - #82979 (Fix "run" button position in error index)
 - #83001 (Ignore Vim swap files)
 - #83003 (rustdoc: tweak the search index format)
 - #83013 (Adjust some `#[cfg]`s to take non-Unix non-Windows operating systems into account)
 - #83018 (Reintroduce accidentally deleted assertions.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #83018 - oli-obk:float_check, r=davidtwco
Yuki Okushi [Thu, 11 Mar 2021 23:55:22 +0000 (08:55 +0900)]
Rollup merge of #83018 - oli-obk:float_check, r=davidtwco

Reintroduce accidentally deleted assertions.

These were removed in https://github.com/rust-lang/rust/pull/50198

3 years agoRollup merge of #83013 - hyd-dev:cfg-unix-windows, r=bjorn3
Yuki Okushi [Thu, 11 Mar 2021 23:55:21 +0000 (08:55 +0900)]
Rollup merge of #83013 - hyd-dev:cfg-unix-windows, r=bjorn3

Adjust some `#[cfg]`s to take non-Unix non-Windows operating systems into account

This makes compilation to such targets (e.g. `wasm32-wasi`) easier.

cc rust-lang/miri#722 https://github.com/rust-lang/rust/commit/bb6d1d0a0966c04a75389348642e11ae44c86514#r48100619

3 years agoRollup merge of #83003 - notriddle:rustdoc-index-v3, r=GuillaumeGomez
Yuki Okushi [Thu, 11 Mar 2021 23:55:20 +0000 (08:55 +0900)]
Rollup merge of #83003 - notriddle:rustdoc-index-v3, r=GuillaumeGomez

rustdoc: tweak the search index format

This essentially switches search-index.js from a "array of struct" to a "struct of array" format, like this:

    {
    "doc": "Crate documentation",
    "t": [ 1, 1, 2, 3, ... ],
    "n": [ "Something", "SomethingElse", "whatever", "do_stuff", ... ],
    "q": [ "a::b", "", "", "", ... ],
    "d": [ "A Struct That Does Something", "Another Struct", "a function", "another function", ... ],
    "i": [ 0, 0, 1, 1, ... ],
    "f": [ null, null, [], [], ... ],
    "p": ...,
    "a": ...
    }

So `{ty: 1, name: "Something", path: "a::b", desc: "A Struct That Does Something", parent_idx: 0, search_type: null}` is the first item.

This makes the uncompressed version smaller, but it really shows on the compressed version:

    notriddle:rust$ wc -c new-search-index1.52.0.js
    2622427 new-search-index1.52.0.js
    notriddle:rust$ wc -c old-search-index1.52.0.js
    2725046 old-search-index1.52.0.js
    notriddle:rust$ gzip new-search-index1.52.0.js
    notriddle:rust$ gzip old-search-index1.52.0.js
    notriddle:rust$ wc -c new-search-index1.52.0.js.gz
    239385 new-search-index1.52.0.js.gz
    notriddle:rust$ wc -c old-search-index1.52.0.js.gz
    296328 old-search-index1.52.0.js.gz

That's a 4% improvement on the uncompressed version (fewer `[]`, and also changing `null` to `0` in the parent_idx list), and 20% improvement after gzipping it, thanks to putting like-typed data next to each other. Any compression algorithm based on a sliding window will probably show this kind of improvement.

3 years agoRollup merge of #83001 - camelid:gitignore-vim-swap, r=Mark-Simulacrum
Yuki Okushi [Thu, 11 Mar 2021 23:55:19 +0000 (08:55 +0900)]
Rollup merge of #83001 - camelid:gitignore-vim-swap, r=Mark-Simulacrum

Ignore Vim swap files

I got this from [a Stack Overflow answer][so].
(I didn't add `*~` because it was already there.)

[so]: https://stackoverflow.com/a/4824199

3 years agoRollup merge of #82979 - GuillaumeGomez:run-button-pos, r=Nemo157
Yuki Okushi [Thu, 11 Mar 2021 23:55:18 +0000 (08:55 +0900)]
Rollup merge of #82979 - GuillaumeGomez:run-button-pos, r=Nemo157

Fix "run" button position in error index

This isn't really a rustdoc issue but I still made the same fix in the `rustdoc.css` file (doesn't hurt).

Before:

![Screenshot from 2021-03-10 16-35-49](https://user-images.githubusercontent.com/3050060/110655807-aa402800-81bf-11eb-8a88-bc979efd1697.png)

After:

![Screenshot from 2021-03-10 16-40-08](https://user-images.githubusercontent.com/3050060/110655843-b4622680-81bf-11eb-8670-42975d92b4eb.png)

cc ````@jyn514```` (considering this is quite a big bug and an easy fix)
r? ````@Nemo157````

3 years agoRollup merge of #82966 - tspiteri:msys2-link, r=Mark-Simulacrum
Yuki Okushi [Thu, 11 Mar 2021 23:55:17 +0000 (08:55 +0900)]
Rollup merge of #82966 - tspiteri:msys2-link, r=Mark-Simulacrum

update MSYS2 link in README

Now https://msys2.github.io/ redirects to https://www.msys2.org/, so the README might just link to that immediately.

3 years agoRollup merge of #82965 - XAMPPRocky:spv-ext, r=nagisa
Yuki Okushi [Thu, 11 Mar 2021 23:55:16 +0000 (08:55 +0900)]
Rollup merge of #82965 - XAMPPRocky:spv-ext, r=nagisa

Add spirv extension handling in compiletest

We're trying to use `compiletest` for Rust-GPU's testsuite, and ran into an issue with host specific extensions. This adds handling to fix that.

3 years agoRollup merge of #82950 - mockersf:slice-intra-doc-link, r=jyn514
Yuki Okushi [Thu, 11 Mar 2021 23:55:15 +0000 (08:55 +0900)]
Rollup merge of #82950 - mockersf:slice-intra-doc-link, r=jyn514

convert slice doc link to intra-doc links

Continuing where #80189 stopped, with `core::slice`.

I had an issue with two dead links in my doc when implementing `Deref<Target = [T]>` for one of my type. This means that [`binary_search_by_key`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.binary_search_by_key) was available, but not [`sort_by_key`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.sort_by_key) even though it was linked in it's doc (same issue with [`as_ptr`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.as_ptr) and [`as_mut_pbr`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.as_mut_ptr)). It becomes available if I implement `DerefMut`, as it needs an `&mut self`.

<details>
  <summary>Code that will have dead links in its doc</summary>

```rust
pub struct A;
pub struct B;

impl std::ops::Deref for B{
    type Target = [A];

    fn deref(&self) -> &Self::Target {
        &A
    }
}
```
</details>

I removed the link to `sort_by_key` from `binary_search_by_key` doc as I didn't find a nice way to have a live link:
- `binary_search_by_key` is in `core`
- `sort_by_key` is in `alloc`
- intra-doc link `slice::sort_by_key` doesn't work, as `alloc` is not available when `core` is being build (the warning can't be ignored: ```error[E0710]: an unknown tool name found in scoped lint: `rustdoc::broken_intra_doc_links` ```)
- keeping the link as an anchor `#method.sort_by_key` meant a dead link
- an absolute link would work but doesn't feel right...

3 years agoRollup merge of #82860 - LeSeulArtichaut:unpretty-thir, r=spastorino
Yuki Okushi [Thu, 11 Mar 2021 23:55:14 +0000 (08:55 +0900)]
Rollup merge of #82860 - LeSeulArtichaut:unpretty-thir, r=spastorino

Add `-Z unpretty` flag for the THIR

This adds a new perma-unstable flag, `-Zunpretty=thir-tree`, that dumps the raw THIR tree for each body in the crate.

Implements the THIR part of MCP rust-lang/compiler-team#408, helps with rust-lang/rustc-dev-guide#1062.
Depends on #82495, blocked on that. Only the two last commits are added by this PR.
r? ```@spastorino``` cc ```@estebank```

3 years agoRollup merge of #82571 - aDotInTheVoid:reexport-tests, r=CraftSpider
Yuki Okushi [Thu, 11 Mar 2021 23:55:13 +0000 (08:55 +0900)]
Rollup merge of #82571 - aDotInTheVoid:reexport-tests, r=CraftSpider

Rustdoc Json: Add tests for Reexports, and improve jsondocck

The two changes are orthognal, so you can land just one if you want, but the improved errors realy helped write the tests.

Notably does not have the case from #80664, but I want to have all the ajacent cases tested before starting work on that to ensure I dont break anything.

Improves #81359

cc ```@CraftSpider```

r? ```@jyn514```

```@rustbot``` modify labels: +A-testsuite +T-rustdoc +A-rustdoc-json

3 years agoRollup merge of #80385 - camelid:clarify-cell-replace-docs, r=Mark-Simulacrum
Yuki Okushi [Thu, 11 Mar 2021 23:55:09 +0000 (08:55 +0900)]
Rollup merge of #80385 - camelid:clarify-cell-replace-docs, r=Mark-Simulacrum

Clarify what `Cell::replace` returns

3 years agoSupport merge_functions option in NewPM since LLVM >= 12
Hiroki Noda [Thu, 11 Mar 2021 21:30:49 +0000 (06:30 +0900)]
Support merge_functions option in NewPM since LLVM >= 12

now we can pass this flag since https://reviews.llvm.org/D93002 has been
merged.

3 years agoAdd tests for issues #82833 and #82859
Nikita Popov [Thu, 11 Mar 2021 21:55:11 +0000 (22:55 +0100)]
Add tests for issues #82833 and #82859

3 years agoAuto merge of #82417 - the8472:fix-copy_file_range-append, r=m-ou-se
bors [Thu, 11 Mar 2021 21:41:01 +0000 (21:41 +0000)]
Auto merge of #82417 - the8472:fix-copy_file_range-append, r=m-ou-se

Fix io::copy specialization using copy_file_range when writer was opened with O_APPEND

fixes #82410

While `sendfile()` returns `EINVAL` when the output was opened with O_APPEND,  `copy_file_range()` does not and returns `EBADF` instead, which – unlike other `EBADF` causes – is not fatal for this operation since a regular `write()` will likely succeed.

We now treat `EBADF` as a non-fatal error for `copy_file_range` and fall back to a read-write copy as we already did for several other errors.

3 years agoUpdate llvm-project submodule
Nikita Popov [Thu, 11 Mar 2021 21:04:10 +0000 (22:04 +0100)]
Update llvm-project submodule

3 years agoAuto merge of #6826 - TaKO8Ki:refactor-methods-mod, r=phansch
bors [Thu, 11 Mar 2021 19:54:48 +0000 (19:54 +0000)]
Auto merge of #6826 - TaKO8Ki:refactor-methods-mod, r=phansch

Refactor: arrange lints in `methods` module

This PR arranges methods lints so that they can be accessed more easily.
Basically, I refactored them following the instruction described in #6680.

changelog: Move lints in methods module into their own modules.

3 years agoAdd `-Z unpretty` flag for the THIR
LeSeulArtichaut [Sun, 7 Mar 2021 14:09:39 +0000 (15:09 +0100)]
Add `-Z unpretty` flag for the THIR

3 years agoMake THIR data structures public
LeSeulArtichaut [Sun, 7 Mar 2021 14:09:00 +0000 (15:09 +0100)]
Make THIR data structures public

3 years agoAuto merge of #82806 - nikic:memcpyopt-mssa, r=nagisa
bors [Thu, 11 Mar 2021 18:14:59 +0000 (18:14 +0000)]
Auto merge of #82806 - nikic:memcpyopt-mssa, r=nagisa

Enable MemorySSA in MemCpyOpt

LLVM 12 ships with an implementation of MemCpyOpt which is based on MSSA instead of MDA. This implementation can eliminate memcpys across blocks, and as such fixes many (but not all) failures to eliminate redundant memcpys for Rust code. Unfortunately this was only enabled by default shortly after LLVM 12 was cut. This backports the enablement to our LLVM fork.

Perf results: https://perf.rust-lang.org/compare.html?start=8fd946c63a6c3aae9788bd459d278cb2efa77099&end=0628b91ce17035fb5b6a1a99a4f2ab9ab69be7a8

There are improvements on check and debug builds, which indicate that rustc itself has become faster. For opt builds this is, on average, a very minor improvement as well, although there is one significant outlier with deep-vector-opt. This benchmark creates ~140000 zero stores, which are now coalesced into a memset slightly later, resulting in longer compile-time for intermediate passes.

3 years agoDon't implement mem::replace with mem::swap.
Mara Bos [Thu, 11 Mar 2021 18:04:47 +0000 (19:04 +0100)]
Don't implement mem::replace with mem::swap.

3 years agoUpdate RLS
Igor Matuszewski [Thu, 11 Mar 2021 18:01:01 +0000 (19:01 +0100)]
Update RLS

3 years agoAuto merge of #6884 - matthiaskrgr:lintcheck_crate, r=Manishearth
bors [Thu, 11 Mar 2021 16:10:33 +0000 (16:10 +0000)]
Auto merge of #6884 - matthiaskrgr:lintcheck_crate, r=Manishearth

move lintcheck into its own crate

This pr:
* moves lintcheck out of `clippy dev` and into its own crate (`lintcheck`)  (I should have done this earlier :D)
* makes lintcheck terminate if it is not launched from the repo root (to prevent problems with wrong paths when using `cargo run` in the crate root)
* fixes json lint messages leaking the runners `$HOME` when a lint messages comes from a proc macro that originates from a crate inside the `$CARGO_CACHE`
* adds more documentation to lintchecks `README.md` and mentions lintcheck in `docs/basics.md`

changelog: none

3 years agoAuto merge of #82495 - LeSeulArtichaut:eager-thir, r=oli-obk
bors [Thu, 11 Mar 2021 15:34:01 +0000 (15:34 +0000)]
Auto merge of #82495 - LeSeulArtichaut:eager-thir, r=oli-obk

Eagerly construct bodies of THIR

With this PR:
 - the THIR is no longer constructed lazily, but is entirely built before being passed to the MIR Builder
 - the THIR is now allocated in arenas instead of `Box`es

However, this PR doesn't make any changes to the way patterns are constructed: they are still boxed, and exhaustiveness checking is unchanged.

Implements MCP rust-lang/compiler-team#409.
Closes rust-lang/project-thir-unsafeck#1.
r? `@ghost` cc `@nikomatsakis` `@oli-obk`

3 years agoReintroduce accidentally deleted assertions.
Oli Scherer [Thu, 11 Mar 2021 14:56:03 +0000 (14:56 +0000)]
Reintroduce accidentally deleted assertions.

These were removed in https://github.com/rust-lang/rust/pull/50198

3 years agodoc line length fixes
Matthias Krüger [Thu, 11 Mar 2021 14:47:51 +0000 (15:47 +0100)]
doc line length fixes

3 years agodocs: basics.md: mention lintcheck
Matthias Krüger [Thu, 11 Mar 2021 14:37:10 +0000 (15:37 +0100)]
docs: basics.md: mention lintcheck

3 years agolintcheck: fix clippy warnings
Matthias Krüger [Thu, 11 Mar 2021 14:25:43 +0000 (15:25 +0100)]
lintcheck: fix clippy warnings

3 years agolintcheck: fix --fix and document it in the readme.
Matthias Krüger [Thu, 11 Mar 2021 14:18:56 +0000 (15:18 +0100)]
lintcheck: fix --fix and document it in the readme.

also hook lintcheck into clippy-dev so that `clippy dev fmt` formats it.

3 years agolintcheck: update logs
Matthias Krüger [Thu, 11 Mar 2021 14:05:13 +0000 (15:05 +0100)]
lintcheck: update logs

3 years agolintcheck: fix bug where lint messages about macros coming from crate deps would...
Matthias Krüger [Thu, 11 Mar 2021 13:29:00 +0000 (14:29 +0100)]
lintcheck: fix bug where lint messages about macros coming from crate deps would sneak in absolute paths to registry sources.

make the path a relative path that starts at the CARGO_HOME to not print the users home location in the log

3 years agolintcheck: update readme and remove the now redundant readme from clippy-dev
Matthias Krüger [Tue, 9 Mar 2021 22:20:04 +0000 (23:20 +0100)]
lintcheck: update readme and remove the now redundant readme from clippy-dev

3 years agomove testfiles to "lintcheck" and fix more paths
Matthias Krüger [Tue, 9 Mar 2021 13:40:59 +0000 (14:40 +0100)]
move testfiles to "lintcheck" and fix more paths

3 years agoEnable MemorySSA-based MemCpyOpt
Nikita Popov [Mon, 8 Mar 2021 15:22:36 +0000 (16:22 +0100)]
Enable MemorySSA-based MemCpyOpt

This updates the LLVM submodule to pick up a backported patch
to enable MemorySSA-based MemCpyOpt, which is capable of optimizing
away memcpy's across basic blocks.

3 years agogitignore: add lintchecks target dir
Matthias Krüger [Tue, 9 Mar 2021 13:08:26 +0000 (14:08 +0100)]
gitignore: add lintchecks target dir

3 years agolintcheck: make sure we lauch from the repo root
Matthias Krüger [Tue, 9 Mar 2021 13:06:42 +0000 (14:06 +0100)]
lintcheck: make sure we lauch from the repo root

This will terminate the program if run via "cargo run".
"cargo run" does currently not work because at least a bunch of paths do not take that into account.

3 years agolintcheck: move out of clippy-dev into own crate
Matthias Krüger [Sat, 6 Mar 2021 09:06:52 +0000 (10:06 +0100)]
lintcheck: move out of clippy-dev into own crate

3 years agoAuto merge of #83009 - RalfJung:miri, r=RalfJung
bors [Thu, 11 Mar 2021 11:37:36 +0000 (11:37 +0000)]
Auto merge of #83009 - RalfJung:miri, r=RalfJung

bump Miri

Fixes https://github.com/rust-lang/rust/issues/82961
Cc `@rust-lang/miri` r? `@ghost`

3 years agofix interning-defined-symbol error
Takayuki Maeda [Thu, 11 Mar 2021 11:18:33 +0000 (20:18 +0900)]
fix interning-defined-symbol error

3 years agoremove unused imports
Takayuki Maeda [Thu, 11 Mar 2021 11:02:29 +0000 (20:02 +0900)]
remove unused imports

3 years agomove expect_fun_call to its own module
Takayuki Maeda [Sat, 6 Mar 2021 13:26:29 +0000 (22:26 +0900)]
move expect_fun_call to its own module

3 years agomove or_fun_call to its own module
Takayuki Maeda [Sat, 6 Mar 2021 10:40:34 +0000 (19:40 +0900)]
move or_fun_call to its own module

3 years agomove map_unwrap_or to its own module
Takayuki Maeda [Sat, 6 Mar 2021 10:31:46 +0000 (19:31 +0900)]
move map_unwrap_or to its own module

3 years agomove option_map_or_none to its own module
Takayuki Maeda [Sat, 6 Mar 2021 10:11:52 +0000 (19:11 +0900)]
move option_map_or_none to its own module

3 years agounnecessary_fold to its own module
Takayuki Maeda [Sat, 6 Mar 2021 10:05:51 +0000 (19:05 +0900)]
unnecessary_fold to its own module

3 years agomove useless_asref to its own module
Takayuki Maeda [Sat, 6 Mar 2021 09:59:35 +0000 (18:59 +0900)]
move useless_asref to its own module

3 years agomove clone_on_copy to its own module
Takayuki Maeda [Sat, 6 Mar 2021 09:53:31 +0000 (18:53 +0900)]
move clone_on_copy to its own module

3 years agomove iter_skip_next to its own module
Takayuki Maeda [Sat, 6 Mar 2021 09:45:25 +0000 (18:45 +0900)]
move iter_skip_next to its own module

3 years agomove map_flatten and search_is_some to their own modules
Takayuki Maeda [Sat, 6 Mar 2021 09:41:43 +0000 (18:41 +0900)]
move map_flatten and search_is_some to their own modules

3 years agomove flat_map_identity to its own module
Takayuki Maeda [Sat, 6 Mar 2021 09:30:40 +0000 (18:30 +0900)]
move flat_map_identity to its own module

3 years agomove filter_map_flat_map to its own module
Takayuki Maeda [Sat, 6 Mar 2021 09:22:15 +0000 (18:22 +0900)]
move filter_map_flat_map to its own module

3 years agomove filter_flat_map to its own module
Takayuki Maeda [Sat, 6 Mar 2021 09:19:18 +0000 (18:19 +0900)]
move filter_flat_map to its own module

3 years agomove filter_map_next to its own module
Takayuki Maeda [Sat, 6 Mar 2021 09:11:42 +0000 (18:11 +0900)]
move filter_map_next to its own module

3 years agomove filter_map_map to its own module
Takayuki Maeda [Sat, 6 Mar 2021 09:05:15 +0000 (18:05 +0900)]
move filter_map_map to its own module

3 years agomove filter_map to its own module
Takayuki Maeda [Sat, 6 Mar 2021 08:55:29 +0000 (17:55 +0900)]
move filter_map to its own module

3 years agomove from_iter_insteam_of_collect to its own module
Takayuki Maeda [Sat, 6 Mar 2021 08:46:50 +0000 (17:46 +0900)]
move from_iter_insteam_of_collect to its own module

3 years agomove into_iter_on_ref and single_char_pattern to their own modules
Takayuki Maeda [Sat, 6 Mar 2021 08:28:14 +0000 (17:28 +0900)]
move into_iter_on_ref and single_char_pattern to their own modules

3 years agomove single_char_push_string to its own module
Takayuki Maeda [Sat, 6 Mar 2021 06:39:28 +0000 (15:39 +0900)]
move single_char_push_string to its own module

3 years agomove single_char_insert_string to its own module
Takayuki Maeda [Sat, 6 Mar 2021 06:29:02 +0000 (15:29 +0900)]
move single_char_insert_string to its own module

3 years agomove string_extend_chars and clone_on_ref_ptr to their own module
Takayuki Maeda [Thu, 4 Mar 2021 15:16:43 +0000 (00:16 +0900)]
move string_extend_chars and clone_on_ref_ptr to their own module

3 years agomove wrong_self_convention to its own module
Takayuki Maeda [Thu, 4 Mar 2021 14:47:30 +0000 (23:47 +0900)]
move wrong_self_convention to its own module

3 years agomove iter_nth, iter_nth_zero and iterator_step_by_zero to their own module
Takayuki Maeda [Thu, 4 Mar 2021 14:06:05 +0000 (23:06 +0900)]
move iter_nth, iter_nth_zero and iterator_step_by_zero to their own module

3 years agomove iter_next_slice to its own module
Takayuki Maeda [Thu, 4 Mar 2021 13:50:53 +0000 (22:50 +0900)]
move iter_next_slice to its own module

3 years agomove map_collect_result_unit to its own module
Takayuki Maeda [Thu, 4 Mar 2021 10:47:06 +0000 (19:47 +0900)]
move map_collect_result_unit to its own module

3 years agomove zst_offset to its own module
Takayuki Maeda [Thu, 4 Mar 2021 10:46:44 +0000 (19:46 +0900)]
move zst_offset to its own module

3 years agoreplace `lints` and `lint` with `check`
Takayuki Maeda [Tue, 2 Mar 2021 16:16:16 +0000 (01:16 +0900)]
replace `lints` and `lint` with `check`

3 years agomove iter_cloned_collect to its own module
Takayuki Maeda [Tue, 2 Mar 2021 16:09:33 +0000 (01:09 +0900)]
move iter_cloned_collect to its own module

3 years agomove uninit_assumed_init to its own module
Takayuki Maeda [Tue, 2 Mar 2021 16:03:47 +0000 (01:03 +0900)]
move uninit_assumed_init to its own module

3 years agomove filetype_is_file to its own module
Takayuki Maeda [Tue, 2 Mar 2021 15:55:19 +0000 (00:55 +0900)]
move filetype_is_file to its own module

3 years agomove suspicious_map to its own module
Takayuki Maeda [Tue, 2 Mar 2021 15:48:21 +0000 (00:48 +0900)]
move suspicious_map to its own module

3 years agomove option_as_ref_deref to its own module
Takayuki Maeda [Tue, 2 Mar 2021 15:43:27 +0000 (00:43 +0900)]
move option_as_ref_deref to its own module

3 years agomove skip_while_next to its own module
Takayuki Maeda [Tue, 2 Mar 2021 15:31:15 +0000 (00:31 +0900)]
move skip_while_next to its own module

3 years agomove expect_used, filter_next, get_unwrap, ok_expect and unwrap_used to their own...
Takayuki Maeda [Tue, 2 Mar 2021 15:14:38 +0000 (00:14 +0900)]
move expect_used, filter_next, get_unwrap, ok_expect and unwrap_used to their own modules

3 years agoAuto merge of #6881 - flip1995:rustup, r=flip1995
bors [Thu, 11 Mar 2021 10:08:29 +0000 (10:08 +0000)]
Auto merge of #6881 - flip1995:rustup, r=flip1995

Rustup

changelog: none