]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoRollup merge of #95415 - notriddle:notriddle/issue-82081, r=Dylan-DPC
Dylan DPC [Tue, 29 Mar 2022 15:11:52 +0000 (17:11 +0200)]
Rollup merge of #95415 - notriddle:notriddle/issue-82081, r=Dylan-DPC

diagnostics: regression test for HashMap iter_mut suggestion

Closes #82081

2 years agoRollup merge of #94566 - yanganto:show-ignore-message, r=m-ou-se
Dylan DPC [Tue, 29 Mar 2022 15:11:51 +0000 (17:11 +0200)]
Rollup merge of #94566 - yanganto:show-ignore-message, r=m-ou-se

Show ignore message in console and json output

- Provide ignore the message in console and JSON output
- Modify the ignore message style in the log file

related: #92714

2 years agoRemove unnecessary .as_ref().
Mara Bos [Tue, 29 Mar 2022 13:53:09 +0000 (15:53 +0200)]
Remove unnecessary .as_ref().

2 years agoRefactor after review
Antonio Yang [Tue, 29 Mar 2022 11:41:16 +0000 (19:41 +0800)]
Refactor after review

Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
2 years agoAuto merge of #95375 - MarcusCalhoun-Lopez:i686_apple_darwin, r=m-ou-se
bors [Tue, 29 Mar 2022 10:08:03 +0000 (10:08 +0000)]
Auto merge of #95375 - MarcusCalhoun-Lopez:i686_apple_darwin, r=m-ou-se

Fix build on i686-apple-darwin systems

Replace `target_arch = "x86_64"` with `not(target_arch = "aarch64")` so that i686-apple-darwin systems dynamically choose implementation.

2 years agoAuto merge of #95257 - compiler-errors:fn-borrow, r=lcnr
bors [Tue, 29 Mar 2022 07:27:14 +0000 (07:27 +0000)]
Auto merge of #95257 - compiler-errors:fn-borrow, r=lcnr

Add suggestion to borrow `Fn` and `FnMut` params/opaque/closures instead of move

I think that Closure/ParamTy/Opaque are all "opaque" enough that it's meaningful to suggest borrowing them instead of moving them at their usage sites when we see a move error. See the attached issue for example.

Is this suggestion too general? I could perhaps use the move site information to limit this to places like fn calls, but I don't know enough about mir borrowck to know if that's an easy change.

Fixes #90828

2 years agoSuggest function borrow ignoring needs_note
Michael Goulet [Tue, 29 Mar 2022 02:30:39 +0000 (19:30 -0700)]
Suggest function borrow ignoring needs_note

`needs_note` is false if we've already suggested why the type is Copy...
but that has nothing to do with the diagnostic.

2 years agodrive-by: move Copy bound suggestion to its own function
Michael Goulet [Tue, 29 Mar 2022 01:35:23 +0000 (18:35 -0700)]
drive-by: move Copy bound suggestion to its own function

2 years agoAdd suggestion to borrow opaque Fn and FnMut instead of move
Michael Goulet [Wed, 23 Mar 2022 23:15:43 +0000 (16:15 -0700)]
Add suggestion to borrow opaque Fn and FnMut instead of move

2 years agoAuto merge of #95423 - ehuss:update-books, r=ehuss
bors [Tue, 29 Mar 2022 05:15:58 +0000 (05:15 +0000)]
Auto merge of #95423 - ehuss:update-books, r=ehuss

Update books

## nomicon

3 commits in f6d6126fc96ecf4a7f7d22da330df9506293b0d0..11f1165e8a2f5840467e748c8108dc53c948ee9a
2022-02-26 02:21:21 +0900 to 2022-03-19 16:02:00 -0400
- Make the Vec impl be slightly more careful with ZSTs and alignment.
- implement `IntoIterator` for `Vec` (rust-lang/nomicon#337)
- Add an explanation shared to exclusive transmute (rust-lang/nomicon#344)

## reference

2 commits in 0a2fe6651fbccc6416c5110fdf5b93fb3cb29247..c97d14fa6fed0baa9255432b8a93cb70614f80e3
2022-03-15 09:32:25 -0700 to 2022-03-19 18:18:10 -0700
- Fixed inconsistency in the usage of semicolon at end of scopes (rust-lang/reference#1182)
- Document ADX `target_feature` (rust-lang/reference#1172)

## book

23 commits in 036e88a4f135365de85358febe5324976a56030a..ea90bbaf53ba64ef4e2da9ac2352b298aec6bec8
2022-03-04 21:53:33 -0500 to 2022-03-28 21:59:34 -0400
- Fix nostarch snapshot
- Snapshot of chapter 7 for nostarch
- Add a forward reference to chapter 14, another example of pub use
- Clarify pub use example. Fixes rust-lang/book#2716.
- Fancy quotes
- Fix incorrectly worded sentence. Fixes rust-lang/book#3086.
- Reword description of how a listing came to be
- Call out binary+library crate practices
- Define binary and library crates more explicitly
- Clarify when a path is a crate name and when it should be literal crate
- Make it clearer the outer `mod` doesn't move to the file
- Don't wrap this example in main when copying. Fixes rust-lang/book#2930.
- Try to make clearer that `mod` is not an `import`
- Mention mod.rs file naming scheme
- Explain why submodule subdirectories are needed more
- Rename a separate example of serve_order to deliver_order
- Show an example that `use` only applies in its own scope
- quick modules guide
- Tweak a snippet of ch18-03
- Propagating edits to chapter 10 back
- Responses to nostarch questions of chapter 10
- Update src/ch04-01-what-is-ownership.md
- Add Danish translation link. Connects to rust-lang/book#3079.

## rust-by-example

2 commits in d504324f1e7dc7edb918ac39baae69f1f1513b8e..ec954f35eedf592cd173b21c05a7f80a65b61d8a
2022-03-07 09:26:32 -0300 to 2022-03-22 11:09:06 -0300
- PathBuf details and example (rust-lang/rust-by-example#1519)
- Move allow dead code attribute and add comment (rust-lang/rust-by-example#1518)

## rustc-dev-guide

1 commits in 0e4b961a9c708647bca231430ce1b199993e0196..155126b1d2e2cb01ddb1d7ba9489b90d7cd173ad
2022-03-14 08:40:37 -0700 to 2022-03-22 14:34:21 +0100
- update section for type system constants (rust-lang/rustc-dev-guide#1329)

## embedded-book

1 commits in d5fc1bce3f8eb398f9c25f1b15e0257d7537cd41..a6de8b6e3ea5d4f0de8b7b9a7e5c1405dc2c2ddb
2022-01-24 07:13:31 +0000 to 2022-03-17 21:21:39 +0000
- Update OpenOCD install instruction for rust-embedded/book#313  (rust-embedded/book#314)

2 years agoUpdate books
Eric Huss [Tue, 29 Mar 2022 05:16:31 +0000 (22:16 -0700)]
Update books

2 years agoAuto merge of #95417 - ehuss:doc-no_std-error, r=Dylan-DPC
bors [Tue, 29 Mar 2022 01:09:22 +0000 (01:09 +0000)]
Auto merge of #95417 - ehuss:doc-no_std-error, r=Dylan-DPC

bootstrap: better error message for no_std docs

Currently if one tries to build std documentation for a no_std target, you get a confusing error message:

`error: The argument '--package [<SPEC>...]' was provided more than once, but cannot be used multiple times`

This is because [`std_cargo`](https://github.com/rust-lang/rust/blob/600ec284838c52d1f6657c2cf0097b58970b133b/src/bootstrap/compile.rs#L299-L305) has a built-in `-p alloc` argument that conflicts with the `cargo rustdoc` command used in the Std doc step.

This just adds a better error message in this scenario. It may be possible to fix this correctly, but that would likely be a bit more of an invasive change that I don't have time for right now.

2 years agoAuto merge of #95249 - HeroicKatora:set-ptr-value, r=dtolnay
bors [Mon, 28 Mar 2022 22:47:31 +0000 (22:47 +0000)]
Auto merge of #95249 - HeroicKatora:set-ptr-value, r=dtolnay

Refactor set_ptr_value as with_metadata_of

Replaces `set_ptr_value` (#75091) with methods of reversed argument order:

```rust
impl<T: ?Sized> *mut T {
    pub fn with_metadata_of<U: ?Sized>(self, val: *mut U) -> *mut U;
}

impl<T: ?Sized> *const T {
    pub fn with_metadata_of<U: ?Sized>(self, val: *const U) -> *const U;
}
```

By reversing the arguments we achieve several clarifications:

- The function closely resembles `cast` with an argument to
  initialize the metadata. This is easier to teach and answers a long
  outstanding question that had restricted cast to `Sized` pointee
  targets. See multiples reviews of
  <https://github.com/rust-lang/rust/pull/47631>
- The 'object identity', in the form of provenance, is now preserved
  from the receiver argument to the result. This helps explain the method as
  a builder-style, instead of some kind of setter that would modify
  something in-place. Ensuring that the result has the identity of the
  `self` argument is also beneficial for an intuition of effects.
- An outstanding concern, 'Correct argument type', is avoided by not
  committing to any specific argument type. This is consistent with cast
  which does not require its receiver to be a 'raw address'.

Hopefully the usage examples in `sync/rc.rs` serve as sufficient examples of the style to convince the reader of the readability improvements of this style, when compared to the previous order of arguments.

I want to take the opportunity to motivate inclusion of this method _separate_ from metadata API, separate from `feature(ptr_metadata)`. It does _not_ involve the `Pointee` trait in any form. This may be regarded as a very, very light form that does not commit to any details of the pointee trait, or its associated metadata. There are several use cases for which this is already sufficient and no further inspection of metadata is necessary.

- Storing the coercion of `*mut T` into `*mut dyn Trait` as a way to dynamically cast some an arbitrary instance of the same type to a dyn trait instance. In particular, one can have a field of type `Option<*mut dyn io::Seek>` to memorize if a particular writer is seekable. Then a method `fn(self: &T) -> Option<&dyn Seek>` can be provided, which does _not_ involve the static trait bound `T: Seek`. This makes it possible to create an API that is capable of utilizing seekable streams and non-seekable streams (instead of a possible less efficient manner such as more buffering) through the same entry-point.

- Enabling more generic forms of unsizing for no-`std` smart pointers. Using the stable APIs only few concrete cases are available. One can unsize arrays to `[T]` by `ptr::slice_from_raw_parts` but unsizing a custom smart pointer to, e.g., `dyn Iterator`, `dyn Future`, `dyn Debug`, can't easily be done generically. Exposing `with_metadata_of` would allow smart pointers to offer their own `unsafe` escape hatch with similar parameters where the caller provides the unsized metadata. This is particularly interesting for embedded where `dyn`-trait usage can drastically reduce code size.

2 years agoFix build on i686-apple-darwin systems
Marcus Calhoun-Lopez [Mon, 28 Mar 2022 19:44:19 +0000 (12:44 -0700)]
Fix build on i686-apple-darwin systems

On 32-bit systems, fdopendir is called `_fdopendir$INODE64$UNIX2003`.
On 64-bit systems, fdopendir is called `_fdopendir$INODE64`.

2 years agoFix build on i686-apple-darwin systems
Marcus Calhoun-Lopez [Sun, 27 Mar 2022 18:18:01 +0000 (11:18 -0700)]
Fix build on i686-apple-darwin systems

Replace `target_arch = "x86_64"` with `not(target_arch = "aarch64")` so that i686-apple-darwin systems dynamically choose implementation.

2 years agobootstrap: better error message for no_std docs
Eric Huss [Mon, 28 Mar 2022 19:13:18 +0000 (12:13 -0700)]
bootstrap: better error message for no_std docs

2 years agodiagnostics: add regression test for #82081
Michael Howell [Mon, 28 Mar 2022 18:47:19 +0000 (11:47 -0700)]
diagnostics: add regression test for #82081

2 years agodiagnostics: do not suggest `map.iter_mut()()`
Michael Howell [Mon, 28 Mar 2022 18:47:01 +0000 (11:47 -0700)]
diagnostics: do not suggest `map.iter_mut()()`

2 years agoAuto merge of #95414 - Dylan-DPC:rollup-9hbshd0, r=Dylan-DPC
bors [Mon, 28 Mar 2022 18:42:59 +0000 (18:42 +0000)]
Auto merge of #95414 - Dylan-DPC:rollup-9hbshd0, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #93787 (parallel_compiler: hide dependencies behind feature)
 - #95318 (diagnostics: correct generic bounds with doubled colon)
 - #95328 (Fix yet another Box<T, A> ICE)
 - #95397 (Link to std::io's platform-specific behavior disclaimer)
 - #95407 (Inline u8::is_utf8_char_boundary)

Failed merges:

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

2 years agoRollup merge of #95407 - xfix:inline-u8-is_utf8_char_boundary, r=scottmcm
Dylan DPC [Mon, 28 Mar 2022 18:41:53 +0000 (20:41 +0200)]
Rollup merge of #95407 - xfix:inline-u8-is_utf8_char_boundary, r=scottmcm

Inline u8::is_utf8_char_boundary

Since Rust beta, Rust is incapable of inlining this function in the following example function.

```rust
pub fn safe_substr_to(s: &str, mut length: usize) -> &str {
    loop {
        if let Some(s) = s.get(..length) {
            return s;
        }
        length -= 1;
    }
}
```

When compiled with beta or nightly compiler on Godbolt with `-C opt-level=3` flag it prints the following assembly.

```asm
example::safe_substr_to:
        push    r15
        push    r14
        push    r12
        push    rbx
        push    rax
        mov     r14, rdi
        test    rdx, rdx
        je      .LBB0_8
        mov     rbx, rdx
        mov     r15, rsi
        mov     r12, qword ptr [rip + core::num::<impl u8>::is_utf8_char_boundary@GOTPCREL]
        jmp     .LBB0_4
.LBB0_2:
        je      .LBB0_9
.LBB0_3:
        add     rbx, -1
        je      .LBB0_8
.LBB0_4:
        cmp     rbx, r15
        jae     .LBB0_2
        movzx   edi, byte ptr [r14 + rbx]
        call    r12
        test    al, al
        je      .LBB0_3
        mov     r15, rbx
        jmp     .LBB0_9
.LBB0_8:
        xor     r15d, r15d
.LBB0_9:
        mov     rax, r14
        mov     rdx, r15
        add     rsp, 8
        pop     rbx
        pop     r12
        pop     r14
        pop     r15
        ret
```

`qword ptr [rip + core::num::<impl u8>::is_utf8_char_boundary@GOTPCREL]` is not inlined. `-C remark=all` outputs the following message:

```
note: /rustc/7bccde19767082c7865a12902fa614ed4f8fed73/library/core/src/str/mod.rs:214:25: inline: _ZN4core3num20_$LT$impl$u20$u8$GT$21is_utf8_char_boundary17hace9f12f5ba07a7fE will not be inlined into _ZN4core3str21_$LT$impl$u20$str$GT$16is_char_boundary17hf2587e9a6b8c5e43E because its definition is unavailable
```

Stable compiler outputs more reasonable code:

```asm
example::safe_substr_to:
        mov     rcx, rdx
        mov     rax, rdi
        test    rdx, rdx
        je      .LBB0_9
        mov     rdx, rsi
        jmp     .LBB0_4
.LBB0_2:
        cmp     rdx, rcx
        je      .LBB0_7
.LBB0_3:
        add     rcx, -1
        je      .LBB0_9
.LBB0_4:
        cmp     rcx, rdx
        jae     .LBB0_2
        cmp     byte ptr [rax + rcx], -64
        jl      .LBB0_3
        mov     rdx, rcx
.LBB0_7:
        ret
.LBB0_9:
        xor     edx, edx
        ret
```

2 years agoRollup merge of #95397 - dtolnay:disclaimer, r=m-ou-se
Dylan DPC [Mon, 28 Mar 2022 18:41:52 +0000 (20:41 +0200)]
Rollup merge of #95397 - dtolnay:disclaimer, r=m-ou-se

Link to std::io's platform-specific behavior disclaimer

This PR adds some links in standard library documentation to point to https://doc.rust-lang.org/std/io/index.html#platform-specific-behavior.

> ### Platform-specific behavior
>
> Many I/O functions throughout the standard library are documented to indicate what various library or syscalls they are delegated to. This is done to help applications both understand what’s happening under the hood as well as investigate any possibly unclear semantics. Note, however, that this is informative, not a binding contract. The implementation of many of these functions are subject to change over time and may call fewer or more syscalls/library functions.

Many of the `std::fs` APIs already link to this disclaimer when discussing system calls.

2 years agoRollup merge of #95328 - DrMeepster:box_gep_err, r=oli-obk
Dylan DPC [Mon, 28 Mar 2022 18:41:51 +0000 (20:41 +0200)]
Rollup merge of #95328 - DrMeepster:box_gep_err, r=oli-obk

Fix yet another Box<T, A> ICE

Fixes #95036.

This widens the special case from #94414 to make sure that boxes with a custom allocator are never directly dereferenced.

2 years agoRollup merge of #95318 - rust-lang:notriddle/issue-95208, r=wesleywiser
Dylan DPC [Mon, 28 Mar 2022 18:41:50 +0000 (20:41 +0200)]
Rollup merge of #95318 - rust-lang:notriddle/issue-95208, r=wesleywiser

diagnostics: correct generic bounds with doubled colon

Fixes #95208

2 years agoRollup merge of #93787 - klensy:really-not-a-features, r=wesleywiser
Dylan DPC [Mon, 28 Mar 2022 18:41:49 +0000 (20:41 +0200)]
Rollup merge of #93787 - klensy:really-not-a-features, r=wesleywiser

parallel_compiler: hide dependencies behind feature

Separate dependencies for `parallel_compiler` feature, so they will not be compiled if feature not selected, reducing number of compiled crates from 238 to 224.

2 years agoInline u8::is_utf8_char_boundary
Konrad Borowski [Mon, 28 Mar 2022 16:37:11 +0000 (18:37 +0200)]
Inline u8::is_utf8_char_boundary

2 years agoAuto merge of #95403 - Dylan-DPC:rollup-9on30mg, r=Dylan-DPC
bors [Mon, 28 Mar 2022 16:15:17 +0000 (16:15 +0000)]
Auto merge of #95403 - Dylan-DPC:rollup-9on30mg, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #95301 (Remove `Nonterminal::NtTT`.)
 - #95314 (Tell users that `||` operators are not currently supported in let chain expressions)
 - #95350 (resolve: Simplify some diagnostic code to avoid an ICE)
 - #95370 ([bootstrap] Don't print `Suite not skipped` unless `--verbose` is set)
 - #95390 (Ignore doc comments in a declarative macro matcher.)
 - #95401 (Remove duplicated and unused test files)

Failed merges:

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

2 years agoRollup merge of #95401 - c410-f3r:moar-tests, r=petrochenkov
Dylan DPC [Mon, 28 Mar 2022 14:08:12 +0000 (16:08 +0200)]
Rollup merge of #95401 - c410-f3r:moar-tests, r=petrochenkov

Remove duplicated and unused test files

cc https://github.com/rust-lang/rust/issues/73494
r? `@petrochenkov`

2 years agoRollup merge of #95390 - nnethercote:allow-doc-comments-in-macros, r=petrochenkov
Dylan DPC [Mon, 28 Mar 2022 14:08:11 +0000 (16:08 +0200)]
Rollup merge of #95390 - nnethercote:allow-doc-comments-in-macros, r=petrochenkov

Ignore doc comments in a declarative macro matcher.

Fixes #95267. Reverts to the old behaviour before #95159 introduced a
regression.

r? `@petrochenkov`

2 years agoRollup merge of #95370 - jyn514:less-verbose-skips, r=Dylan-DPC
Dylan DPC [Mon, 28 Mar 2022 14:08:10 +0000 (16:08 +0200)]
Rollup merge of #95370 - jyn514:less-verbose-skips, r=Dylan-DPC

[bootstrap] Don't print `Suite not skipped` unless `--verbose` is set

This was so verbose before that it made it hard to see what effect the flag actually had.

Before:
```
Set({test::src/tools/tidy}) not skipped for "bootstrap::test::Tidy" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Skipping Suite(test::src/test/ui) because it is excluded
Suite(test::src/test/run-pass-valgrind) not skipped for "bootstrap::test::RunPassValgrind" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Skipping Suite(test::src/test/mir-opt) because it is excluded
Suite(test::src/test/codegen) not skipped for "bootstrap::test::Codegen" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Suite(test::src/test/codegen-units) not skipped for "bootstrap::test::CodegenUnits" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Suite(test::src/test/assembly) not skipped for "bootstrap::test::Assembly" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Suite(test::src/test/incremental) not skipped for "bootstrap::test::Incremental" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Skipping Suite(test::src/test/debuginfo) because it is excluded
Skipping Suite(test::src/test/ui-fulldeps) because it is excluded
... about 100 more lines ...
```

After:
```
Skipping Suite(test::src/test/ui) because it is excluded
Skipping Suite(test::src/test/mir-opt) because it is excluded
Skipping Suite(test::src/test/debuginfo) because it is excluded
Skipping Suite(test::src/test/ui-fulldeps) because it is excluded
```

2 years agoRollup merge of #95350 - petrochenkov:qpathregr, r=cjgillot
Dylan DPC [Mon, 28 Mar 2022 14:08:09 +0000 (16:08 +0200)]
Rollup merge of #95350 - petrochenkov:qpathregr, r=cjgillot

resolve: Simplify some diagnostic code to avoid an ICE

No need to resolve those paths, they are already resolved, we just need to take the results from `partial_res_map`.

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

2 years agoRollup merge of #95314 - c410-f3r:aqui-vamos-nos, r=lcnr
Dylan DPC [Mon, 28 Mar 2022 14:08:08 +0000 (16:08 +0200)]
Rollup merge of #95314 - c410-f3r:aqui-vamos-nos, r=lcnr

Tell users that `||` operators are not currently supported in let chain expressions

Tells that `||` operators are not currently supported instead of not allowed. See https://github.com/rust-lang/rust/issues/53667#issuecomment-1066075876

In other words, this PR is pretty much trivial.

2 years agoRollup merge of #95301 - nnethercote:rm-NtTT, r=petrochenkov
Dylan DPC [Mon, 28 Mar 2022 14:08:07 +0000 (16:08 +0200)]
Rollup merge of #95301 - nnethercote:rm-NtTT, r=petrochenkov

Remove `Nonterminal::NtTT`.

It's only needed for macro expansion, not as a general element in the
AST. This commit removes it, adds `NtOrTt` for the parser and macro
expansion cases, and renames the variants in `NamedMatch` to better
match the new type.

r? `@petrochenkov`

2 years agoAuto merge of #95024 - koehlma:rustdoc-private-items, r=GuillaumeGomez,camelid,jsha
bors [Mon, 28 Mar 2022 13:49:22 +0000 (13:49 +0000)]
Auto merge of #95024 - koehlma:rustdoc-private-items, r=GuillaumeGomez,camelid,jsha

rustdoc: add 🔒 to items with restricted visibility

This change marks items with restricted visibility with 🔒 when building with `--document-private-items`:

<img width="278" alt="Screen Shot 2022-03-20 at 23 50 24" src="https://user-images.githubusercontent.com/509209/159189513-9e4b09bb-6785-41a5-bfe2-df02f83f8641.png">

There also appears a “Restricted Visibility” tooltip when hovering over the emoji.

---

The original PR for reference:

This change makes private items slightly transparent (similar to `unstable` items in rustc):

<img width="272" alt="Screen Shot 2022-03-16 at 22 17 43" src="https://user-images.githubusercontent.com/509209/158692627-a1f6f5ec-e043-4aa2-9352-8d2b15c31c08.png">

I found myself using `--document-private-items` a lot recently because I find the documentation of private internals quite helpful when working on a larger project. However, not being able to distinguish private from public items (see #87785) when looking at the documentation makes this somewhat cumbersome.

This PR addresses the third suggestion of issue #87785 by marking private items typographically. It seems to me that the other suggestions are more involved but this is at least a first step.

A private item is also made slightly transparent in the path displayed in the header of a page:

<img width="467" alt="Screen Shot 2022-03-16 at 22 19 51" src="https://user-images.githubusercontent.com/509209/158692885-0bbd3417-3c0b-486f-b8ab-99c05c6fa7ca.png">

I am looking forward to feedback and suggestions.

2 years agoRemove duplicated and unused test files
Caio [Mon, 28 Mar 2022 13:16:32 +0000 (10:16 -0300)]
Remove duplicated and unused test files

2 years agoAuto merge of #94789 - compiler-errors:fatal-never, r=eddyb
bors [Mon, 28 Mar 2022 11:08:23 +0000 (11:08 +0000)]
Auto merge of #94789 - compiler-errors:fatal-never, r=eddyb

Make fatal DiagnosticBuilder yield `!`

Fatal errors should really be fatal, so emitting them should cause us to exit at the same time.

Fine with just throwing away these changes if they're not worthwhile. Also, maybe we want to use an uninhabited enum instead of `!`.

r? `@eddyb` who has been working on `DiagnosticBuilder` stuff, feel free to reassign.

2 years agoAuto merge of #95396 - TaKO8Ki:suggest-replacing-field-when-using-the-same-type,...
bors [Mon, 28 Mar 2022 08:40:25 +0000 (08:40 +0000)]
Auto merge of #95396 - TaKO8Ki:suggest-replacing-field-when-using-the-same-type, r=compiler-errors

Suggest replacing a field when using the same type

closes #89166

2 years agoAuto merge of #95300 - workingjubilee:less-bitsets, r=eddyb
bors [Mon, 28 Mar 2022 05:48:25 +0000 (05:48 +0000)]
Auto merge of #95300 - workingjubilee:less-bitsets, r=eddyb

Skip needless bitset for debuginfo

Found this while digging around looking at the inlining logic.
Seemed obvious enough so I decided to try to take care of it.
Is this what you had in mind, `@eddyb?`

2 years agoPropagate `parallel_compiler` feature through rustc crates. Turned off feature gives...
klensy [Fri, 11 Feb 2022 20:25:14 +0000 (23:25 +0300)]
Propagate `parallel_compiler` feature through rustc crates. Turned off feature gives change of builded crates: 238 -> 224.

2 years agouse cfg attribute instead of macro
klensy [Tue, 8 Feb 2022 19:21:16 +0000 (22:21 +0300)]
use cfg attribute instead of macro

2 years agoMake fatal DiagnosticBuilder yield never
Michael Goulet [Thu, 10 Mar 2022 00:11:28 +0000 (16:11 -0800)]
Make fatal DiagnosticBuilder yield never

2 years agouse `can_coerce` instead of `same_type_modulo_infer`
Takayuki Maeda [Mon, 28 Mar 2022 04:43:33 +0000 (13:43 +0900)]
use `can_coerce` instead of `same_type_modulo_infer`

2 years agoLink to std::io's platform-specific behavior disclaimer
David Tolnay [Mon, 28 Mar 2022 03:58:16 +0000 (20:58 -0700)]
Link to std::io's platform-specific behavior disclaimer

2 years agosuggest replacing field when using the same type
Takayuki Maeda [Mon, 28 Mar 2022 03:38:10 +0000 (12:38 +0900)]
suggest replacing field when using the same type

2 years agoAuto merge of #95393 - Dylan-DPC:rollup-l72f39g, r=Dylan-DPC
bors [Mon, 28 Mar 2022 02:29:06 +0000 (02:29 +0000)]
Auto merge of #95393 - Dylan-DPC:rollup-l72f39g, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #88375 (Clarify that ManuallyDrop<T> has same layout as T)
 - #93755 (Allow comparing `Vec`s with different allocators using `==`)
 - #95016 (Docs: make Vec::from_raw_parts documentation less strict)
 - #95098 (impl From<&[T; N]> and From<&mut [T; N]> for Vec<T>)

Failed merges:

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

2 years agoRollup merge of #95098 - shepmaster:vec-from-array-ref, r=dtolnay
Dylan DPC [Mon, 28 Mar 2022 02:12:11 +0000 (04:12 +0200)]
Rollup merge of #95098 - shepmaster:vec-from-array-ref, r=dtolnay

impl From<&[T; N]> and From<&mut [T; N]> for Vec<T>

I really wanted to write:

```rust
fn example(a: impl Into<Vec<u8>>) {}

fn main() {
    example(b"raw");
}
```

2 years agoRollup merge of #95016 - janpaul123:patch-1, r=dtolnay
Dylan DPC [Mon, 28 Mar 2022 02:12:10 +0000 (04:12 +0200)]
Rollup merge of #95016 - janpaul123:patch-1, r=dtolnay

Docs: make Vec::from_raw_parts documentation less strict

This is my first PR; be gentle!

In https://users.rust-lang.org/t/why-does-vec-from-raw-parts-require-same-size-and-not-same-size-capacity/73036/2?u=janpaul123 it was suggested to me that I should make a PR to make the documentation of `Vec::from_raw_parts` less strict, since we don't require `T` to have the same size, just `size_of::<T>() * capacity` to be the same, since that is what results in `Layout::size` being the same in `dealloc`, which is really what matters.

Also in https://users.rust-lang.org/t/why-does-vec-from-raw-parts-require-same-size-and-not-same-size-capacity/73036/8?u=janpaul123 it was suggested that it's better to use `slice::from_raw_parts`, which I think is useful advise that could also be mentioned in the docs, so I added that too.

Let me know what you think! :)

2 years agoRollup merge of #93755 - ChayimFriedman2:allow-comparing-vecs-with-different-allocato...
Dylan DPC [Mon, 28 Mar 2022 02:12:10 +0000 (04:12 +0200)]
Rollup merge of #93755 - ChayimFriedman2:allow-comparing-vecs-with-different-allocators, r=dtolnay

Allow comparing `Vec`s with different allocators using `==`

See https://stackoverflow.com/q/71021633/7884305.

I did not changed the `PartialOrd` impl too because it was not generic already (didn't support `Vec<T> <=> Vec<U> where T: PartialOrd<U>`).

Does it needs tests?

I don't think this will hurt type inference much because the default allocator is usually not inferred (`new()` specifies it directly, and even with other allocators, you pass the allocator to `new_in()` so the compiler usually knows the type).

I think this requires FCP since the impls are already stable.

2 years agoRollup merge of #88375 - joshlf:patch-3, r=dtolnay
Dylan DPC [Mon, 28 Mar 2022 02:12:09 +0000 (04:12 +0200)]
Rollup merge of #88375 - joshlf:patch-3, r=dtolnay

Clarify that ManuallyDrop<T> has same layout as T

This PR implements the documentation change under discussion in https://github.com/rust-lang/unsafe-code-guidelines/issues/302. It should not be approved or merged until the discussion there is resolved.

2 years agoAuto merge of #95333 - GuillaumeGomez:auto-trait-perf-issue, r=oli-obk
bors [Mon, 28 Mar 2022 00:01:01 +0000 (00:01 +0000)]
Auto merge of #95333 - GuillaumeGomez:auto-trait-perf-issue, r=oli-obk

Fix perf issue for auto trait selection

Follow-up of https://github.com/rust-lang/rust/pull/95069 which fixes the perf issue introduced by it.

r? `@oli-obk`

2 years agoIgnore doc comments in a declarative macro matcher.
Nicholas Nethercote [Sun, 27 Mar 2022 21:55:59 +0000 (08:55 +1100)]
Ignore doc comments in a declarative macro matcher.

Fixes #95267. Reverts to the old behaviour before #95159 introduced a
regression.

2 years agoRemove `Nonterminal::NtTT`.
Nicholas Nethercote [Fri, 25 Mar 2022 01:39:12 +0000 (12:39 +1100)]
Remove `Nonterminal::NtTT`.

It's only needed for macro expansion, not as a general element in the
AST. This commit removes it, adds `NtOrTt` for the parser and macro
expansion cases, and renames the variants in `NamedMatch` to better
match the new type.

2 years agoAuto merge of #95382 - Dylan-DPC:rollup-bebyfd1, r=Dylan-DPC
bors [Sun, 27 Mar 2022 21:36:42 +0000 (21:36 +0000)]
Auto merge of #95382 - Dylan-DPC:rollup-bebyfd1, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #94939 (diagnostics: suggest missing comma in bad FRU syntax)
 - #95120 (Implement `apply_switch_int_edge_effects` for backward analyses)
 - #95364 (Add long error explanation for E0667)
 - #95366 (Remove test files with duplicated checksums)
 - #95368 (Fix typo in `String::try_reserve_exact` docs)

Failed merges:

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

2 years agoRollup merge of #95368 - lopopolo:lopopolo/string-try-reserve-exact-doc-typo, r=Dylan-DPC
Dylan DPC [Sun, 27 Mar 2022 20:51:42 +0000 (22:51 +0200)]
Rollup merge of #95368 - lopopolo:lopopolo/string-try-reserve-exact-doc-typo, r=Dylan-DPC

Fix typo in `String::try_reserve_exact` docs

Copying the pattern from `Vec::try_reserve_exact` and `String::try_reserve`,
it looks like this doc comment is intending to refer to the currently-being-documented
function.

2 years agoRollup merge of #95366 - c410-f3r:moar-tests, r=petrochenkov
Dylan DPC [Sun, 27 Mar 2022 20:51:41 +0000 (22:51 +0200)]
Rollup merge of #95366 - c410-f3r:moar-tests, r=petrochenkov

Remove test files with duplicated checksums

cc https://github.com/rust-lang/rust/issues/73494
r? `@petrochenkov`

2 years agoRollup merge of #95364 - GuillaumeGomez:long-error-explanation-e0667, r=Dylan-DPC
Dylan DPC [Sun, 27 Mar 2022 20:51:40 +0000 (22:51 +0200)]
Rollup merge of #95364 - GuillaumeGomez:long-error-explanation-e0667, r=Dylan-DPC

Add long error explanation for E0667

Part of #61137.

2 years agoRollup merge of #95120 - smoelius:backward-switch-int, r=ecstatic-morse
Dylan DPC [Sun, 27 Mar 2022 20:51:39 +0000 (22:51 +0200)]
Rollup merge of #95120 - smoelius:backward-switch-int, r=ecstatic-morse

Implement `apply_switch_int_edge_effects` for backward analyses

See #94576 for some discussion.

r? `@ecstatic-morse`

2 years agoRollup merge of #94939 - notriddle:notriddle/fru-comma-suggestion, r=cjgillot
Dylan DPC [Sun, 27 Mar 2022 20:51:38 +0000 (22:51 +0200)]
Rollup merge of #94939 - notriddle:notriddle/fru-comma-suggestion, r=cjgillot

diagnostics: suggest missing comma in bad FRU syntax

Fixes #51103

2 years agofix other source of box deref
DrMeepster [Sun, 27 Mar 2022 20:35:29 +0000 (13:35 -0700)]
fix other source of box deref

2 years agoAuto merge of #94495 - estebank:missing-closing-gt, r=jackh726
bors [Sun, 27 Mar 2022 18:55:58 +0000 (18:55 +0000)]
Auto merge of #94495 - estebank:missing-closing-gt, r=jackh726

Provide suggestion for missing `>` in a type parameter list

When encountering an inproperly terminated type parameter list, provide
a suggestion to close it after the last non-constraint type parameter
that was successfully parsed.

Fix #94058.

2 years agoNit
Dylan MacKenzie [Sun, 27 Mar 2022 17:58:55 +0000 (10:58 -0700)]
Nit

2 years agoUpdate ui test output
Guillaume Gomez [Sun, 27 Mar 2022 17:21:50 +0000 (19:21 +0200)]
Update ui test output

2 years agodiagnostics: suggest missing comma in bad FRU syntax
Michael Howell [Mon, 14 Mar 2022 18:46:12 +0000 (11:46 -0700)]
diagnostics: suggest missing comma in bad FRU syntax

Fixes #51103

2 years agoAuto merge of #95345 - dtolnay:escape0, r=Dylan-DPC
bors [Sun, 27 Mar 2022 16:36:05 +0000 (16:36 +0000)]
Auto merge of #95345 - dtolnay:escape0, r=Dylan-DPC

Debug print char 0 as '\0' rather than '\u{0}'

```rust
println!("{:?}", "foo\0");
```

- **Before:** `"foo\u{0}"`
- **After:** `"foo\0"`

```rust
println!("{:?}", '\0');
```

- **Before:** `'\u{0}'`
- **After:** `'\0'`

`'\0'` will be more recognizable to everyone than `'\u{0}'` because it's how we talk about character 0 in all of our docs and example code, such as https://doc.rust-lang.org/std/ffi/index.html, https://doc.rust-lang.org/std/ffi/struct.CStr.html, https://doc.rust-lang.org/std/ffi/struct.CString.html.

2 years ago[bootstrap] Don't print `Suite not skipped` unless `--verbose` is set
Joshua Nelson [Sun, 27 Mar 2022 15:11:02 +0000 (10:11 -0500)]
[bootstrap] Don't print `Suite not skipped` unless `--verbose` is set

This was so verbose before that it made it hard to see what effect the flag actually had.

Before:
```
Set({test::src/tools/tidy}) not skipped for "bootstrap::test::Tidy" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Skipping Suite(test::src/test/ui) because it is excluded
Suite(test::src/test/run-pass-valgrind) not skipped for "bootstrap::test::RunPassValgrind" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Skipping Suite(test::src/test/mir-opt) because it is excluded
Suite(test::src/test/codegen) not skipped for "bootstrap::test::Codegen" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Suite(test::src/test/codegen-units) not skipped for "bootstrap::test::CodegenUnits" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Suite(test::src/test/assembly) not skipped for "bootstrap::test::Assembly" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Suite(test::src/test/incremental) not skipped for "bootstrap::test::Incremental" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps]
Skipping Suite(test::src/test/debuginfo) because it is excluded
Skipping Suite(test::src/test/ui-fulldeps) because it is excluded
... about 100 more lines ...
```

After:
```
Skipping Suite(test::src/test/ui) because it is excluded
Skipping Suite(test::src/test/mir-opt) because it is excluded
Skipping Suite(test::src/test/debuginfo) because it is excluded
Skipping Suite(test::src/test/ui-fulldeps) because it is excluded
```

2 years agoFix typo in `String::try_reserve_exact` docs
Ryan Lopopolo [Sun, 27 Mar 2022 13:53:55 +0000 (06:53 -0700)]
Fix typo in `String::try_reserve_exact` docs

Copying the pattern from `Vec::try_reserve_exact` and `String::try_reserve`,
it looks like this doc comment is intending to refer to the currently-being-documented
function.

2 years agoRemove duplicated test files
Caio [Sun, 27 Mar 2022 12:19:34 +0000 (09:19 -0300)]
Remove duplicated test files

2 years agoAdd long error explanation for E0667
Guillaume Gomez [Sun, 27 Mar 2022 11:58:06 +0000 (13:58 +0200)]
Add long error explanation for E0667

2 years agoDebug print char 0 as '\0' rather than '\u{0}'
David Tolnay [Sat, 26 Mar 2022 20:35:58 +0000 (13:35 -0700)]
Debug print char 0 as '\0' rather than '\u{0}'

2 years agoAuto merge of #95355 - dtolnay:ripgreptest, r=Dylan-DPC
bors [Sun, 27 Mar 2022 09:19:50 +0000 (09:19 +0000)]
Auto merge of #95355 - dtolnay:ripgreptest, r=Dylan-DPC

Bump the ripgrep commit exercised by cargotest

This update goes from https://github.com/BurntSushi/ripgrep/commit/3de31f752729525d85a3d1575ac1978733b3f7e7 (Aug 1, 2019) to current master, https://github.com/BurntSushi/ripgrep/commit/ced5b92aa93eb47e892bd2fd26ab454008721730 (March 21, 2022).

I need this in order to pick up https://github.com/BurntSushi/ripgrep/pull/1722, which picked up https://github.com/BurntSushi/bstr/pull/58, which unblocks https://github.com/rust-lang/rust/pull/95345. Ripgrep uses the Debug representation of a `BStr` in some of its tests. In old versions of bstr, that used to just use the standard library's `escape_debug()` implementation, so the output ends up being sensitive to whether the standard library renders character 0 as `\u{0}` or as `\0`. The newer bstr always renders character 0 as `\0` and ripgrep's test suite has been correspondingly updated.

2 years agoAuto merge of #93957 - SaltyKitkat:stablize_const_ptr_offset, r=dtolnay
bors [Sun, 27 Mar 2022 07:01:29 +0000 (07:01 +0000)]
Auto merge of #93957 - SaltyKitkat:stablize_const_ptr_offset, r=dtolnay

Stabilize const_ptr_offset

Close #71499

2 years agoHandle `,` to `;` substitution in arg params
Esteban Kuber [Sun, 27 Mar 2022 06:05:18 +0000 (06:05 +0000)]
Handle `,` to `;` substitution in arg params

2 years agoBump the ripgrep commit exercised by cargotest
David Tolnay [Sun, 27 Mar 2022 04:55:16 +0000 (21:55 -0700)]
Bump the ripgrep commit exercised by cargotest

2 years agoAuto merge of #95351 - Dylan-DPC:rollup-o1il7tx, r=Dylan-DPC
bors [Sun, 27 Mar 2022 04:20:07 +0000 (04:20 +0000)]
Auto merge of #95351 - Dylan-DPC:rollup-o1il7tx, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #91981 (Recover suggestions and useful information lost in previous PR)
 - #93469 (Skip pointing out ambiguous impls in alloc/std crates too in inference errors)
 - #95335 (Move resolve_path to rustc_builtin_macros and make it private)
 - #95340 (interpret: with enforce_number_validity, ensure integers are truly Scalar::Int (i.e., no pointers))
 - #95341 (ARMv6K Horizon OS has_thread_local support)

Failed merges:

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

2 years agoBump const_ptr_offset stabilization to 1.61
David Tolnay [Sat, 26 Mar 2022 21:19:41 +0000 (14:19 -0700)]
Bump const_ptr_offset stabilization to 1.61

2 years agoRollup merge of #95341 - Meziu:armv6k-3ds-target, r=nagisa
Dylan DPC [Sun, 27 Mar 2022 03:36:11 +0000 (05:36 +0200)]
Rollup merge of #95341 - Meziu:armv6k-3ds-target, r=nagisa

ARMv6K Horizon OS has_thread_local support

cc. ```@ian-h-chamberlain```
cc. ```@AzureMarker```

Being an ARM target, it has always had built-in support for `#[thread_local]`. This PR comes in just now because we were testing `std::thread` support with `thread_local_dtor`s. This will hopefully be the last PR for the target specification, unless anymore features will be needed as time goes on.

2 years agoRollup merge of #95340 - RalfJung:pnvi, r=oli-obk
Dylan DPC [Sun, 27 Mar 2022 03:36:10 +0000 (05:36 +0200)]
Rollup merge of #95340 - RalfJung:pnvi, r=oli-obk

interpret: with enforce_number_validity, ensure integers are truly Scalar::Int (i.e., no pointers)

This is required for https://github.com/rust-lang/miri/pull/2040

r? ```@oli-obk```

2 years agoRollup merge of #95335 - Badel2:resolve-path, r=Dylan-DPC
Dylan DPC [Sun, 27 Mar 2022 03:36:09 +0000 (05:36 +0200)]
Rollup merge of #95335 - Badel2:resolve-path, r=Dylan-DPC

Move resolve_path to rustc_builtin_macros and make it private

Fixing a FIXME introduced by `@jyn514` in #85457

2 years agoRollup merge of #93469 - compiler-errors:issue-93450, r=estebank
Dylan DPC [Sun, 27 Mar 2022 03:36:08 +0000 (05:36 +0200)]
Rollup merge of #93469 - compiler-errors:issue-93450, r=estebank

Skip pointing out ambiguous impls in alloc/std crates too in inference errors

This generalizes the logic in `annotate_source_of_ambiguity` to skip printing ambiguity errors traits in `alloc` and `std` as well, not just `core`.

While this does spot-fix the issue mentioned below, it would be nicer to generalize this logic, for example to detect when the trait predicate's `self_ty` has any numerical inference variables. Is it worthwhile to scrap this solution for one like that?

Fixes #93450

r? `@estebank`
feel free to reassign

2 years agoRollup merge of #91981 - estebank:tweakaroo, r=lcnr
Dylan DPC [Sun, 27 Mar 2022 03:36:08 +0000 (05:36 +0200)]
Rollup merge of #91981 - estebank:tweakaroo, r=lcnr

Recover suggestions and useful information lost in previous PR

Follow up to #91898.

2 years agoProvide suggestion for missing `>` in a type parameter list
Esteban Kuber [Tue, 1 Mar 2022 19:40:48 +0000 (19:40 +0000)]
Provide suggestion for missing `>` in a type parameter list

When encountering an inproperly terminated type parameter list, provide
a suggestion to close it after the last non-constraint type parameter
that was successfully parsed.

Fix #94058.

2 years agoreview comments and rebase
Esteban Kuber [Sun, 27 Mar 2022 02:40:07 +0000 (02:40 +0000)]
review comments and rebase

2 years agoChange wording of missing return type suggestion
Esteban Kuber [Wed, 15 Dec 2021 23:49:03 +0000 (23:49 +0000)]
Change wording of missing return type suggestion

2 years agoDrive by: handle references in `same_type_modulo_infer`
Esteban Kuber [Wed, 15 Dec 2021 23:25:03 +0000 (23:25 +0000)]
Drive by: handle references in `same_type_modulo_infer`

2 years agoPoint (again) to more expressions with their type, even if not fully resolved
Esteban Kuber [Wed, 15 Dec 2021 23:16:21 +0000 (23:16 +0000)]
Point (again) to more expressions with their type, even if not fully resolved

2 years agoAlso resolve `const` param suggestion
Esteban Kuber [Wed, 15 Dec 2021 23:11:26 +0000 (23:11 +0000)]
Also resolve `const` param suggestion

2 years agoEagerly replace `{integer}`/`{float}` with `i32`/`f64` for suggestion
Esteban Kuber [Wed, 15 Dec 2021 22:59:32 +0000 (22:59 +0000)]
Eagerly replace `{integer}`/`{float}` with `i32`/`f64` for suggestion

2 years agoAuto merge of #95338 - bjorn3:sync_cg_gcc-2022-03-26, r=antoyo
bors [Sun, 27 Mar 2022 01:55:15 +0000 (01:55 +0000)]
Auto merge of #95338 - bjorn3:sync_cg_gcc-2022-03-26, r=antoyo

Sync rustc_codegen_gcc

r? `@ghost`

`@rustbot` label +A-codegen +A-gcc +T-compiler

cc `@antoyo`

2 years agoRemove SelectionContext::allow_negative_impls field
Guillaume Gomez [Sun, 27 Mar 2022 01:01:34 +0000 (03:01 +0200)]
Remove SelectionContext::allow_negative_impls field

2 years agoresolve: Simplify some diagnostic code to avoid an ICE
Vadim Petrochenkov [Sat, 26 Mar 2022 23:30:58 +0000 (02:30 +0300)]
resolve: Simplify some diagnostic code to avoid an ICE

2 years agoAuto merge of #92472 - petrochenkov:nowrapident, r=Aaron1011
bors [Sat, 26 Mar 2022 23:01:12 +0000 (23:01 +0000)]
Auto merge of #92472 - petrochenkov:nowrapident, r=Aaron1011

proc-macro: Stop wrapping `ident` matchers into groups

`ident` is always a single token and can be treated in the same way as `tt`.
r? `@Aaron1011`

2 years agoAuto merge of #95274 - jendrikw:slice-must-use, r=Dylan-DPC
bors [Sat, 26 Mar 2022 20:17:04 +0000 (20:17 +0000)]
Auto merge of #95274 - jendrikw:slice-must-use, r=Dylan-DPC

add #[must_use] to functions of slice and its iterators.

Continuation of #92853.

Tracking issue: #89692.

2 years agoMerge pull request #16 from ian-h-chamberlain/feature/target-thread-local
Meziu [Sat, 26 Mar 2022 19:49:19 +0000 (20:49 +0100)]
Merge pull request #16 from ian-h-chamberlain/feature/target-thread-local

Enable #[thread_local] on armv6k-nintendo-3ds

2 years agointerpret: with enforce_number_validity, ensure integers are truly Scalar::Int (i...
Ralf Jung [Sat, 26 Mar 2022 17:17:49 +0000 (13:17 -0400)]
interpret: with enforce_number_validity, ensure integers are truly Scalar::Int (i.e., no pointers)

2 years agoMerge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into sync_cg_gcc-2022-03-26
bjorn3 [Sat, 26 Mar 2022 17:29:37 +0000 (18:29 +0100)]
Merge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into sync_cg_gcc-2022-03-26

2 years agointerpret: mark a dead match arm as dead
Ralf Jung [Sat, 26 Mar 2022 17:03:49 +0000 (13:03 -0400)]
interpret: mark a dead match arm as dead

2 years agoMerge pull request #146 from bjorn3/rustup
antoyo [Sat, 26 Mar 2022 17:00:39 +0000 (13:00 -0400)]
Merge pull request #146 from bjorn3/rustup

Rustup to rustc 1.61.0-nightly (d53246fed 2022-03-25)

2 years agoReview comments
bjorn3 [Sat, 26 Mar 2022 16:27:06 +0000 (17:27 +0100)]
Review comments

2 years agoMove resolve_path to rustc_builtin_macros and make it private
Badel2 [Sat, 26 Mar 2022 15:47:13 +0000 (16:47 +0100)]
Move resolve_path to rustc_builtin_macros and make it private

2 years agoFix compiletest compilation
bjorn3 [Sat, 26 Mar 2022 15:14:39 +0000 (16:14 +0100)]
Fix compiletest compilation

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Sat, 26 Mar 2022 15:23:55 +0000 (16:23 +0100)]
add #[must_use] to functions of slice and its iterators.