]> git.lizzy.rs Git - rust.git/log
rust.git
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 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.

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

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

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

2 years agoFix perf issue for auto trait selection
Guillaume Gomez [Sat, 26 Mar 2022 13:58:19 +0000 (14:58 +0100)]
Fix perf issue for auto trait selection

2 years agoAdd Destruct and Drop traits to static.rs
bjorn3 [Sat, 26 Mar 2022 13:25:37 +0000 (14:25 +0100)]
Add Destruct and Drop traits to static.rs

2 years agoEnable #[thread_local] on armv6k-nintendo-3ds
Ian Chamberlain [Fri, 18 Feb 2022 22:25:40 +0000 (17:25 -0500)]
Enable #[thread_local] on armv6k-nintendo-3ds

2 years agoRustup to rustc 1.61.0-nightly (d53246fed 2022-03-25)
bjorn3 [Sat, 26 Mar 2022 13:12:44 +0000 (14:12 +0100)]
Rustup to rustc 1.61.0-nightly (d53246fed 2022-03-25)

2 years agoAuto merge of #95326 - lupd:std-iter-doc, r=Dylan-DPC
bors [Sat, 26 Mar 2022 12:01:58 +0000 (12:01 +0000)]
Auto merge of #95326 - lupd:std-iter-doc, r=Dylan-DPC

Remove mention of `HashMap<K, V>` not offering `iter_mut`

HashMap<K, V> does offer iter_mut. Fixes #94755.

r? rust-lang/libs
`@rustbot` label +A-docs +T-libs

2 years agoAddress review comments
Samuel E. Moelius III [Sat, 26 Mar 2022 01:11:49 +0000 (21:11 -0400)]
Address review comments

* Add lazily computed `switch_sources` data structure
* Don't assume a target has only one associated value

2 years agoSync from rust bc881e83d1cced71046e844fa55c0b0e9f9af382
bjorn3 [Sat, 26 Mar 2022 11:52:21 +0000 (12:52 +0100)]
Sync from rust bc881e83d1cced71046e844fa55c0b0e9f9af382

2 years agoproc-macro: Stop wrapping `ident` matchers into groups
Vadim Petrochenkov [Sat, 1 Jan 2022 09:15:47 +0000 (17:15 +0800)]
proc-macro: Stop wrapping `ident` matchers into groups

2 years agoadd #[must_use] to functions of slice and its iterators.
Jendrik [Sat, 26 Mar 2022 09:24:25 +0000 (10:24 +0100)]
add #[must_use] to functions of slice and its iterators.

2 years agoAuto merge of #95306 - est31:master, r=Dylan-DPC
bors [Sat, 26 Mar 2022 09:00:23 +0000 (09:00 +0000)]
Auto merge of #95306 - est31:master, r=Dylan-DPC

std::process docs: linkify references to output, spawn and status

2 years agocheck the the right field
DrMeepster [Sat, 26 Mar 2022 07:08:51 +0000 (00:08 -0700)]
check the the right field

2 years agofix wrong header command
DrMeepster [Sat, 26 Mar 2022 06:46:37 +0000 (23:46 -0700)]
fix wrong header command

2 years agowiden special case on deref to all non-zst allocators
DrMeepster [Sat, 26 Mar 2022 06:14:30 +0000 (23:14 -0700)]
widen special case on deref to all non-zst allocators

2 years agoRemove mention of HashMap<K, V> not offering iter_mut
dlup [Sat, 26 Mar 2022 06:05:34 +0000 (02:05 -0400)]
Remove mention of HashMap<K, V> not offering iter_mut

2 years agoAuto merge of #95296 - workingjubilee:pretty-session, r=Dylan-DPC
bors [Sat, 26 Mar 2022 06:00:41 +0000 (06:00 +0000)]
Auto merge of #95296 - workingjubilee:pretty-session, r=Dylan-DPC

Prettify rustc_session with recent conveniences

No functional changes.

I felt like making something beautiful.

2 years agoAuto merge of #95299 - mkroening:rm-hermitkernel, r=joshtriplett
bors [Sat, 26 Mar 2022 03:19:49 +0000 (03:19 +0000)]
Auto merge of #95299 - mkroening:rm-hermitkernel, r=joshtriplett

Remove hermitkernel targets

RustyHermit now maintains custom json targets, which are distributed with the kernel: https://github.com/hermitcore/libhermit-rs/pull/395

See https://github.com/hermitcore/rusty-hermit/issues/197#issuecomment-1076667961
CC: `@stlankes,` `@bstrie`
2 years agoAuto merge of #95149 - cjgillot:once-diag, r=estebank
bors [Sat, 26 Mar 2022 00:54:54 +0000 (00:54 +0000)]
Auto merge of #95149 - cjgillot:once-diag, r=estebank

Remove `Session::one_time_diagnostic`

This is untracked mutable state, which modified the behaviour of queries.
It was used for 2 things: some full-blown errors, but mostly for lint declaration notes ("the lint level is defined here" notes).

It is replaced by the diagnostic deduplication infra which already exists in the diagnostic emitter.
A new diagnostic level `OnceNote` is introduced specifically for lint notes, to deduplicate subdiagnostics.

As a drive-by, diagnostic emission takes a `&mut` to allow dropping the `SubDiagnostic`s.

2 years agoAuto merge of #95172 - GuillaumeGomez:reduce-wait-for, r=notriddle
bors [Fri, 25 Mar 2022 22:16:44 +0000 (22:16 +0000)]
Auto merge of #95172 - GuillaumeGomez:reduce-wait-for, r=notriddle

Reduce wait-for instructions for rustdoc GUI tests

r? `@notriddle`