]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agodiagnostics: tweak error message to give more rationale to unsafe Fn
Michael Howell [Tue, 5 Apr 2022 18:13:48 +0000 (11:13 -0700)]
diagnostics: tweak error message to give more rationale to unsafe Fn

2 years agoFix bogus tidy errors
Michael Howell [Tue, 5 Apr 2022 00:54:20 +0000 (17:54 -0700)]
Fix bogus tidy errors

2 years agodiagnostics: give a special note for unsafe fn / Fn/FnOnce/FnMut
Michael Howell [Tue, 5 Apr 2022 00:37:59 +0000 (17:37 -0700)]
diagnostics: give a special note for unsafe fn / Fn/FnOnce/FnMut

Fixes #90073

2 years agoAuto merge of #95653 - Dylan-DPC:rollup-2p9hzi3, r=Dylan-DPC
bors [Mon, 4 Apr 2022 19:51:52 +0000 (19:51 +0000)]
Auto merge of #95653 - Dylan-DPC:rollup-2p9hzi3, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #92942 (stabilize windows_process_extensions_raw_arg)
 - #94817 (Release notes for 1.60.0)
 - #95343 (Reduce unnecessary escaping in proc_macro::Literal::character/string)
 - #95431 (Stabilize total_cmp)
 - #95438 (Add SyncUnsafeCell.)
 - #95467 (Windows: Synchronize asynchronous pipe reads and writes)
 - #95609 (Suggest borrowing when trying to coerce unsized type into `dyn Trait`)

Failed merges:

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

2 years agoRollup merge of #95609 - compiler-errors:borrow-unsized-to-dyn, r=nagisa
Dylan DPC [Mon, 4 Apr 2022 18:41:34 +0000 (20:41 +0200)]
Rollup merge of #95609 - compiler-errors:borrow-unsized-to-dyn, r=nagisa

Suggest borrowing when trying to coerce unsized type into `dyn Trait`

A helpful error in response to #95598, since we can't coerce e.g. `&str` into `&dyn Display`, but we can coerce `&&str` into `&dyn Display` :)

Not sure if the suggestion message needs some help. Let me know, and I can refine this PR.

2 years agoRollup merge of #95467 - ChrisDenton:async-read-pipe, r=joshtriplett
Dylan DPC [Mon, 4 Apr 2022 18:41:33 +0000 (20:41 +0200)]
Rollup merge of #95467 - ChrisDenton:async-read-pipe, r=joshtriplett

Windows: Synchronize asynchronous pipe reads and writes

On Windows, the pipes used for spawned processes are opened for asynchronous access but `read` and `write` are done using the standard methods that assume synchronous access. This means that the buffer (and variables on the stack) may be read/written to after the function returns.

This PR ensures reads/writes complete before returning. Note that this only applies to pipes we create and does not affect the standard file read/write methods.

Fixes #95411

2 years agoRollup merge of #95438 - m-ou-se:sync-unsafe-cell, r=joshtriplett
Dylan DPC [Mon, 4 Apr 2022 18:41:32 +0000 (20:41 +0200)]
Rollup merge of #95438 - m-ou-se:sync-unsafe-cell, r=joshtriplett

Add SyncUnsafeCell.

This adds `SyncUnsafeCell`, which is just `UnsafeCell` except it implements `Sync`.

This was first proposed under the name `RacyUnsafeCell` here: https://github.com/rust-lang/rust/issues/53639#issuecomment-415515748 and here: https://github.com/rust-lang/rust/issues/53639#issuecomment-432741659 and here: https://github.com/rust-lang/rust/issues/53639#issuecomment-888435728

It allows you to create an UnsafeCell that is Sync without having to wrap it in a struct first (and then implement Sync for that struct).

E.g. `static X: SyncUnsafeCell<i32>`. Using a regular `UnsafeCell` as `static` is not possible, because it isn't `Sync`. We have a language workaround for it called `static mut`, but it's nice to be able to use the proper type for such unsafety instead.

It also makes implementing synchronization primitives based on unsafe cells slightly less verbose, because by using `SyncUnsafeCell` for `UnsafeCell`s that are shared between threads, you don't need a separate `impl<..> Sync for ..`. Using this type also clearly documents that the cell is expected to be accessed from multiple threads.

2 years agoRollup merge of #95431 - golddranks:stabilize_total_cmp, r=scottmcm
Dylan DPC [Mon, 4 Apr 2022 18:41:31 +0000 (20:41 +0200)]
Rollup merge of #95431 - golddranks:stabilize_total_cmp, r=scottmcm

Stabilize total_cmp

Stabilises `total_cmp` for Rust 1.61.0. Tracking issue: https://github.com/rust-lang/rust/issues/72599

2 years agoRollup merge of #95343 - dtolnay:literals, r=petrochenkov
Dylan DPC [Mon, 4 Apr 2022 18:41:30 +0000 (20:41 +0200)]
Rollup merge of #95343 - dtolnay:literals, r=petrochenkov

Reduce unnecessary escaping in proc_macro::Literal::character/string

I noticed that https://doc.rust-lang.org/proc_macro/struct.Literal.html#method.character is producing unreadable literals that make macro-expanded code unnecessarily hard to read. Since the proc macro server was using `escape_unicode()`, every char is escaped using `\u{…}` regardless of whether there is any need to do so. For example `Literal::character('=')` would previously produce `'\u{3d}'` which unnecessarily obscures the meaning when reading the macro-expanded code.

I've changed Literal::string also in this PR because `str`'s `Debug` impl is also smarter than just calling `escape_debug` on every char. For example `Literal::string("ferris's")` would previously produce `"ferris\'s"` but will now produce `"ferris's"`.

2 years agoRollup merge of #94817 - cuviper:relnotes-1.60.0, r=pietroalbini,m-ou-se
Dylan DPC [Mon, 4 Apr 2022 18:41:28 +0000 (20:41 +0200)]
Rollup merge of #94817 - cuviper:relnotes-1.60.0, r=pietroalbini,m-ou-se

Release notes for 1.60.0

2 years agoRollup merge of #92942 - Xaeroxe:raw_arg, r=dtolnay
Dylan DPC [Mon, 4 Apr 2022 18:41:27 +0000 (20:41 +0200)]
Rollup merge of #92942 - Xaeroxe:raw_arg, r=dtolnay

stabilize windows_process_extensions_raw_arg

Stabilizes the feature tracked at https://github.com/rust-lang/rust/issues/92939

2 years agoCorrect calling convention
Chris Denton [Mon, 4 Apr 2022 18:37:11 +0000 (19:37 +0100)]
Correct calling convention

2 years agoAuto merge of #95555 - nnethercote:parse_tt-new-representation, r=petrochenkov
bors [Mon, 4 Apr 2022 17:27:48 +0000 (17:27 +0000)]
Auto merge of #95555 - nnethercote:parse_tt-new-representation, r=petrochenkov

A new matcher representation for use in `parse_tt`

By transforming the matcher into a different form, `parse_tt` can run faster and be easier to understand.

r? `@petrochenkov`

2 years agoBump windows CommandExt::raw_arg to 1.62
David Tolnay [Mon, 4 Apr 2022 17:15:28 +0000 (10:15 -0700)]
Bump windows CommandExt::raw_arg to 1.62

2 years agoAuto merge of #95119 - OliverMD:method_suggestions, r=davidtwco
bors [Mon, 4 Apr 2022 13:00:25 +0000 (13:00 +0000)]
Auto merge of #95119 - OliverMD:method_suggestions, r=davidtwco

Improve method name suggestions

Attempts to improve method name suggestions when a matching method name
is not found. The approach taken is use the Levenshtein distance and
account for substrings having a high distance but can sometimes be very
close to the intended method (eg. empty vs is_empty).

resolves #94747

2 years agoStabilize total_cmp
Pyry Kontio [Tue, 29 Mar 2022 12:43:24 +0000 (21:43 +0900)]
Stabilize total_cmp

2 years agoimprove 92630 wording
Pietro Albini [Mon, 4 Apr 2022 08:38:41 +0000 (10:38 +0200)]
improve 92630 wording

2 years agoadd compat note about instant changes
Pietro Albini [Mon, 4 Apr 2022 08:33:21 +0000 (10:33 +0200)]
add compat note about instant changes

2 years agoadd future compatibility notes for linux-gnu baseline bump
Pietro Albini [Mon, 4 Apr 2022 08:13:21 +0000 (10:13 +0200)]
add future compatibility notes for linux-gnu baseline bump

2 years agoreword the docs on tier 2 platforms docs
Pietro Albini [Mon, 4 Apr 2022 08:09:57 +0000 (10:09 +0200)]
reword the docs on tier 2 platforms docs

2 years agomove 2021 libs to internal changes
Pietro Albini [Mon, 4 Apr 2022 07:48:56 +0000 (09:48 +0200)]
move 2021 libs to internal changes

2 years agolink target tier policy to new targets
Pietro Albini [Mon, 4 Apr 2022 07:48:20 +0000 (09:48 +0200)]
link target tier policy to new targets

2 years agoAuto merge of #95636 - pietroalbini:pa-version-1.62.0, r=pietroalbini
bors [Mon, 4 Apr 2022 07:22:34 +0000 (07:22 +0000)]
Auto merge of #95636 - pietroalbini:pa-version-1.62.0, r=pietroalbini

Bump version number to 1.62.0

2 years agobump version to 1.62.0
Pietro Albini [Mon, 4 Apr 2022 07:21:03 +0000 (09:21 +0200)]
bump version to 1.62.0

2 years agoReorder match arms in `parse_tt_inner`.
Nicholas Nethercote [Mon, 4 Apr 2022 05:47:53 +0000 (15:47 +1000)]
Reorder match arms in `parse_tt_inner`.

To match the order the variants are declared in.

2 years agoA new matcher representation for use in `parse_tt`.
Nicholas Nethercote [Thu, 31 Mar 2022 23:19:16 +0000 (10:19 +1100)]
A new matcher representation for use in `parse_tt`.

`parse_tt` currently traverses a `&[TokenTree]` to do matching. But this
is a bad representation for the traversal.
- `TokenTree` is nested, and there's a bunch of expensive and fiddly
  state required to handle entering and exiting nested submatchers.
- There are three positions (sequence separators, sequence Kleene ops,
  and end of the matcher) that are represented by an index that exceeds
  the end of the `&[TokenTree]`, which is clumsy and error-prone.

This commit introduces a new representation called `MatcherLoc` that is
designed specifically for matching. It fixes all the above problems,
making the code much easier to read. A `&[TokenTree]` is converted to a
`&[MatcherLoc]` before matching begins. Despite the cost of the
conversion, it's still a net performance win, because various pieces of
traversal state are computed once up-front, rather than having to be
recomputed repeatedly during the macro matching.

Some improvements worth noting.
- `parse_tt_inner` is *much* easier to read. No more having to compare
  `idx` against `len` and read comments to understand what the result
  means.
- The handling of `Delimited` in `parse_tt_inner` is now trivial.
- The three end-of-sequence cases in `parse_tt_inner` are now handled in
  three separate match arms, and the control flow is much simpler.
- `nameize` is no longer recursive.
- There were two places that issued "missing fragment specifier" errors:
  one in `parse_tt_inner()`, and one in `nameize()`. Presumably the
  latter was never executed. There's now a single place issuing these
  errors, in `compute_locs()`.
- The number of heap allocations done for a `check full` build of
  `async-std-1.10.0` (an extreme example of heavy macro use) drops from
  11.8M to 2.6M, and most of these occur outside of macro matching.
- The size of `MatcherPos` drops from 64 bytes to 16 bytes. Small enough
  that it no longer needs boxing, which partly accounts for the
  reduction in allocations.
- The rest of the drop in allocations is due to the removal of
  `MatcherKind`, because we no longer need to record anything for the
  parent matcher when entering a submatcher.
- Overall it reduces code size by 45 lines.

2 years agoUpdate library/std/src/sys/windows/pipe.rs
Chris Denton [Mon, 4 Apr 2022 04:59:51 +0000 (05:59 +0100)]
Update library/std/src/sys/windows/pipe.rs

2 years agoAuto merge of #95031 - compiler-errors:param-env-cache, r=Aaron1011
bors [Mon, 4 Apr 2022 04:48:36 +0000 (04:48 +0000)]
Auto merge of #95031 - compiler-errors:param-env-cache, r=Aaron1011

Do not use `ParamEnv::and` when building a cache key from a param-env and trait eval candidate

Do not use `ParamEnv::and` to cache a param-env with a selection/evaluation candidate.

This is because if the param-env is `RevealAll` mode, and the candidate looks global (i.e. it has erased regions, which can show up when we normalize a projection type under a binder<sup>1</sup>), then when we use `ParamEnv::and` to pair the candidate and the param-env for use as a cache key, we will throw away the param-env's caller bounds, and we'll end up caching a candidate that we inferred from the param-env with a empty param-env, which may cause cache-hit later when we have an empty param-env, and possibly mess with normalization like we see in the referenced issue during codegen.

Not sure how to trigger this with a more structured test, but changing `check-pass` to `build-pass` triggers the case that https://github.com/rust-lang/rust/issues/94903 detected.

<sup>1.</sup> That is, we will replace the late-bound region with a placeholder, which gets canonicalized and turned into an infererence variable, which gets erased during region freshening right before we cache the result. Sorry, it's quite a few steps.

Fixes #94903
r? `@Aaron1011` (or reassign as you see fit)

2 years agoAuto merge of #95606 - petrochenkov:linkregr, r=wesleywiser
bors [Mon, 4 Apr 2022 02:23:15 +0000 (02:23 +0000)]
Auto merge of #95606 - petrochenkov:linkregr, r=wesleywiser

linker: Implicitly link native libs as whole-archive in some more cases

Partially revert changes from https://github.com/rust-lang/rust/pull/93901 to address regressions like https://github.com/rust-lang/rust/issues/95561.

Fixes https://github.com/rust-lang/rust/issues/95561
r? `@wesleywiser`

2 years agoAuto merge of #95619 - bjorn3:inline_location_caller, r=scottmcm
bors [Sun, 3 Apr 2022 23:42:31 +0000 (23:42 +0000)]
Auto merge of #95619 - bjorn3:inline_location_caller, r=scottmcm

Mark Location::caller() as #[inline]

This function gets compiled to a single register move as it actually gets it's return value passed in as argument.

2 years agoAuto merge of #95624 - Dylan-DPC:rollup-r8w7ui3, r=Dylan-DPC
bors [Sun, 3 Apr 2022 21:22:50 +0000 (21:22 +0000)]
Auto merge of #95624 - Dylan-DPC:rollup-r8w7ui3, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #95202 (Reduce the cost of loading all built-ins targets)
 - #95553 (Don't emit non-asm contents error for naked function composed of errors)
 - #95613 (Fix rustdoc attribute display)
 - #95617 (Fix &mut invalidation in ptr::swap doctest)
 - #95618 (core: document that the align_of* functions return the alignment in bytes)

Failed merges:

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

2 years agoRollup merge of #95618 - adamse:master, r=dtolnay
Dylan DPC [Sun, 3 Apr 2022 21:21:45 +0000 (23:21 +0200)]
Rollup merge of #95618 - adamse:master, r=dtolnay

core: document that the align_of* functions return the alignment in bytes

2 years agoRollup merge of #95617 - saethlin:swap-test-invalidation, r=Dylan-DPC
Dylan DPC [Sun, 3 Apr 2022 21:21:43 +0000 (23:21 +0200)]
Rollup merge of #95617 - saethlin:swap-test-invalidation, r=Dylan-DPC

Fix &mut invalidation in ptr::swap doctest

Under Stacked Borrows with raw pointer tagging, the previous code was UB
because the code which creates the the second pointer borrows the array
through a tag in the borrow stacks below the Unique tag that our first
pointer is based on, thus invalidating the first pointer.

This is not definitely a bug and may never be real UB, but I desperately
want people to write code that conforms to SB with raw pointer tagging
so that I can write good diagnostics. The alternative aliasing models
aren't possible to diagnose well due to state space explosion.
Therefore, it would be super cool if the standard library nudged people
towards writing code that is valid with respect to SB with raw pointer
tagging.

The diagnostics that I want to write are implemented in a branch of Miri and the one for this case is below:
```
error: Undefined Behavior: attempting a read access using <2170> at alloc1068[0x0], but that tag does not exist in the borrow stack for this location
    --> /home/ben/rust/library/core/src/intrinsics.rs:2103:14
     |
2103 |     unsafe { copy_nonoverlapping(src, dst, count) }
     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |              |
     |              attempting a read access using <2170> at alloc1068[0x0], but that tag does not exist in the borrow stack for this location
     |              this error occurs as part of an access at alloc1068[0x0..0x8]
     |
     = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
     = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <2170> was created due to a retag at offsets [0x0..0x10]
    --> ../libcore/src/ptr/mod.rs:640:9
     |
8    | let x = array[0..].as_mut_ptr() as *mut [u32; 2]; // this is `array[0..2]`
     |         ^^^^^^^^^^^^^^^^^^^^^^^
help: <2170> was later invalidated due to a retag at offsets [0x0..0x10]
    --> ../libcore/src/ptr/mod.rs:641:9
     |
9    | let y = array[2..].as_mut_ptr() as *mut [u32; 2]; // this is `array[2..4]`
     |         ^^^^^
     = note: inside `std::intrinsics::copy_nonoverlapping::<[u32; 2]>` at /home/ben/rust/library/core/src/intrinsics.rs:2103:14
     = note: inside `std::ptr::swap::<[u32; 2]>` at /home/ben/rust/library/core/src/ptr/mod.rs:685:9
note: inside `main::_doctest_main____libcore_src_ptr_mod_rs_635_0` at ../libcore/src/ptr/mod.rs:12:5
    --> ../libcore/src/ptr/mod.rs:644:5
     |
12   |     ptr::swap(x, y);
     |     ^^^^^^^^^^^^^^^
note: inside `main` at ../libcore/src/ptr/mod.rs:15:3
    --> ../libcore/src/ptr/mod.rs:647:3
     |
15   | } _doctest_main____libcore_src_ptr_mod_rs_635_0() }
     |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

error: aborting due to previous error
```

2 years agoRollup merge of #95613 - GuillaumeGomez:fix-rustdoc-attr-display, r=notriddle
Dylan DPC [Sun, 3 Apr 2022 21:21:43 +0000 (23:21 +0200)]
Rollup merge of #95613 - GuillaumeGomez:fix-rustdoc-attr-display, r=notriddle

Fix rustdoc attribute display

Fixes #81482.

r? `@notriddle`

2 years agoRollup merge of #95553 - jam1garner:naked-function-compile-error, r=tmiasko
Dylan DPC [Sun, 3 Apr 2022 21:21:42 +0000 (23:21 +0200)]
Rollup merge of #95553 - jam1garner:naked-function-compile-error, r=tmiasko

Don't emit non-asm contents error for naked function composed of errors

## Motivation

For naked functions an error is emitted when they are composed of anything other than a single asm!() block. However, this error triggers in a couple situations in which it adds no additional information or is actively misleading.

One example is if you do have an asm!() block but simply one with a syntax error:
```rust
#[naked]
unsafe extern "C" fn compiler_errors() {
    asm!(invalid_syntax)
}
```

This results in two errors, one for the syntax error itself and another telling you that you need an asm block in your function:

```rust
error[E0787]: naked functions must contain a single asm block
 --> src/main.rs:6:1
  |
6 | / unsafe extern "C" fn naked_compile_error() {
7 | |     asm!(blah)
8 | | }
  | |_^
```

This issue also comes up when [utilizing `compile_error!()` for improving your diagnostics](https://twitter.com/steveklabnik/status/1509538243020218372), such as raising a compiler error when compiling for an unsupported target.

## Implementation

The rules this PR implements are as follows:

1. If any non-erroneous  non-asm statement is included, an error will still occur
2. If multiple asm statements are included, an error will still occur
3. If 0 or 1 asm statements are present, as well as any non-zero number of erroneous statements, then this error will *not* be raised as it is likely either redundant or incorrect

The rule of thumb is effectively "if an error is present and its correction could change things, don't raise an error".

2 years agoRollup merge of #95202 - Urgau:check-cfg-perf-well-known-values, r=petrochenkov
Dylan DPC [Sun, 3 Apr 2022 21:21:41 +0000 (23:21 +0200)]
Rollup merge of #95202 - Urgau:check-cfg-perf-well-known-values, r=petrochenkov

Reduce the cost of loading all built-ins targets

This PR started by measuring the exact slowdown of checking of well known conditional values.
Than this PR implemented some technics to reduce the cost of loading all built-ins targets.

cf. https://github.com/rust-lang/rust/issues/82450#issuecomment-1073992323

2 years agoFix &mut invalidation in ptr::swap doctest
Ben Kimock [Sun, 3 Apr 2022 17:23:27 +0000 (13:23 -0400)]
Fix &mut invalidation in ptr::swap doctest

Under Stacked Borrows with raw pointer tagging, the previous code was UB
because the code which creates the the second pointer borrows the array
through a tag in the borrow stacks below the Unique tag that our first
pointer is based on, thus invalidating the first pointer.

This is not definitely a bug and may never be real UB, but I desperately
want people to write code that conforms to SB with raw pointer tagging
so that I can write good diagnostics. The alternative aliasing models
aren't possible to diagnose well due to state space explosion.
Therefore, it would be super cool if the standard library nudged people
towards writing code that is valid with respect to SB with raw pointer
tagging.

2 years agoCleanup after some refactoring in rustc_target
Loïc BRANSTETT [Sun, 3 Apr 2022 16:42:39 +0000 (18:42 +0200)]
Cleanup after some refactoring in rustc_target

2 years agoReplace LinkArgs with Cow<'static, str>
Loïc BRANSTETT [Mon, 28 Mar 2022 13:06:46 +0000 (15:06 +0200)]
Replace LinkArgs with Cow<'static, str>

2 years agoReplace every Vec in Target(Options) with it's Cow equivalent
Loïc BRANSTETT [Sun, 27 Mar 2022 23:08:17 +0000 (01:08 +0200)]
Replace every Vec in Target(Options) with it's Cow equivalent

2 years agoReplace every `String` in Target(Options) with `Cow<'static, str>`
Loïc BRANSTETT [Tue, 22 Mar 2022 10:43:05 +0000 (11:43 +0100)]
Replace every `String` in Target(Options) with `Cow<'static, str>`

2 years agoAuto merge of #95610 - createyourpersonalaccount:derefmut-docfix, r=Dylan-DPC
bors [Sun, 3 Apr 2022 19:06:20 +0000 (19:06 +0000)]
Auto merge of #95610 - createyourpersonalaccount:derefmut-docfix, r=Dylan-DPC

Improve doc example of DerefMut

It is more illustrative, after using `*x` to modify the field, to show
in the assertion that the field has indeed been modified.

2 years agoMark Location::caller() as #[inline]
bjorn3 [Sun, 3 Apr 2022 18:27:54 +0000 (20:27 +0200)]
Mark Location::caller() as #[inline]

This function gets compiled to a single register move as it actually
gets it's return value passed in as argument.

2 years agocore: document that the align_of* functions return the alignment in bytes
Adam Sandberg Ericsson [Sun, 3 Apr 2022 18:03:34 +0000 (19:03 +0100)]
core: document that the align_of* functions return the alignment in bytes

2 years agoAuto merge of #92686 - saethlin:unsafe-debug-asserts, r=Amanieu
bors [Sun, 3 Apr 2022 16:04:47 +0000 (16:04 +0000)]
Auto merge of #92686 - saethlin:unsafe-debug-asserts, r=Amanieu

Add debug assertions to some unsafe functions

As suggested by https://github.com/rust-lang/rust/issues/51713

~~Some similar code calls `abort()` instead of `panic!()` but aborting doesn't work in a `const fn`, and the intrinsic for doing dispatch based on whether execution is in a const is unstable.~~

This picked up some invalid uses of `get_unchecked` in the compiler, and fixes them.

I can confirm that they do in fact pick up invalid uses of `get_unchecked` in the wild, though the user experience is less-than-awesome:
```
     Running unittests (target/x86_64-unknown-linux-gnu/debug/deps/rle_decode_fast-04b7918da2001b50)

running 6 tests
error: test failed, to rerun pass '--lib'

Caused by:
  process didn't exit successfully: `/home/ben/rle-decode-helper/target/x86_64-unknown-linux-gnu/debug/deps/rle_decode_fast-04b7918da2001b50` (signal: 4, SIGILL: illegal instruction)
```

~~As best I can tell these changes produce a 6% regression in the runtime of `./x.py test` when `[rust] debug = true` is set.~~
Latest commit (https://github.com/rust-lang/rust/pull/92686/commits/6894d559bdb4365243b3f4bf73f18e4b1bed04d1) brings the additional overhead from this PR down to 0.5%, while also adding a few more assertions. I think this actually covers all the places in `core` that it is reasonable to check for safety requirements at runtime.

Thoughts?

2 years agoImprove method name suggestions
Oliver Downard [Mon, 14 Mar 2022 21:07:19 +0000 (21:07 +0000)]
Improve method name suggestions

Attempts to improve method name suggestions when a matching method name
is not found. The approach taken is use the Levenshtein distance and
account for substrings having a high distance but can sometimes be very
close to the intended method (eg. empty vs is_empty).

2 years agoAdd test for attribute display in rustdoc
Guillaume Gomez [Sun, 3 Apr 2022 11:41:12 +0000 (13:41 +0200)]
Add test for attribute display in rustdoc

2 years agoFix display of attributes in rustdoc
Guillaume Gomez [Sun, 3 Apr 2022 11:40:43 +0000 (13:40 +0200)]
Fix display of attributes in rustdoc

2 years agoAuto merge of #90791 - drmorr0:drmorr-memcmp-cint-cfg, r=petrochenkov
bors [Sun, 3 Apr 2022 11:16:22 +0000 (11:16 +0000)]
Auto merge of #90791 - drmorr0:drmorr-memcmp-cint-cfg, r=petrochenkov

make memcmp return a value of c_int_width instead of i32

This is an attempt to fix #32610 and #78022, namely, that `memcmp` always returns an `i32` regardless of the platform.  I'm running into some issues and was hoping I could get some help.

Here's what I've been attempting so far:

1. Build the stage0 compiler with all the changes _expect_ for the changes in `library/core/src/slice/cmp.rs` and `compiler/rustc_codegen_llvm/src/context.rs`; this is because `target_c_int_width` isn't passed through and recognized as a valid config option yet.  I'm building with `./x.py build --stage 0 library/core library/proc_macro compiler/rustc`
2. Next I add in the `#[cfg(c_int_width = ...)]` params to `cmp.rs` and `context.rs` and build the stage 1 compiler by running `./x.py build --keep-stage 0 --stage 1 library/core library/proc_macro compiler/rustc`.  This step now runs successfully.
3. Lastly, I try to build the test program for AVR mentioned in #78022 with `RUSTFLAGS="--emit llvm-ir" cargo build --release`, and look at the resulting llvm IR, which still shows:

```
...
%11 = call addrspace(1) i32 `@memcmp(i8*` nonnull %5, i8* nonnull %10, i16 5) #7, !dbg !1191                                                                                                                                                                                                                                %.not = icmp eq i32 %11, 0, !dbg !1191
...
; Function Attrs: nounwind optsize                                                                                                                                                                                                                                                                                          declare i32 `@memcmp(i8*,` i8*, i16) local_unnamed_addr addrspace(1) #4
```

Any ideas what I'm missing here?  Alternately, if this is totally the wrong approach I'm open to other suggestions.

cc `@Rahix`

2 years agoAuto merge of #85321 - cjgillot:mir-cycle, r=bjorn3
bors [Sun, 3 Apr 2022 07:53:10 +0000 (07:53 +0000)]
Auto merge of #85321 - cjgillot:mir-cycle, r=bjorn3

Use DefPathHash instead of HirId to break inlining cycles.

The `DefPathHash` is stable across incremental compilation sessions, so provides a total order on `LocalDefId`. Using it instead of `HirId` ensures the MIR inliner has the same behaviour for incremental and non-incremental compilation.

A downside is that the cycle tie break is not as predictable is with `HirId`.

2 years agoAuto merge of #88672 - camelid:inc-parser-sugg, r=davidtwco
bors [Sun, 3 Apr 2022 05:24:20 +0000 (05:24 +0000)]
Auto merge of #88672 - camelid:inc-parser-sugg, r=davidtwco

Suggest `i += 1` when we see `i++` or `++i`

Closes #83502 (for `i++` and `++i`; `--i` should be covered by #82987, and `i--`
is tricky to handle).

This is a continuation of #83536.

r? `@estebank`

2 years agoImprove doc example of DerefMut
Nikolaos Chatzikonstantinou [Sun, 3 Apr 2022 03:42:19 +0000 (12:42 +0900)]
Improve doc example of DerefMut

It is more illustrative, after using `*x` to modify the field, to show
in the assertion that the field has indeed been modified.

2 years agomake memcmp return a value of c_int_width instead of i32
David Morrison [Thu, 11 Nov 2021 04:14:23 +0000 (20:14 -0800)]
make memcmp return a value of c_int_width instead of i32

2 years agoSuggest borrowing when trying to coerce unsized type into dyn Trait
Michael Goulet [Sat, 2 Apr 2022 23:43:17 +0000 (16:43 -0700)]
Suggest borrowing when trying to coerce unsized type into dyn Trait

2 years agoAuto merge of #95590 - GuillaumeGomez:multi-line-attr-handling-doctest, r=notriddle
bors [Sat, 2 Apr 2022 23:39:25 +0000 (23:39 +0000)]
Auto merge of #95590 - GuillaumeGomez:multi-line-attr-handling-doctest, r=notriddle

Fix multiline attributes handling in doctests

Fixes #55713.

I needed to have access to the `unclosed_delims` field in order to check that the attribute was completely parsed and didn't have missing parts, so I created a getter for it.

r? `@notriddle`

2 years agolinker: Implicitly link native libs as whole-archive in some more cases
Vadim Petrochenkov [Sat, 2 Apr 2022 11:31:34 +0000 (14:31 +0300)]
linker: Implicitly link native libs as whole-archive in some more cases

2 years agoLess manipulation of the callee_def_id.
Camille GILLOT [Sat, 2 Apr 2022 21:28:09 +0000 (23:28 +0200)]
Less manipulation of the callee_def_id.

2 years agoUse only local hash.
Camille GILLOT [Mon, 17 May 2021 19:07:42 +0000 (21:07 +0200)]
Use only local hash.

2 years agoUse DefPathHash instead of HirId to break cycles.
Camille GILLOT [Thu, 13 May 2021 07:28:56 +0000 (09:28 +0200)]
Use DefPathHash instead of HirId to break cycles.

2 years agoAuto merge of #95600 - Dylan-DPC:rollup-580y2ra, r=Dylan-DPC
bors [Sat, 2 Apr 2022 20:58:33 +0000 (20:58 +0000)]
Auto merge of #95600 - Dylan-DPC:rollup-580y2ra, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #95587 (Remove need for associated_type_bounds in std.)
 - #95589 (Include a header in .rlink files)
 - #95593 (diagnostics: add test case for bogus T:Sized suggestion)
 - #95597 (Refer to u8 by absolute path in expansion of thread_local)

Failed merges:

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

2 years agoRollup merge of #95597 - dtolnay:threadlocalu8, r=Dylan-DPC
Dylan DPC [Sat, 2 Apr 2022 20:38:22 +0000 (22:38 +0200)]
Rollup merge of #95597 - dtolnay:threadlocalu8, r=Dylan-DPC

Refer to u8 by absolute path in expansion of thread_local

The standard library's `thread_local!` macro previously referred to `u8` just as `u8`, resolving to whatever `u8` existed in the type namespace at the call site. This PR replaces those with `$crate::primitive::u8` which always refers to `std::primitive::u8` regardless of what's in scope at the call site. Unambiguously naming primitives inside macro-generated code is the reason that std::primitive was introduced in the first place.

<details>
<summary>Here is the error message prior to this PR ⬇️</summary>

```console
error[E0308]: mismatched types
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | |_^ expected struct `u8`, found integer
  |
  = note: this error originates in the macro `$crate::__thread_local_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | | ^
  | | |
  | |_expected struct `u8`, found integer
  |   this expression has type `u8`
  |
  = note: this error originates in the macro `$crate::__thread_local_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | |_^ expected `u8`, found struct `u8`
  |
  = note: expected raw pointer `*mut u8` (`u8`)
             found raw pointer `*mut u8` (struct `u8`)
  = note: this error originates in the macro `$crate::__thread_local_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | |_^ expected `u8`, found struct `u8`
  |
  = note: expected fn pointer `unsafe extern "C" fn(*mut u8)`
                found fn item `unsafe extern "C" fn(*mut u8) {destroy}`
  = note: this error originates in the macro `$crate::__thread_local_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | | ^
  | | |
  | |_expected struct `u8`, found integer
  |   expected due to this type
  |
  = note: this error originates in the macro `$crate::__thread_local_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0369]: binary operation `==` cannot be applied to type `u8`
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | | ^
  | | |
  | |_u8
  |   {integer}
  |
note: an implementation of `PartialEq<_>` might be missing for `u8`
 --> src/main.rs:4:1
  |
4 | struct u8;
  | ^^^^^^^^^^ must implement `PartialEq<_>`
  = note: this error originates in the macro `$crate::assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider annotating `u8` with `#[derive(PartialEq)]`
  |
4 | #[derive(PartialEq)]
  |

error[E0277]: `u8` doesn't implement `Debug`
 --> src/main.rs:6:1
  |
6 | / std::thread_local! {
7 | |     pub static A: i32 = f();
8 | |     pub static B: i32 = const { 0 };
9 | | }
  | |_^ `u8` cannot be formatted using `{:?}`
  |
  = help: the trait `Debug` is not implemented for `u8`
  = note: add `#[derive(Debug)]` to `u8` or manually `impl Debug for u8`
  = note: this error originates in the macro `$crate::assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
```
</details>

2 years agoRollup merge of #95593 - notriddle:notriddle/size-of-in-const-context, r=compiler...
Dylan DPC [Sat, 2 Apr 2022 20:38:21 +0000 (22:38 +0200)]
Rollup merge of #95593 - notriddle:notriddle/size-of-in-const-context, r=compiler-errors

diagnostics: add test case for bogus T:Sized suggestion

Closes #69228

2 years agoRollup merge of #95589 - Kobzol:rlink-header, r=bjorn3
Dylan DPC [Sat, 2 Apr 2022 20:38:20 +0000 (22:38 +0200)]
Rollup merge of #95589 - Kobzol:rlink-header, r=bjorn3

Include a header in .rlink files

I couldn't find the right place where to put tests. Is there some location that tests `.rlink` creation and loading?
I only found `src/test/run-make-fulldeps/separate-link/Makefile`, but I'm not sure how to check the error message in the Makefile.

Fixes: https://github.com/rust-lang/rust/issues/95297
r? `@bjorn3`

2 years agoRollup merge of #95587 - m-ou-se:std-remove-associated-type-bounds, r=Dylan-DPC
Dylan DPC [Sat, 2 Apr 2022 20:38:19 +0000 (22:38 +0200)]
Rollup merge of #95587 - m-ou-se:std-remove-associated-type-bounds, r=Dylan-DPC

Remove need for associated_type_bounds in std.

2 years agoAdd test for multi-line attribute handling in doctests
Guillaume Gomez [Sat, 2 Apr 2022 15:05:27 +0000 (17:05 +0200)]
Add test for multi-line attribute handling in doctests

2 years agoFix doctest multi-line mod attributes handling
Guillaume Gomez [Sat, 2 Apr 2022 15:05:04 +0000 (17:05 +0200)]
Fix doctest multi-line mod attributes handling

2 years agoRefer to u8 by absolute path in expansion of thread_local
David Tolnay [Sat, 2 Apr 2022 18:12:39 +0000 (11:12 -0700)]
Refer to u8 by absolute path in expansion of thread_local

2 years agoAdd test of thread_local! breaking on redefined u8
David Tolnay [Sat, 2 Apr 2022 18:37:53 +0000 (11:37 -0700)]
Add test of thread_local! breaking on redefined u8

2 years agoAuto merge of #94911 - jackh726:gats_extended_2, r=compiler-errors
bors [Sat, 2 Apr 2022 18:34:26 +0000 (18:34 +0000)]
Auto merge of #94911 - jackh726:gats_extended_2, r=compiler-errors

Make GATs object safe under generic_associated_types_extended feature

Based on #94869

Let's say we have
```rust
trait StreamingIterator {
    type Item<'a> where Self: 'a;
}
```
And `dyn for<'a> StreamingIterator<Item<'a> = &'a i32>`.

If we ask `(dyn for<'a> StreamingIterator<Item<'a> = &'a i32>): StreamingIterator`, then we have to prove that `for<'x> (&'x i32): Sized`. So, we generate *new* bound vars to subst for the GAT generics.

Importantly, this doesn't fully verify that these are usable and sound.

r? `@nikomatsakis`

2 years agoMake GATs object safe under generic_associated_types_extended feature
Jack Huey [Sun, 13 Mar 2022 15:56:18 +0000 (11:56 -0400)]
Make GATs object safe under generic_associated_types_extended feature

2 years agodiagnostics: add test case for bogus T:Sized suggestion
Michael Howell [Sat, 2 Apr 2022 16:57:04 +0000 (09:57 -0700)]
diagnostics: add test case for bogus T:Sized suggestion

Closes #69228

2 years agoAuto merge of #95568 - GuillaumeGomez:fix-invalid-dom-generation, r=notriddle
bors [Sat, 2 Apr 2022 15:53:41 +0000 (15:53 +0000)]
Auto merge of #95568 - GuillaumeGomez:fix-invalid-dom-generation, r=notriddle

Fix invalid DOM generation

Fixes #64371.

r? `@notriddle`

2 years agoAddress review comments and add a test
Jakub Beránek [Sat, 2 Apr 2022 15:26:39 +0000 (17:26 +0200)]
Address review comments and add a test

2 years agoInclude a header in .rlink files to provide nicer error messages when a wrong file...
Jakub Beránek [Sat, 2 Apr 2022 14:50:08 +0000 (16:50 +0200)]
Include a header in .rlink files to provide nicer error messages when a wrong file is parsed as .rlink

2 years agoAuto merge of #95537 - GuillaumeGomez:type_of-doc, r=Dylan-DPC
bors [Sat, 2 Apr 2022 12:13:11 +0000 (12:13 +0000)]
Auto merge of #95537 - GuillaumeGomez:type_of-doc, r=Dylan-DPC

Improve TyCtxt::type_of documentation

r? `@oli-obk`

2 years agoImprove TyCtxt::type_of documentation
Guillaume Gomez [Thu, 31 Mar 2022 19:03:52 +0000 (21:03 +0200)]
Improve TyCtxt::type_of documentation

2 years agoAuto merge of #95571 - petrochenkov:nowrapident2, r=Aaron1011
bors [Sat, 2 Apr 2022 07:42:50 +0000 (07:42 +0000)]
Auto merge of #95571 - petrochenkov:nowrapident2, r=Aaron1011

ast_lowering: Stop wrapping `ident` matchers into groups

The lowered forms goes to metadata, for example during encoding of macro definitions.
This is a missing part of https://github.com/rust-lang/rust/pull/92472.

Fixes https://github.com/rust-lang/rust/issues/95569
r? `@Aaron1011`

2 years agoAuto merge of #95509 - nnethercote:simplify-MatcherPos-some-more, r=petrochenkov
bors [Sat, 2 Apr 2022 04:59:16 +0000 (04:59 +0000)]
Auto merge of #95509 - nnethercote:simplify-MatcherPos-some-more, r=petrochenkov

Simplify `MatcherPos` some more

A few more improvements.

r? `@petrochenkov`

2 years agoAuto merge of #95581 - Dylan-DPC:rollup-2suh5h1, r=Dylan-DPC
bors [Sat, 2 Apr 2022 02:35:03 +0000 (02:35 +0000)]
Auto merge of #95581 - Dylan-DPC:rollup-2suh5h1, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #95354 (Handle rustc_const_stable attribute in library feature collector)
 - #95373 (invalid_value lint: detect invalid initialization of arrays)
 - #95430 (Disable #[thread_local] support on i686-pc-windows-msvc)
 - #95544 (Add error message suggestion for missing noreturn in naked function)
 - #95556 (Implement provenance preserving methods on NonNull)
 - #95557 (Fix `thread_local!` macro to be compatible with `no_implicit_prelude`)
 - #95559 (small type system refactoring)
 - #95560 (convert more `DefId`s to `LocalDefId`)

Failed merges:

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

2 years agoRollup merge of #95560 - lcnr:obligation-cause, r=oli-obk
Dylan DPC [Sat, 2 Apr 2022 01:34:27 +0000 (03:34 +0200)]
Rollup merge of #95560 - lcnr:obligation-cause, r=oli-obk

convert more `DefId`s to `LocalDefId`

2 years agoRollup merge of #95559 - lcnr:inferctxt-typeck, r=oli-obk
Dylan DPC [Sat, 2 Apr 2022 01:34:26 +0000 (03:34 +0200)]
Rollup merge of #95559 - lcnr:inferctxt-typeck, r=oli-obk

small type system refactoring

2 years agoRollup merge of #95557 - niluxv:issue-95533, r=dtolnay
Dylan DPC [Sat, 2 Apr 2022 01:34:25 +0000 (03:34 +0200)]
Rollup merge of #95557 - niluxv:issue-95533, r=dtolnay

Fix `thread_local!` macro to be compatible with `no_implicit_prelude`

Fixes issue  #95533.

2 years agoRollup merge of #95556 - declanvk:nonnull-provenance, r=dtolnay
Dylan DPC [Sat, 2 Apr 2022 01:34:24 +0000 (03:34 +0200)]
Rollup merge of #95556 - declanvk:nonnull-provenance, r=dtolnay

Implement provenance preserving methods on NonNull

### Description
 Add the `addr`, `with_addr`, `map_addr` methods to the `NonNull` type, and map the address type to `NonZeroUsize`.

 ### Motivation
 The `NonNull` type is useful for implementing pointer types which have  the 0-niche. It is currently possible to implement these provenance  preserving functions by calling `NonNull::as_ptr` and `new_unchecked`. The adding these methods makes it more ergonomic.

 ### Testing
 Added a unit test of a non-null tagged pointer type. This is based on some real code I have elsewhere, that currently routes the pointer through a `NonZeroUsize` and back out to produce a usable pointer. I wanted to produce an ideal version of the same tagged pointer struct that preserved pointer provenance.

### Related

Extension of APIs proposed in #95228 . I can also split this out into a separate tracking issue if that is better (though I may need some pointers on how to do that).

2 years agoRollup merge of #95544 - jam1garner:improve-naked-noreturn-diagnostic, r=tmiasko
Dylan DPC [Sat, 2 Apr 2022 01:34:23 +0000 (03:34 +0200)]
Rollup merge of #95544 - jam1garner:improve-naked-noreturn-diagnostic, r=tmiasko

Add error message suggestion for missing noreturn in naked function

I had to google the syntax for inline asm's `noreturn` option when I got this error earlier today, so I figured I'd save others the trouble and add the syntax/fix as a suggestion in the error.

2 years agoRollup merge of #95430 - ChrisDenton:disable-tls-i686-msvc, r=nagisa
Dylan DPC [Sat, 2 Apr 2022 01:34:22 +0000 (03:34 +0200)]
Rollup merge of #95430 - ChrisDenton:disable-tls-i686-msvc, r=nagisa

Disable #[thread_local] support on i686-pc-windows-msvc

Fixes #95429

2 years agoRollup merge of #95373 - RalfJung:invalid_value, r=davidtwco
Dylan DPC [Sat, 2 Apr 2022 01:34:21 +0000 (03:34 +0200)]
Rollup merge of #95373 - RalfJung:invalid_value, r=davidtwco

invalid_value lint: detect invalid initialization of arrays

2 years agoRollup merge of #95354 - dtolnay:rustc_const_stable, r=lcnr
Dylan DPC [Sat, 2 Apr 2022 01:34:21 +0000 (03:34 +0200)]
Rollup merge of #95354 - dtolnay:rustc_const_stable, r=lcnr

Handle rustc_const_stable attribute in library feature collector

The library feature collector in [compiler/rustc_passes/src/lib_features.rs](https://github.com/rust-lang/rust/blob/551b4fa395fa588d91cbecfb0cdfe1baa02670cf/compiler/rustc_passes/src/lib_features.rs) has only been looking at `#[stable(…)]`, `#[unstable(…)]`, and `#[rustc_const_unstable(…)]` attributes, while ignoring `#[rustc_const_stable(…)]`. The consequences of this were:

- When any const feature got stabilized (changing one or more `rustc_const_unstable` to `rustc_const_stable`), users who had previously enabled that unstable feature using `#![feature(…)]` would get told "unknown feature", rather than rustc's nicer "the feature … has been stable since … and no longer requires an attribute to enable".

    This can be seen in the way that https://github.com/rust-lang/rust/pull/93957#issuecomment-1079794660 failed after rebase:

    ```console
    error[E0635]: unknown feature `const_ptr_offset`
      --> $DIR/offset_from_ub.rs:1:35
       |
    LL | #![feature(const_ptr_offset_from, const_ptr_offset)]
       |                                   ^^^^^^^^^^^^^^^^
    ```

- We weren't enforcing that a particular feature is either stable everywhere or unstable everywhere, and that a feature that has been stabilized has the same stabilization version everywhere, both of which we enforce for the other stability attributes.

This PR updates the library feature collector to handle `rustc_const_stable`, and fixes places in the standard library and test suite where `rustc_const_stable` was being used in a way that does not meet the rules for a stability attribute.

2 years agoAuto merge of #95578 - RalfJung:miri, r=RalfJung
bors [Sat, 2 Apr 2022 00:05:43 +0000 (00:05 +0000)]
Auto merge of #95578 - RalfJung:miri, r=RalfJung

update Miri

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

2 years agoupdate Miri
Ralf Jung [Fri, 1 Apr 2022 23:48:12 +0000 (19:48 -0400)]
update Miri

2 years agoAuto merge of #94883 - cjgillot:flat-metadata, r=oli-obk
bors [Fri, 1 Apr 2022 21:16:41 +0000 (21:16 +0000)]
Auto merge of #94883 - cjgillot:flat-metadata, r=oli-obk

Encode even more metadata through tables instead of EntryKind

This should move us closer to getting rid of `EntryKind`.

2 years agoast_lowering: Stop wrapping `ident` matchers into groups
Vadim Petrochenkov [Fri, 1 Apr 2022 20:54:05 +0000 (23:54 +0300)]
ast_lowering: Stop wrapping `ident` matchers into groups

The lowered forms goes to metadata, for example during encoding of macro definitions

2 years agoFix invalid DOM generation
Guillaume Gomez [Fri, 1 Apr 2022 18:18:08 +0000 (20:18 +0200)]
Fix invalid DOM generation

2 years agoAuto merge of #95552 - matthiaskrgr:rollup-bxminn9, r=matthiaskrgr
bors [Fri, 1 Apr 2022 17:19:15 +0000 (17:19 +0000)]
Auto merge of #95552 - matthiaskrgr:rollup-bxminn9, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #95032 (Clean up, categorize and sort unstable features in std.)
 - #95260 (Better suggestions for `Fn`-family trait selection errors)
 - #95293 (suggest wrapping single-expr blocks in square brackets)
 - #95344 (Make `impl Debug for rustdoc::clean::Item` easier to read)
 - #95388 (interpret: make isize::MAX the limit for dynamic value sizes)
 - #95530 (rustdoc: do not show primitives and keywords as private)

Failed merges:

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

2 years agoAdd regression test for naked functions with invalid asm syntax
jam1garner [Fri, 1 Apr 2022 16:24:04 +0000 (12:24 -0400)]
Add regression test for naked functions with invalid asm syntax

2 years agoReword purpose description of noreturn in naked function
jam1garner [Fri, 1 Apr 2022 15:28:45 +0000 (11:28 -0400)]
Reword purpose description of noreturn in naked function

2 years agoDon't emit non-asm contents error for naked function composed of errors
jam1garner [Fri, 1 Apr 2022 05:29:38 +0000 (01:29 -0400)]
Don't emit non-asm contents error for naked function composed of errors

2 years agoAuto merge of #95558 - matthiaskrgr:rollup-vpmk7t8, r=matthiaskrgr
bors [Fri, 1 Apr 2022 14:57:45 +0000 (14:57 +0000)]
Auto merge of #95558 - matthiaskrgr:rollup-vpmk7t8, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #95475 (rustdoc: Only show associated consts from inherent impls in sidebar)
 - #95516 (ptr_metadata test: avoid ptr-to-int transmutes)
 - #95528 (skip slow int_log tests in Miri)
 - #95531 (expand: Do not count metavar declarations on RHS of `macro_rules`)
 - #95532 (make utf8_char_counts test faster in Miri)
 - #95546 (add notes about alignment-altering reallocations to Allocator docs)

Failed merges:

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

2 years agoinvalid_value lint: detect invalid initialization of arrays
Ralf Jung [Sun, 27 Mar 2022 17:10:34 +0000 (13:10 -0400)]
invalid_value lint: detect invalid initialization of arrays

2 years agoupdate comment
lcnr [Fri, 1 Apr 2022 11:47:01 +0000 (13:47 +0200)]
update comment

2 years agoconvert more `DefId`s to `LocalDefId`
lcnr [Fri, 1 Apr 2022 11:38:43 +0000 (13:38 +0200)]
convert more `DefId`s to `LocalDefId`