]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoImprove error and help messages
Camelid [Sun, 14 Feb 2021 05:42:32 +0000 (21:42 -0800)]
Improve error and help messages

3 years agoAuto merge of #81956 - ssomers:btree_post_75200, r=Mark-Simulacrum
bors [Sun, 14 Feb 2021 04:53:24 +0000 (04:53 +0000)]
Auto merge of #81956 - ssomers:btree_post_75200, r=Mark-Simulacrum

BTree: remove outdated traces of coercions

The introduction of `marker::ValMut` (#75200) meant iterators no longer see mutable keys but their code still pretends it does. And settle on the majority style `Some(unsafe {…})` over `unsafe { Some(…) }`.

r? `@Mark-Simulacrum`

3 years agoupdate message
Henry Boisdequin [Sun, 14 Feb 2021 04:38:37 +0000 (10:08 +0530)]
update message

3 years agoEdit `rustc_arena::DropArena` docs
pierwill [Sat, 13 Feb 2021 23:18:42 +0000 (15:18 -0800)]
Edit `rustc_arena::DropArena` docs

- Add a "Safety" section, edit formatting for clarity
- Add missing punctuation in code comments

3 years agoAuto merge of #81238 - RalfJung:copy-intrinsics, r=m-ou-se
bors [Sat, 13 Feb 2021 20:30:07 +0000 (20:30 +0000)]
Auto merge of #81238 - RalfJung:copy-intrinsics, r=m-ou-se

directly expose copy and copy_nonoverlapping intrinsics

This effectively un-does https://github.com/rust-lang/rust/pull/57997. That should help with `ptr::read` codegen in debug builds (and any other of these low-level functions that bottoms out at `copy`/`copy_nonoverlapping`), where the wrapper function will not get inlined. See the discussion in https://github.com/rust-lang/rust/pull/80290 and https://github.com/rust-lang/rust/issues/81163.

Cc `@bjorn3` `@therealprof`

3 years agoCheck query cache before calling into the query engine.
Camille GILLOT [Sat, 6 Feb 2021 13:52:04 +0000 (14:52 +0100)]
Check query cache before calling into the query engine.

3 years agoDrop the cache lock earlier.
Camille GILLOT [Sat, 6 Feb 2021 13:04:20 +0000 (14:04 +0100)]
Drop the cache lock earlier.

3 years agoSeparate the query cache from the query state.
Camille GILLOT [Sat, 6 Feb 2021 12:49:08 +0000 (13:49 +0100)]
Separate the query cache from the query state.

3 years agoReturn a Result for query cache.
Camille GILLOT [Fri, 23 Oct 2020 20:34:32 +0000 (22:34 +0200)]
Return a Result for query cache.

3 years agoIntroduce query_storage.
Camille GILLOT [Tue, 19 Jan 2021 19:02:05 +0000 (20:02 +0100)]
Introduce query_storage.

3 years agoIntroduce query_stored module.
Camille GILLOT [Sun, 17 Jan 2021 13:57:07 +0000 (14:57 +0100)]
Introduce query_stored module.

3 years agoMerge {get,ensure}_query.
Camille GILLOT [Wed, 18 Nov 2020 15:53:39 +0000 (16:53 +0100)]
Merge {get,ensure}_query.

3 years agoa wild test has appeared uwu
Ellen [Sat, 13 Feb 2021 18:27:39 +0000 (18:27 +0000)]
a wild test has appeared uwu

3 years agoyeet ya fixme into the void
Ellen [Sat, 13 Feb 2021 18:11:43 +0000 (18:11 +0000)]
yeet ya fixme into the void

3 years agodebug!("paramenv={}paramenv={}paramenv={}paramenv={}")
Ellen [Sat, 13 Feb 2021 19:08:31 +0000 (19:08 +0000)]
debug!("paramenv={}paramenv={}paramenv={}paramenv={}")

3 years agoAddress review comments
Aaron Hill [Sat, 13 Feb 2021 17:42:43 +0000 (12:42 -0500)]
Address review comments

3 years agoFix clippy's path to the copy intrinsics.
Mara Bos [Sat, 13 Feb 2021 17:58:54 +0000 (18:58 +0100)]
Fix clippy's path to the copy intrinsics.

3 years agoAuto merge of #81494 - cuviper:btree-node-init, r=Mark-Simulacrum
bors [Sat, 13 Feb 2021 17:29:22 +0000 (17:29 +0000)]
Auto merge of #81494 - cuviper:btree-node-init, r=Mark-Simulacrum

Initialize BTree nodes directly in the heap

We can avoid any stack-local nodes entirely by using `Box::new_uninit`, and since the nodes are mostly `MaybeUninit` fields, we only need a couple of actual writes before `assume_init`. This should help with the stack overflows in #81444, and may also improve performance in general.

r? `@Mark-Simulacrum`
cc `@ssomers`

3 years agoFix MIR pretty printer for non-local DefIds
Ömer Sinan Ağacan [Wed, 10 Feb 2021 14:32:45 +0000 (17:32 +0300)]
Fix MIR pretty printer for non-local DefIds

3 years agoRequire passing an `AttrWrapper` to `collect_tokens_trailing_token`
Aaron Hill [Fri, 22 Jan 2021 18:28:08 +0000 (13:28 -0500)]
Require passing an `AttrWrapper` to `collect_tokens_trailing_token`

This is a pure refactoring split out from #80689.
It represents the most invasive part of that PR, requiring changes in
every caller of `parse_outer_attributes`

In order to eagerly expand `#[cfg]` attributes while preserving the
original `TokenStream`, we need to know the range of tokens that
corresponds to every attribute target. This is accomplished by making
`parse_outer_attributes` return an opaque `AttrWrapper` struct. An
`AttrWrapper` must be converted to a plain `AttrVec` by passing it to
`collect_tokens_trailing_token`. This makes it difficult to accidentally
construct an AST node with attributes without calling `collect_tokens_trailing_token`,
since AST nodes store an `AttrVec`, not an `AttrWrapper`.

As a result, we now call `collect_tokens_trailing_token` for attribute
targets which only support inert attributes, such as generic arguments
and struct fields. Currently, the constructed `LazyTokenStream` is
simply discarded. Future PRs will record the token range corresponding
to the attribute target, allowing those tokens to be removed from an
enclosing `collect_tokens_trailing_token` call if necessary.

3 years agoFixed minor typo in catch_unwind docs
Victor Roest [Sat, 13 Feb 2021 15:59:06 +0000 (16:59 +0100)]
Fixed minor typo in catch_unwind docs

Changed 'a an exception' to 'an exception'

3 years agoHeat up the ICE-y error reporting
Ellen [Sat, 13 Feb 2021 14:42:30 +0000 (14:42 +0000)]
Heat up the ICE-y error reporting

rest in peace match bool <3

3 years agoCTFE validation: catch ReadPointerAsBytes and better error
Ralf Jung [Sat, 13 Feb 2021 13:58:31 +0000 (14:58 +0100)]
CTFE validation: catch ReadPointerAsBytes and better error

3 years agoFix typos in BTreeSet::{first, last} docs
Taiki Endo [Sat, 13 Feb 2021 13:49:46 +0000 (22:49 +0900)]
Fix typos in BTreeSet::{first, last} docs

3 years agoAuto merge of #81666 - hyd-dev:miri-windows-test-fail, r=Mark-Simulacrum
bors [Sat, 13 Feb 2021 13:47:02 +0000 (13:47 +0000)]
Auto merge of #81666 - hyd-dev:miri-windows-test-fail, r=Mark-Simulacrum

Don't release Miri if its tests only failed on Windows

Extends #66053 to Windows, so the released Miri won't be broken if its tests only fail on Windows.

Relevant Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/Miri.20is.20still.20available.20in.20rustup.20today.3F

3 years agoAdd match pattern diagnostics regression test
Bram van den Heuvel [Mon, 8 Feb 2021 20:43:52 +0000 (21:43 +0100)]
Add match pattern diagnostics regression test

3 years agono need to check assertion on fast path.
Giles Cope [Sat, 13 Feb 2021 12:25:56 +0000 (12:25 +0000)]
no need to check assertion on fast path.

3 years agoadd test
b-naber [Sat, 13 Feb 2021 11:12:57 +0000 (12:12 +0100)]
add test

3 years agoAuto merge of #81854 - the8472:specialize-clone-slice, r=Mark-Simulacrum
bors [Sat, 13 Feb 2021 10:55:19 +0000 (10:55 +0000)]
Auto merge of #81854 - the8472:specialize-clone-slice, r=Mark-Simulacrum

specialize slice::clone_from_slice() for T: Copy

3 years agofix 82032
b-naber [Sat, 13 Feb 2021 10:47:44 +0000 (11:47 +0100)]
fix 82032

3 years agoDisabled SHELL=dash on Windows due to invalid path backslash handling
Rich Kadel [Sat, 13 Feb 2021 08:14:50 +0000 (00:14 -0800)]
Disabled SHELL=dash on Windows due to invalid path backslash handling

Calling an executable via full path with Windows backslashes fails in
dash.

3 years agoAuto merge of #82053 - JohnTitor:rollup-ymi9q0g, r=JohnTitor
bors [Sat, 13 Feb 2021 07:58:44 +0000 (07:58 +0000)]
Auto merge of #82053 - JohnTitor:rollup-ymi9q0g, r=JohnTitor

Rollup of 8 pull requests

Successful merges:

 - #81811 (Fix doc test for Vec::retain(), now passes clippy::eval_order_dependence)
 - #81900 (Organize trait test files)
 - #81995 (Fix suggestion to introduce explicit lifetime)
 - #82031 (Drop an unnecessary intermediate variable)
 - #82033 (Refactor `get_word_attr` to return only `Option`)
 - #82040 (Add test to prevent src link regression)
 - #82041 (Add docs for shared_from_slice From impls)
 - #82050 (Added tests to drain an empty vec)

Failed merges:

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

3 years agoRollup merge of #82050 - hbina:fix/added-test-to-drain-empty-vec, r=dtolnay
Yuki Okushi [Sat, 13 Feb 2021 07:36:52 +0000 (16:36 +0900)]
Rollup merge of #82050 - hbina:fix/added-test-to-drain-empty-vec, r=dtolnay

Added tests to drain an empty vec

Discovered this kind of issue in an unrelated library.
The author copied the tests from here and AFAIK, there are no tests for this particular case.

https://github.com/LeonineKing1199/minivec/pull/19

Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
3 years agoRollup merge of #82041 - notriddle:shared-from-slice-docs, r=m-ou-se
Yuki Okushi [Sat, 13 Feb 2021 07:36:51 +0000 (16:36 +0900)]
Rollup merge of #82041 - notriddle:shared-from-slice-docs, r=m-ou-se

Add docs for shared_from_slice From impls

The advantage of making these docs is mostly in pointing out that these
functions all make new allocations and copy/clone/move the source into them.

These docs are on the function, and not the `impl` block, to avoid showing
the "[+] show undocumented items" button.

CC #51430

3 years agoRollup merge of #82040 - GuillaumeGomez:ensure-src-link, r=CraftSpider
Yuki Okushi [Sat, 13 Feb 2021 07:36:49 +0000 (16:36 +0900)]
Rollup merge of #82040 - GuillaumeGomez:ensure-src-link, r=CraftSpider

Add test to prevent src link regression

Fixes #80502.

This PR is simply about adding a test to prevent a regression.

cc `@bugadani` `@CraftSpider`
r? `@camelid`

3 years agoRollup merge of #82033 - magurotuna:issue82016, r=jyn514
Yuki Okushi [Sat, 13 Feb 2021 07:36:48 +0000 (16:36 +0900)]
Rollup merge of #82033 - magurotuna:issue82016, r=jyn514

Refactor `get_word_attr` to return only `Option`

This commit removes `bool` from the return type of `NestedAttributesExt::get_word_attr` so it will return only `Option<ast::NestedMetaItem>` for less redundancy.

Closes #82016

r? `@jyn514`

3 years agoRollup merge of #82031 - LingMan:unneeded_var, r=varkor
Yuki Okushi [Sat, 13 Feb 2021 07:36:47 +0000 (16:36 +0900)]
Rollup merge of #82031 - LingMan:unneeded_var, r=varkor

Drop an unnecessary intermediate variable

Neither does it shorten the code nor does it provide a helpful name.

`@rustbot` modify labels +C-cleanup +T-compiler

r? `@varkor`

3 years agoRollup merge of #81995 - 0yoyoyo:fix-issue-81650-explicit-lifetime-error, r=estebank
Yuki Okushi [Sat, 13 Feb 2021 07:36:46 +0000 (16:36 +0900)]
Rollup merge of #81995 - 0yoyoyo:fix-issue-81650-explicit-lifetime-error, r=estebank

Fix suggestion to introduce explicit lifetime

Addresses #81650

Error message after fix:

```
error[E0311]: the parameter type `T` may not live long enough
  --> src/main.rs:25:11
   |
24 | fn play_with<T: Animal + Send>(scope: &Scope, animal: T) {
   |              -- help: consider adding an explicit lifetime bound...: `T: 'a +`
25 |     scope.spawn(move |_| {
   |           ^^^^^
   |
note: the parameter type `T` must be valid for the anonymous lifetime #2 defined on the function body at 24:1...
  --> src/main.rs:24:1
   |
24 | fn play_with<T: Animal + Send>(scope: &Scope, animal: T) {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...so that the type `[closure@src/main.rs:25:17: 27:6]` will meet its required lifetime bounds
  --> src/main.rs:25:11
   |
25 |     scope.spawn(move |_| {
   |           ^^^^^
```

3 years agoRollup merge of #81900 - vandenheuvel:organize_trait_tests, r=Mark-Simulacrum
Yuki Okushi [Sat, 13 Feb 2021 07:36:45 +0000 (16:36 +0900)]
Rollup merge of #81900 - vandenheuvel:organize_trait_tests, r=Mark-Simulacrum

Organize trait test files

Organizes trait tests in folders where reasonable and removes name redundancies.

3 years agoRollup merge of #81811 - schteve:fix_vec_retain_doc_test, r=m-ou-se
Yuki Okushi [Sat, 13 Feb 2021 07:36:40 +0000 (16:36 +0900)]
Rollup merge of #81811 - schteve:fix_vec_retain_doc_test, r=m-ou-se

Fix doc test for Vec::retain(), now passes clippy::eval_order_dependence

Doc test for Vec::retain() works correctly but is flagged by clippy::eval_order_dependence. Fix avoids the issue by using an iterator instead of an index.

3 years agoModifiers -> Qualifiers
Rune Tynan [Sat, 13 Feb 2021 04:24:09 +0000 (23:24 -0500)]
Modifiers -> Qualifiers

3 years agoAdded tests to drain an empty vec
Hanif Bin Ariffin [Sat, 13 Feb 2021 03:18:36 +0000 (11:18 +0800)]
Added tests to drain an empty vec

Discovered this kind of issue in an unrelated library.
The author copied the tests from here and AFAIK, there are no tests for this particular case.

Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
3 years agoAuto merge of #82045 - Dylan-DPC:rollup-244l0sb, r=Dylan-DPC
bors [Sat, 13 Feb 2021 02:46:57 +0000 (02:46 +0000)]
Auto merge of #82045 - Dylan-DPC:rollup-244l0sb, r=Dylan-DPC

Rollup of 10 pull requests

Successful merges:

 - #79775 (Fix injected errors when running doctests on a crate named after a keyword)
 - #81012 (Stabilize the partition_point feature)
 - #81479 (Allow casting mut array ref to mut ptr)
 - #81506 (HWAddressSanitizer support)
 - #81741 (Increment `self.index` before calling `Iterator::self.a.__iterator_ge…)
 - #81850 (use RWlock when accessing os::env)
 - #81911 (GAT/const_generics: Allow with_opt_const_param to return GAT param def_id)
 - #82022 (Push a `char` instead of a `str` with len one into a String)
 - #82023 (Remove unnecessary lint allow attrs on example)
 - #82030 (Use `Iterator::all` instead of open-coding it)

Failed merges:

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

3 years agoUse debug log level for developer oriented logs
Tomasz Miąsko [Sat, 13 Feb 2021 00:00:00 +0000 (00:00 +0000)]
Use debug log level for developer oriented logs

The information logged here is of limited general interest, while at the
same times makes it impractical to simply enable logging and share the
resulting logs due to the amount of the output produced.

Reduce log level from info to debug for developer oriented information.

For example, when building cargo, this reduces the amount of logs
generated by `RUSTC_LOG=info cargo build` from 265 MB to 79 MB.

Continuation of changes from 81350.

3 years agoRollup merge of #82030 - LingMan:init_directly, r=varkor
Dylan DPC [Fri, 12 Feb 2021 21:53:38 +0000 (22:53 +0100)]
Rollup merge of #82030 - LingMan:init_directly, r=varkor

Use `Iterator::all` instead of open-coding it

Shorter code and by initializing to the final value directly, the variable
doesn't need to be mut.

3 years agoRollup merge of #82023 - MikailBag:boxed-docs-unallow, r=jyn514
Dylan DPC [Fri, 12 Feb 2021 21:53:37 +0000 (22:53 +0100)]
Rollup merge of #82023 - MikailBag:boxed-docs-unallow, r=jyn514

Remove unnecessary lint allow attrs on example

It seems they are not needed anymore.

3 years agoRollup merge of #82022 - LingMan:single_char, r=jonas-schievink
Dylan DPC [Fri, 12 Feb 2021 21:53:36 +0000 (22:53 +0100)]
Rollup merge of #82022 - LingMan:single_char, r=jonas-schievink

Push a `char` instead of a `str` with len one into a String

``@rustbot`` modify labels +C-cleanup +T-compiler

3 years agoRollup merge of #81911 - BoxyUwU:constgenericgaticefix, r=nikomatsakis
Dylan DPC [Fri, 12 Feb 2021 21:53:34 +0000 (22:53 +0100)]
Rollup merge of #81911 - BoxyUwU:constgenericgaticefix, r=nikomatsakis

GAT/const_generics: Allow with_opt_const_param to return GAT param def_id

Fixes #75415
Fixes #79666
cc ```@lcnr```

I've absolutely no idea who to r?  for this...

3 years agoRollup merge of #81850 - the8472:env-rwlock, r=m-ou-se
Dylan DPC [Fri, 12 Feb 2021 21:53:33 +0000 (22:53 +0100)]
Rollup merge of #81850 - the8472:env-rwlock, r=m-ou-se

use RWlock when accessing os::env

Multiple threads modifying the current process environment is fairly uncommon. Optimize for the more common read case.

r? ````@m-ou-se````

3 years agoRollup merge of #81741 - sdroege:zip-trusted-random-access-specialization-panic-safet...
Dylan DPC [Fri, 12 Feb 2021 21:53:32 +0000 (22:53 +0100)]
Rollup merge of #81741 - sdroege:zip-trusted-random-access-specialization-panic-safety, r=KodrAus

Increment `self.index` before calling `Iterator::self.a.__iterator_ge…

…`t_unchecked` in `Zip` `TrustedRandomAccess` specialization

Otherwise if `Iterator::self.a.__iterator_get_unchecked` panics the
index would not have been incremented yet and another call to
`Iterator::next` would read from the same index again, which is not
allowed according to the API contract of `TrustedRandomAccess` for
`!Clone`.

Fixes https://github.com/rust-lang/rust/issues/81740

3 years agoRollup merge of #81506 - vo4:hwasan, r=nagisa
Dylan DPC [Fri, 12 Feb 2021 21:53:30 +0000 (22:53 +0100)]
Rollup merge of #81506 - vo4:hwasan, r=nagisa

HWAddressSanitizer support

#  Motivation
Compared to regular ASan, HWASan has a [smaller overhead](https://source.android.com/devices/tech/debug/hwasan). The difference in practice is that HWASan'ed code is more usable, e.g. Android device compiled with HWASan can be used as a daily driver.

# Example
```
fn main() {
    let xs = vec![0, 1, 2, 3];
    let _y = unsafe { *xs.as_ptr().offset(4) };
}
```
```
==223==ERROR: HWAddressSanitizer: tag-mismatch on address 0xefdeffff0050 at pc 0xaaaad00b3468
READ of size 4 at 0xefdeffff0050 tags: e5/00 (ptr/mem) in thread T0
    #0 0xaaaad00b3464  (/root/main+0x53464)
    #1 0xaaaad00b39b4  (/root/main+0x539b4)
    #2 0xaaaad00b3dd0  (/root/main+0x53dd0)
    #3 0xaaaad00b61dc  (/root/main+0x561dc)
    #4 0xaaaad00c0574  (/root/main+0x60574)
    #5 0xaaaad00b6290  (/root/main+0x56290)
    #6 0xaaaad00b6170  (/root/main+0x56170)
    #7 0xaaaad00b3578  (/root/main+0x53578)
    #8 0xffff81345e70  (/lib64/libc.so.6+0x20e70)
    #9 0xaaaad0096310  (/root/main+0x36310)

[0xefdeffff0040,0xefdeffff0060) is a small allocated heap chunk; size: 32 offset: 16
0xefdeffff0050 is located 0 bytes to the right of 16-byte region [0xefdeffff0040,0xefdeffff0050)
allocated here:
    #0 0xaaaad009bcdc  (/root/main+0x3bcdc)
    #1 0xaaaad00b1eb0  (/root/main+0x51eb0)
    #2 0xaaaad00b20d4  (/root/main+0x520d4)
    #3 0xaaaad00b2800  (/root/main+0x52800)
    #4 0xaaaad00b1cf4  (/root/main+0x51cf4)
    #5 0xaaaad00b33d4  (/root/main+0x533d4)
    #6 0xaaaad00b39b4  (/root/main+0x539b4)
    #7 0xaaaad00b61dc  (/root/main+0x561dc)
    #8 0xaaaad00b3578  (/root/main+0x53578)
    #9 0xaaaad0096310  (/root/main+0x36310)

Thread: T0 0xeffe00002000 stack: [0xffffc0590000,0xffffc0d90000) sz: 8388608 tls: [0xffff81521020,0xffff815217d0)
Memory tags around the buggy address (one tag corresponds to 16 bytes):
  0xfefcefffef80: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefcefffef90: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefcefffefa0: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefcefffefb0: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefcefffefc0: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefcefffefd0: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefcefffefe0: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefcefffeff0: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
=>0xfefceffff000: a2  a2  05  00  e5 [00] 00  00  00  00  00  00  00  00  00  00
  0xfefceffff010: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefceffff020: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefceffff030: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefceffff040: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefceffff050: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefceffff060: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefceffff070: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
  0xfefceffff080: 00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
Tags for short granules around the buggy address (one tag corresponds to 16 bytes):
  0xfefcefffeff0: ..  ..  ..  ..  ..  ..  ..  ..  ..  ..  ..  ..  ..  ..  ..  ..
=>0xfefceffff000: ..  ..  c5  ..  .. [..] ..  ..  ..  ..  ..  ..  ..  ..  ..  ..
  0xfefceffff010: ..  ..  ..  ..  ..  ..  ..  ..  ..  ..  ..  ..  ..  ..  ..  ..
See https://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html#short-granules for a description of short granule tags
Registers where the failure occurred (pc 0xaaaad00b3468):
    x0  e500efdeffff0050  x1  0000000000000004  x2  0000ffffc0d8f5a0  x3  0200efff00000000
    x4  0000ffffc0d8f4c0  x5  000000000000004f  x6  00000ffffc0d8f36  x7  0000efff00000000
    x8  e500efdeffff0050  x9  0200efff00000000  x10 0000000000000000  x11 0200efff00000000
    x12 0200effe000006b0  x13 0200effe000006b0  x14 0000000000000008  x15 00000000c00000cf
    x16 0000aaaad00a0afc  x17 0000000000000003  x18 0000000000000001  x19 0000ffffc0d8f718
    x20 ba00ffffc0d8f7a0  x21 0000aaaad00962e0  x22 0000000000000000  x23 0000000000000000
    x24 0000000000000000  x25 0000000000000000  x26 0000000000000000  x27 0000000000000000
    x28 0000000000000000  x29 0000ffffc0d8f650  x30 0000aaaad00b3468
```

# Comments/Caveats
* HWASan is only supported on arm64.
* I'm not sure if I should add a feature gate or piggyback on the existing one for sanitizers.
* HWASan requires `-C target-feature=+tagged-globals`. That flag should probably be set transparently to the user. Not sure how to go about that.

# TODO
* Need more tests.
* Update documentation.
* Fix symbolization.
* Integrate with CI

3 years agoRollup merge of #81479 - osa1:issue24151, r=lcnr
Dylan DPC [Fri, 12 Feb 2021 21:53:29 +0000 (22:53 +0100)]
Rollup merge of #81479 - osa1:issue24151, r=lcnr

Allow casting mut array ref to mut ptr

Allow casting mut array ref to mut ptr

We now allow two new casts:

- mut array reference to mut ptr. Example:

      let mut x: [usize; 2] = [0, 0];
      let p = &mut x as *mut usize;

  We allow casting const array references to const pointers so not
  allowing mut references to mut pointers was inconsistent.

- mut array reference to const ptr. Example:

      let mut x: [usize; 2] = [0, 0];
      let p = &mut x as *const usize;

  This was similarly inconsistent as we allow casting mut references to
  const pointers.

Existing test 'vector-cast-weirdness' updated to test both cases.

Fixes #24151

3 years agoRollup merge of #81012 - VillSnow:stabilize_partition_point, r=matklad
Dylan DPC [Fri, 12 Feb 2021 21:53:28 +0000 (22:53 +0100)]
Rollup merge of #81012 - VillSnow:stabilize_partition_point, r=matklad

Stabilize the partition_point feature

Stabilize the partition_point feature.
Tracking Issue: #73831
First PR: #73577

3 years agoRollup merge of #79775 - jyn514:doctest, r=GuillaumeGomez
Dylan DPC [Fri, 12 Feb 2021 21:53:21 +0000 (22:53 +0100)]
Rollup merge of #79775 - jyn514:doctest, r=GuillaumeGomez

Fix injected errors when running doctests on a crate named after a keyword

Closes https://github.com/rust-lang/rust/issues/79771

3 years agoAdd docs for shared_from_slice From impls
Michael Howell [Fri, 12 Feb 2021 20:24:35 +0000 (13:24 -0700)]
Add docs for shared_from_slice From impls

The advantage of making these docs is mostly in pointing out that these
functions all make new allocations and copy/clone/move the source into them.

These docs are on the function, and not the `impl` block, to avoid showing
the "[+] show undocumented items" button.

CC #51430

3 years agoUse raw ref macros as in #80886
Stein Somers [Thu, 4 Feb 2021 15:11:30 +0000 (16:11 +0100)]
Use raw ref macros as in #80886

3 years agoInitialize BTree nodes directly in the heap
Josh Stone [Fri, 29 Jan 2021 01:43:59 +0000 (17:43 -0800)]
Initialize BTree nodes directly in the heap

3 years agoAdd test to prevent src link regression
Guillaume Gomez [Fri, 12 Feb 2021 19:27:57 +0000 (20:27 +0100)]
Add test to prevent src link regression

3 years agoAuto merge of #81744 - rylev:overlapping-early-exit2, r=lcnr
bors [Fri, 12 Feb 2021 17:38:15 +0000 (17:38 +0000)]
Auto merge of #81744 - rylev:overlapping-early-exit2, r=lcnr

Try fast_reject::simplify_type in coherence before doing full check

This is a reattempt at landing #69010 (by `@jonas-schievink).` The change adds a fast path for coherence checking to see if there's no way for types to unify since full coherence checking can be somewhat expensive.

This has big effects on code generated by the [`windows`](https://github.com/microsoft/windows-rs) which in some cases spends as much as 20% of compilation time in the `specialization_graph_of` query. In local benchmarks this took a compilation that previously took ~500 seconds down to ~380 seconds.

This is surely not going to make a difference on much smaller crates, so the question is whether it will have a negative impact. #69010 was closed because some of the perf suite crates did show small regressions.

Additional discussion of this issue is happening [here](https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/windows-rs.20perf).

3 years agoRename to `inline_attr` and use if-let to extract `NestedMetaItem`
Yusuke Tanaka [Fri, 12 Feb 2021 16:48:00 +0000 (01:48 +0900)]
Rename to `inline_attr` and use if-let to extract `NestedMetaItem`

3 years agoDon't check self type twice
Ryan Levick [Fri, 12 Feb 2021 16:30:39 +0000 (17:30 +0100)]
Don't check self type twice

3 years agoSwitch boolean checks
Ryan Levick [Fri, 12 Feb 2021 16:22:19 +0000 (17:22 +0100)]
Switch boolean checks

3 years agoRefactor `get_word_attr` to return only `Option`
Yusuke Tanaka [Fri, 12 Feb 2021 16:13:50 +0000 (01:13 +0900)]
Refactor `get_word_attr` to return only `Option`

3 years agoAuto merge of #82025 - JohnTitor:rollup-cohp0gy, r=JohnTitor
bors [Fri, 12 Feb 2021 14:40:27 +0000 (14:40 +0000)]
Auto merge of #82025 - JohnTitor:rollup-cohp0gy, r=JohnTitor

Rollup of 16 pull requests

Successful merges:

 - #79983 (fix indefinite article in cell.rs)
 - #81831 (Don't display `mut` in arguments for functions documentation)
 - #81947 (Relax ItemCtxt::to_ty lifetime)
 - #81954 (RELEASES.md 1.50: Group platform support notes together)
 - #81955 (bootstrap: Locate llvm-dwp based on llvm-config bindir)
 - #81959 (Fix assosiated typo)
 - #81964 (Fix documentation not showing on localStorage error)
 - #81968 (bootstrap: fix wrong docs installation path)
 - #81990 (Make suggestion of changing mutability of arguments broader)
 - #81994 (Improve long explanation for E0542 and E0546)
 - #81997 (dist: include src/build_helper as part of the crate graph for rustc-dev)
 - #82003 (Stack probes: fix error message)
 - #82004 (clean up clean::Static struct)
 - #82011 (Fix private intra-doc warnings on associated items)
 - #82013 (Tell user how to fix CI file being not up to date)
 - #82017 (Fix typo in mod.rs)

Failed merges:

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

3 years agoDrop an unnecessary intermediate variable
LingMan [Fri, 12 Feb 2021 13:08:14 +0000 (14:08 +0100)]
Drop an unnecessary intermediate variable

Neither does it shorten the code nor does it provide a helpful name.

3 years agoShort circuit full corherence check when dealing with types with different reference...
Ryan Levick [Fri, 12 Feb 2021 13:04:09 +0000 (14:04 +0100)]
Short circuit full corherence check when dealing with types with different reference mutability

3 years agoUse `Iterator::all` instead of open-coding it
LingMan [Fri, 12 Feb 2021 12:58:13 +0000 (13:58 +0100)]
Use `Iterator::all` instead of open-coding it

Shorter code and by initializing to the final value directly, the variable
doesn't need to be mut.

3 years agostabilize partition_point
VillSnow [Thu, 14 Jan 2021 14:36:33 +0000 (23:36 +0900)]
stabilize partition_point

3 years agoupdate documents
VillSnow [Sun, 31 Jan 2021 00:31:17 +0000 (09:31 +0900)]
update documents

3 years agoAdd nll test
0yoyoyo [Fri, 12 Feb 2021 12:51:00 +0000 (21:51 +0900)]
Add nll test

3 years agoRollup merge of #82017 - eltociear:patch-8, r=jyn514
Yuki Okushi [Fri, 12 Feb 2021 10:32:22 +0000 (19:32 +0900)]
Rollup merge of #82017 - eltociear:patch-8, r=jyn514

Fix typo in mod.rs

insted -> instead

3 years agoRollup merge of #82013 - Mark-Simulacrum:better-ci-error, r=jyn514
Yuki Okushi [Fri, 12 Feb 2021 10:32:21 +0000 (19:32 +0900)]
Rollup merge of #82013 - Mark-Simulacrum:better-ci-error, r=jyn514

Tell user how to fix CI file being not up to date

This hopefully should avoid future questions like in https://github.com/rust-lang/rust/pull/79979#issuecomment-776241356.

3 years agoRollup merge of #82011 - jyn514:warn-private-assoc-item, r=max-heller
Yuki Okushi [Fri, 12 Feb 2021 10:32:20 +0000 (19:32 +0900)]
Rollup merge of #82011 - jyn514:warn-private-assoc-item, r=max-heller

Fix private intra-doc warnings on associated items

The issue was that the `kind, id` override was previously only being
considered for the disambiguator check, not the privacy check. This uses
the same ID for both.

Fixes https://github.com/rust-lang/rust/issues/81981.

r? ``@max-heller``

3 years agoRollup merge of #82004 - GuillaumeGomez:clean-static-struct, r=jyn514
Yuki Okushi [Fri, 12 Feb 2021 10:32:18 +0000 (19:32 +0900)]
Rollup merge of #82004 - GuillaumeGomez:clean-static-struct, r=jyn514

clean up clean::Static struct

Having a `String` for the expression didn't make much sense, and even less when it's actually not used (except in json so I kept it).

r? ``@jyn514``

3 years agoRollup merge of #82003 - ojeda:stack-probe-msg, r=estebank
Yuki Okushi [Fri, 12 Feb 2021 10:32:17 +0000 (19:32 +0900)]
Rollup merge of #82003 - ojeda:stack-probe-msg, r=estebank

Stack probes: fix error message

3 years agoRollup merge of #81997 - bnjbvr:dist-include-build-helper, r=Mark-Simulacrum
Yuki Okushi [Fri, 12 Feb 2021 10:32:16 +0000 (19:32 +0900)]
Rollup merge of #81997 - bnjbvr:dist-include-build-helper, r=Mark-Simulacrum

dist: include src/build_helper as part of the crate graph for rustc-dev

The build_helper dependency is used to build the compiler/rustc_llvm build script.

Since it was missing, it wasn't possible to really use rustc-dev to
build, see for instance: https://github.com/rust-analyzer/rust-analyzer/issues/7589.

3 years agoRollup merge of #81994 - jesusprubio:improve-long-explanation-e0542-e0546, r=Guillaum...
Yuki Okushi [Fri, 12 Feb 2021 10:32:15 +0000 (19:32 +0900)]
Rollup merge of #81994 - jesusprubio:improve-long-explanation-e0542-e0546, r=GuillaumeGomez

Improve long explanation for E0542 and E0546

Helps with #61137

To keep the consistency with: https://github.com/rust-lang/rust/pull/81925

3 years agoRollup merge of #81990 - matsujika:suggest-mut-reference, r=estebank
Yuki Okushi [Fri, 12 Feb 2021 10:32:14 +0000 (19:32 +0900)]
Rollup merge of #81990 - matsujika:suggest-mut-reference, r=estebank

Make suggestion of changing mutability of arguments broader

Fix #81421

Previously rustc tries to emit the suggestion of changing mutablity unless `!trait_ref.has_infer_types_or_consts() && self.predicate_can_apply(obligation.param_env, trait_ref)` and this led to some false negatives to occur.

3 years agoRollup merge of #81968 - pietroalbini:fix-doc-install-path, r=Mark-Simulacrum
Yuki Okushi [Fri, 12 Feb 2021 10:32:13 +0000 (19:32 +0900)]
Rollup merge of #81968 - pietroalbini:fix-doc-install-path, r=Mark-Simulacrum

bootstrap: fix wrong docs installation path

This PR fixes https://github.com/rust-lang/rust/issues/81967, a regression introduced by https://github.com/rust-lang/rust/pull/80797. The commit has already been backported to stable 1.50.0.

r? ``````@Mark-Simulacrum``````

3 years agoRollup merge of #81964 - lovasoa:patch-1, r=GuillaumeGomez
Yuki Okushi [Fri, 12 Feb 2021 10:32:13 +0000 (19:32 +0900)]
Rollup merge of #81964 - lovasoa:patch-1, r=GuillaumeGomez

Fix documentation not showing on localStorage error

Fixes https://github.com/rust-lang/rust/issues/81928

The [documentation for setItem](https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem) specifies:

> developers should make sure to always catch possible exceptions from setItem()

3 years agoRollup merge of #81959 - therealprof:fix-typo, r=oli-obk
Yuki Okushi [Fri, 12 Feb 2021 10:32:12 +0000 (19:32 +0900)]
Rollup merge of #81959 - therealprof:fix-typo, r=oli-obk

Fix assosiated typo

Introduced in d3c4dbd85d63c8bdfa362d7cac8b3e8cbca51272, noticed only
after the fact, sorry. 😅

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
3 years agoRollup merge of #81955 - dtolnay:dwp, r=Mark-Simulacrum
Yuki Okushi [Fri, 12 Feb 2021 10:32:11 +0000 (19:32 +0900)]
Rollup merge of #81955 - dtolnay:dwp, r=Mark-Simulacrum

bootstrap: Locate llvm-dwp based on llvm-config bindir

Fixes #81949.

Tested by successfully building 1.50.0 pre-release, which is where I originally hit the issue (https://internals.rust-lang.org/t/rust-1-50-0-pre-release-testing/14012/4?u=dtolnay). Tested both with and without prebuilt LLVM. The check for dry_run is necessary in the non-prebuilt case because the llvm-config built by bootstrap won't exist yet.

3 years agoRollup merge of #81954 - joshtriplett:release-notes-group-platform-notes, r=XAMPPRocky
Yuki Okushi [Fri, 12 Feb 2021 10:32:09 +0000 (19:32 +0900)]
Rollup merge of #81954 - joshtriplett:release-notes-group-platform-notes, r=XAMPPRocky

RELEASES.md 1.50: Group platform support notes together

Move the note about dropping cloudabi next to the other platform support
changes.

3 years agoRollup merge of #81947 - camsteffen:to-ty, r=jyn514
Yuki Okushi [Fri, 12 Feb 2021 10:32:08 +0000 (19:32 +0900)]
Rollup merge of #81947 - camsteffen:to-ty, r=jyn514

Relax ItemCtxt::to_ty lifetime

Tiny simplification by relaxing a lifetime.

3 years agoRollup merge of #81831 - LeSeulArtichaut:81289-mut-arg, r=camelid
Yuki Okushi [Fri, 12 Feb 2021 10:32:07 +0000 (19:32 +0900)]
Rollup merge of #81831 - LeSeulArtichaut:81289-mut-arg, r=camelid

Don't display `mut` in arguments for functions documentation

Fixes #81289 by reverting #80799, as requested in https://github.com/rust-lang/rust/pull/81328#issuecomment-766364413.
Supersedes #81328.
r? ``@camelid`` cc ``@jyn514``

3 years agoRollup merge of #79983 - petar-dambovaliev:master, r=Dylan-DPC
Yuki Okushi [Fri, 12 Feb 2021 10:32:06 +0000 (19:32 +0900)]
Rollup merge of #79983 - petar-dambovaliev:master, r=Dylan-DPC

fix indefinite article in cell.rs

3 years agoRemove unnecessary lint allow attrs on example
Mikail Bagishov [Fri, 12 Feb 2021 09:46:02 +0000 (12:46 +0300)]
Remove unnecessary lint allow attrs on example

3 years agoPush a `char` instead of a `str` with len one into a String
LingMan [Fri, 12 Feb 2021 09:27:08 +0000 (10:27 +0100)]
Push a `char` instead of a `str` with len one into a String

3 years agoUpdate .stderr
Kevin Per [Fri, 12 Feb 2021 09:19:54 +0000 (09:19 +0000)]
Update .stderr

3 years agoImplementing more sophisticated filter for fn in const or static
Kevin Per [Wed, 10 Feb 2021 15:49:23 +0000 (15:49 +0000)]
Implementing more sophisticated filter for fn in const or static

3 years agofixup! Implement the precise analysis pass for lint `disjoint_capture_drop_reorder`
Aman Arora [Fri, 12 Feb 2021 09:07:41 +0000 (04:07 -0500)]
fixup! Implement the precise analysis pass for lint `disjoint_capture_drop_reorder`

3 years agoAuto merge of #81486 - ssomers:btree_separate_drop, r=Mark-Simulacrum
bors [Fri, 12 Feb 2021 06:34:21 +0000 (06:34 +0000)]
Auto merge of #81486 - ssomers:btree_separate_drop, r=Mark-Simulacrum

BTreeMap: disentangle Drop implementation from IntoIter

No longer require every `BTreeMap` to dig up its last leaf edge before dying. This speeds up the `clone_` benchmarks by 25% for normal keys and values (far less for huge values).

r? `@Mark-Simulacrum`

3 years agoFix typo in mod.rs
Ikko Ashimine [Fri, 12 Feb 2021 04:47:21 +0000 (13:47 +0900)]
Fix typo in mod.rs

insted -> instead

3 years agoTell user how to fix CI file being not up to date
Mark Rousskov [Fri, 12 Feb 2021 00:57:59 +0000 (19:57 -0500)]
Tell user how to fix CI file being not up to date

3 years agoFix private intra-doc warnings on associated items
Joshua Nelson [Fri, 12 Feb 2021 00:15:16 +0000 (19:15 -0500)]
Fix private intra-doc warnings on associated items

The issue was that the `kind, id` override was previously only being
considered for the disambiguator check, not the privacy check. This uses
the same ID for both.

3 years agoFix injected errors when running doctests on a crate named after a keyword
Joshua Nelson [Sun, 6 Dec 2020 22:56:01 +0000 (17:56 -0500)]
Fix injected errors when running doctests on a crate named after a keyword

Unfortunately, this can't currently be tested. The problem is that we
need the file to be compiled first to then be used as dependency, which
cannot be done currently unfortunately in the rustdoc test suites.
Example:

```rust
// name this file "foo.rs"

/// ```
/// let x = foo::foo();
/// ```
pub fn foo() {}
```

If you run `rustdoc --test foo.rs`, you'll get:

```
running 1 test
test foo.rs - foo (line 1) ... FAILED

failures:

---- foo.rs - foo (line 1) stdout ----
error[E0463]: can't find crate for `foo`
 --> foo.rs:0:1
  |
2 | extern crate foo;
  | ^^^^^^^^^^^^^^^^^ can't find crate
```

If a test were possible, it would look something like

 ````rust
 #![crate_name = "mod"]
 #![crate_type = "lib"]
 //! ```
 //! // NOTE: requires that the literal string 'mod' appears in the doctest for
 //! // the bug to appear
 //! assert_eq!(1, 1);
 //! ```
 ````

3 years agoRe-blessed the partial_eq.rs coverage test
Rich Kadel [Thu, 11 Feb 2021 22:11:08 +0000 (14:11 -0800)]
Re-blessed the partial_eq.rs coverage test

3 years agoSet SHELL = /bin/dash only if it exists
Rich Kadel [Sat, 6 Feb 2021 01:50:37 +0000 (17:50 -0800)]
Set SHELL = /bin/dash only if it exists

3 years agoEnsures `make` tests run under /bin/dash, like CI, and fixes a Makefile
Rich Kadel [Thu, 4 Feb 2021 00:26:25 +0000 (16:26 -0800)]
Ensures `make` tests run under /bin/dash, like CI, and fixes a Makefile

Updates `tools.mk` to explicitly require `SHELL := /bin/dash`, since CI
uses `dash` but other environments (including developer local machines)
may default to `bash`.

Replaces bash-specific shell command in one Makefile with a
dash-compatible alternative, and re-enables the affected Makefile test.

Removes apparently redundant definition of `UNAME`.

3 years agoclean up clean::Static struct
Guillaume Gomez [Thu, 11 Feb 2021 19:37:36 +0000 (20:37 +0100)]
clean up clean::Static struct