Commit graph

197499 commits

Author SHA1 Message Date
Matthias Krüger
36d8d5565d
Rollup merge of #100656 - ehuss:update-cargo, r=ehuss
Update cargo

3 commits in efd4ca3dc0b89929dc8c5f5c023d25978d76cb61..9809f8ff33c2b998919fd0432c626f0f7323697a
2022-08-12 01:28:28 +0000 to 2022-08-16 22:10:06 +0000
- Improve error message for an array value in the manifest (rust-lang/cargo#10944)
- Fix file locking being not supported on Android raising an error (rust-lang/cargo#10975)
- Bump to 0.66.0, update changelog (rust-lang/cargo#10983)
2022-08-17 12:33:00 +02:00
Matthias Krüger
c0d9feac1e
Rollup merge of #100655 - ehuss:update-books, r=ehuss
Update books

## nomicon

2 commits in 8d1e4dccf71114ff56f328f671f2026d8e6b62a2..8e6aa3448515a0654e347b5e2510f1d4bc4d5a64
2022-07-18 18:12:35 -0400 to 2022-08-15 15:36:13 -0700
- Update the `repr(transparent)` section to reflect the current state (rust-lang/nomicon#376)
- [typo] typo on limits of lifetime chapter (rust-lang/nomicon#377)

## reference

5 commits in f3d3953bf3b158d596c96d55ce5366f9f3f972e9..e647eb102890e8927f488bea12672b079eff8d9d
2022-08-01 17:17:37 -0700 to 2022-08-16 11:35:27 -0700
- #[non_exhaustive] on variant blocks cross-crate as casts (rust-lang/reference#1249)
- Revert let chains reference docs (rust-lang/reference#1251)
- Update subtyping.md (rust-lang/reference#1240)
- a fix about .await (rust-lang/reference#1245)
- Be less specific about the representation of `+bundle` (rust-lang/reference#1246)

## book

2 commits in 36383b4da21dbd0a0781473bc8ad7ef0ed1b6751..42ca0ef484fcc8437a0682cee23abe4b7c407d52
2022-07-19 21:03:20 -0400 to 2022-08-12 21:52:02 -0400
- Missing period at end of sentence
- Fix grammar in ch06-02

## rust-by-example

8 commits in ee342dc91e1ba1bb1e1f1318f84bbe3bfac04798..03301f8ae55fa6f20f7ea152a517598e6db2cdb7
2022-07-27 11:06:36 -0300 to 2022-08-14 08:51:44 -0300
- Update print.md (rust-lang/rust-by-example#1597)
- in Meta, replace 'playpen' with 'playground' (rust-lang/rust-by-example#1596)
- Update doc comment to link to name field without compilation warning (rust-lang/rust-by-example#1595)
- add line numbers for playpen fixes rust-lang/rust-by-example#1593 (rust-lang/rust-by-example#1594)
- clarify that the map-reduce example relies on static data (rust-lang/rust-by-example#1592)
- Update flow_control.md (rust-lang/rust-by-example#1591)
- Remove duplicate line in the hello/print.md file (rust-lang/rust-by-example#1590)
- Make rust editable in chapter on defaults (rust-lang/rust-by-example#1589)

## rustc-dev-guide

15 commits in 04f3cf0bb2f5a6ee2bfc4b1a6a6cd8c11d1c5531..d3daa1f28e169087becbc5e2b49ac91ca0405a44
2022-07-31 07:46:57 +0200 to 2022-08-13 10:00:38 +0900
- Improve the "Diagnostic items" chapter (rust-lang/rustc-dev-guide#1427)
- date-check: crates-io
- fix/improve compiler-debugging
- Update src/compiler-debugging.md
- add gdb tips for symbol-mangling-version
- move references down to avoid clutter (rust-lang/rustc-dev-guide#1420)
- update date-check format on github issue (rust-lang/rustc-dev-guide#1416)
- Fix legend colors in dark mode
- Add color for downloaded nodes
- Add colors to diagram
- Add bootstrapping diagram
- date-check: rustc_codegen_ssa is still alive
- note is now too old to be relevant
- date-check: be more strict
- make date-check more lightweight (rust-lang/rustc-dev-guide#1394)

## edition-guide

3 commits in c55611dd6c58bdeb52423b5c52fd0f3c93615ba8..6038be9d37d7251c966b486154af621d1794d7af
2022-02-21 14:21:39 +0100 to 2022-08-15 08:12:42 -0700
- use title "The Rust Edition Guide" everywhere (rust-lang/edition-guide#280)
- "Creating a new project": add example using 'cargo new --edition YEAR' (rust-lang/edition-guide#279)
- fixes rust-lang/edition-guide#277: mention rust 1.0 release month and year (rust-lang/edition-guide#278)
2022-08-17 12:32:58 +02:00
Matthias Krüger
6eed54a2c9
Rollup merge of #100652 - compiler-errors:no-defer-sized-checks, r=TaKO8Ki
Remove deferred sized checks (make them eager)

Improves diagnostics spans... this doesn't seem to be the case anymore:

```rust
// Some additional `Sized` obligations badly affect type inference.
// These obligations are added in a later stage of typeck.
pub(super) deferred_sized_obligations:
        RefCell<Vec<(Ty<'tcx>, Span, traits::ObligationCauseCode<'tcx>)>>,
```
2022-08-17 12:32:57 +02:00
Matthias Krüger
c0297e2330
Rollup merge of #100646 - finalchild:emoji-diag, r=compiler-errors
Migrate emoji identifier diagnostics to `SessionDiagnostic` in rustc_interface

* Migrate emoji identifier diagnostics to `interface_ferris_identifier` and `interface_emoji_identifier`.

This is my first PR! I'm learning how to migrate these diagnostics. Thanks in advance.

r? rust-lang/diagnostics
2022-08-17 12:32:56 +02:00
Matthias Krüger
64cd65758c
Rollup merge of #100621 - taiki-e:armv4t-atomics-32, r=cuviper
Pass +atomics-32 feature for {arm,thumb}v4t-none-eabi

Similar to 89582e8193, but for ARMv4t.
Pre-v6 ARM target does not have atomic CAS, except for Linux and Android where atomic CAS is provided by compiler-builtins. So, there is a similar issue as thumbv6m.

I have confirmed that enabling the `atomics-32` target feature fixes the problem in the project affected by this issue. (https://github.com/taiki-e/portable-atomic/pull/28#discussion_r946604136)

Closes #100619

r? ``@nikic``
cc ``@Lokathor``
2022-08-17 12:32:55 +02:00
Matthias Krüger
d956734f9f
Rollup merge of #100608 - tshepang:needless-separation, r=TaKO8Ki
needless separation of impl blocks
2022-08-17 12:32:54 +02:00
Matthias Krüger
56b02b2137
Rollup merge of #100532 - RalfJung:unwind-miri, r=Mark-Simulacrum
unwind: don't build dependency when building for Miri

This is basically re-submitting https://github.com/rust-lang/rust/pull/94813.

In that PR there was a suggestion to instead have bootstrap set a `RUST_CHECK` env var and use that rather than doing something Miri-specific. However, such an env var would mean that when switching between `./x.py check` and `./x.py build`, the build script gets re-run each time, which doesn't seem good. So I think for now checking for Miri probably causes fewer problems.

r? ````@Mark-Simulacrum````
2022-08-17 12:32:53 +02:00
Matthias Krüger
1e93994b4d
Rollup merge of #100489 - lcnr:is_knowable-Result, r=davidtwco
`is_knowable` use `Result` instead of `Option`
2022-08-17 12:32:52 +02:00
Matthias Krüger
1948288615
Rollup merge of #100389 - compiler-errors:return-type-suggestion-cycle, r=cjgillot
Do not report cycle error when inferring return type for suggestion

The UI test is a good example of a case where this happens. The cycle is due to needing the value of the return type `-> _` to compute the variances of items in the crate, but then needing the variances of the items in the crate to do typechecking to infer what `-> _`'s real type is.

Since we're already gonna emit an error in astconv, just delay the cycle bug as an error.
2022-08-17 12:32:51 +02:00
Matthias Krüger
989e4ffc7c
Rollup merge of #100379 - davidtwco:triagebot-diag, r=Mark-Simulacrum
triagebot: add translation-related mention groups

- Move some code around so that triagebot can ping relevant parties when translation logic is modified.
- Add mention groups to triagebot for translation-related files/folders.
- Auto-label pull requests with changes to translation-related files/folders with `A-translation`.

r? `@Mark-Simulacrum`
2022-08-17 12:32:50 +02:00
Matthias Krüger
d5dca26a94
Rollup merge of #100018 - nnethercote:clean-up-LitKind, r=petrochenkov
Clean up `LitKind`

r? ``@petrochenkov``
2022-08-17 12:32:49 +02:00
Matthias Krüger
bb77336c0a
Rollup merge of #99972 - RalfJung:1zst, r=lcnr
interpret: only consider 1-ZST when searching for receiver

`repr(transparent)` currently entirely rejects ZST with alignment larger than 1 (which is odd, arguably [this](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=02870f29396fa948c3123cb53d869ad1) should be accepted), so this should be safe. And if it ever isn't safe then that is very likely a bug elsewhere in the compiler.
2022-08-17 12:32:48 +02:00
Matthias Krüger
0491fdad6f
Rollup merge of #99474 - aDotInTheVoid:rustdoc-json-noinline-test-cleanup, r=CraftSpider
Rustdoc json tests: New @hasexact test command

Alot of the time, we wanted to assert that a module had an exact set of items. Most of the time this was done by asserting that the ```@count``` of the module was `n`, and then doing `n` ```@has``` checks on the module.

This was tedious, so often shortcuts were done.

This PR adds a new command to jsondocck to allow consistently expressing this behavior, and then uses it to clean up the tests.

``@rustbot`` modify labels: +A-rustdoc-json +A-testsuite
2022-08-17 12:32:47 +02:00
lcnr
1cede2c126 is_knowable use Result instead of Option 2022-08-17 10:17:54 +02:00
Eric Huss
f4674b4961 Update cargo 2022-08-16 19:02:19 -07:00
Eric Huss
b176f8b78a Update books 2022-08-16 18:52:39 -07:00
Michael Goulet
33212bf7f5 Remove deferred sized checks 2022-08-16 22:30:56 +00:00
bors
86c6ebee8f Auto merge of #100644 - TaKO8Ki:rollup-n0o6a1t, r=TaKO8Ki
Rollup of 4 pull requests

Successful merges:

 - #100243 (Remove opt_remap_env_constness from rustc_query_impl)
 - #100625 (Add `IpDisplayBuffer` helper struct.)
 - #100629 (Use `merged_ty` method instead of rewriting it every time)
 - #100630 (rustdoc JSON: Fix ICE with `pub extern crate self as <self_crate_name>`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-16 21:10:08 +00:00
Takayuki Maeda
af74e7232f
Rollup merge of #100630 - Enselic:export_extern_crate_as_self, r=GuillaumeGomez
rustdoc JSON: Fix ICE with `pub extern crate self as <self_crate_name>`

Closes #100531

r? `@GuillaumeGomez`

`@rustbot` labels +A-rustdoc-json +T-rustdoc
2022-08-17 05:08:05 +09:00
Takayuki Maeda
033387a6af
Rollup merge of #100629 - GuillaumeGomez:merged-ty, r=compiler-errors
Use `merged_ty` method instead of rewriting it every time

`merged_ty` [source code](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_typeck/check/coercion.rs.html#1331-1333) is quite literally the same, so instead of rewriting it, makes more sense to use the method instead.

r? `@compiler-errors`
2022-08-17 05:08:04 +09:00
Takayuki Maeda
b7b4f79bc9
Rollup merge of #100625 - reitermarkus:ip-display-buffer, r=thomcc
Add `IpDisplayBuffer` helper struct.

This removes the dependency on `std::io::Write` for implementing `Display`, allowing it to be moved to `core` as proposed in https://github.com/rust-lang/rfcs/pull/2832.
2022-08-17 05:08:03 +09:00
Takayuki Maeda
e6d47925af
Rollup merge of #100243 - kckeiks:remove-macros-in-query-system, r=cjgillot
Remove opt_remap_env_constness from rustc_query_impl

1st task off #96524.

r? `@cjgillot`
2022-08-17 05:08:02 +09:00
finalchild
c1a98416e3 Migrate emoji identifier diagnostics to SessionDiagnostic 2022-08-17 05:07:47 +09:00
bors
5746c752f4 Auto merge of #100626 - Dylan-DPC:rollup-mwbm7kj, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #99942 (Fix nonsense non-tupled `Fn` trait error)
 - #100609 (Extend invalid floating point literal suffix suggestion)
 - #100610 (Ast and parser tweaks)
 - #100613 (compiletest: fix typo in runtest.rs)
 - #100616 (⬆️ rust-analyzer)
 - #100622 (Support 128-bit atomics on all aarch64 targets)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-16 18:07:02 +00:00
Markus Reiter
44d62425b9
Simplify IpDisplayBuffer API. 2022-08-16 19:32:00 +02:00
Markus Reiter
31540f5e15
Use MaybeUninit<u8> for IpDisplayBuffer. 2022-08-16 18:12:06 +02:00
Markus Reiter
033e9d66ff
Move IpDisplayBuffer into submodule. 2022-08-16 17:57:46 +02:00
Markus Reiter
5a11b814d4
Add IpDisplayBuffer helper struct. 2022-08-16 17:54:55 +02:00
Martin Nordholts
dbeb506eae rustdoc JSON: Fix ICE with pub extern crate self as <self_crate_name> 2022-08-16 15:54:50 +02:00
Guillaume Gomez
1f7d1eae96 Use merged_ty method instead of rewriting it every time 2022-08-16 15:33:46 +02:00
Dylan DPC
35bd1d64cf
Rollup merge of #100622 - taiki-e:aarch64-atomic-128, r=Amanieu
Support 128-bit atomics on all aarch64 targets

Some aarch64 targets currently set `max_atomic_width` to 64, but aarch64 always supports 128-bit atomics.

r? `@Amanieu`
2022-08-16 18:16:16 +05:30
Dylan DPC
1d23d3a952
Rollup merge of #100616 - lnicola:rust-analyzer-2022-08-16, r=lnicola
⬆️ rust-analyzer

r? `@ghost`
2022-08-16 18:16:15 +05:30
Dylan DPC
04dd36941b
Rollup merge of #100613 - eltociear:patch-15, r=Mark-Simulacrum
compiletest: fix typo in runtest.rs

nonexistant -> nonexistent
2022-08-16 18:16:14 +05:30
Dylan DPC
2e78db3858
Rollup merge of #100610 - nnethercote:ast-and-parser-tweaks, r=spastorino
Ast and parser tweaks

r? `@spastorino`
2022-08-16 18:16:13 +05:30
Dylan DPC
cf5c7645ac
Rollup merge of #100609 - chenyukang:fix-100527, r=davidtwco
Extend invalid floating point literal suffix suggestion

Fixes #100527
2022-08-16 18:16:12 +05:30
Dylan DPC
070de4bc48
Rollup merge of #99942 - compiler-errors:nonsense-un-tupled-fn-trait-error, r=cjgillot
Fix nonsense non-tupled `Fn` trait error

Given this code:

```rust
#![feature(unboxed_closures)]

fn a<F: Fn<usize>>(f: F) {}

fn main() {
    a(|_: usize| {});
}
```

We currently emit this error:
```
error[E0631]: type mismatch in closure arguments
 --> src/main.rs:6:5
  |
6 |     a(|_: usize| {});
  |     ^ ---------- found signature of `fn(usize) -> _`
  |     |
  |     expected signature of `fn(usize) -> _`
  |
note: required by a bound in `a`
 --> src/main.rs:3:9
  |
3 | fn a<F: Fn<usize>>(f: F) {}
  |         ^^^^^^^^^ required by this bound in `a`

For more information about this error, try `rustc --explain E0631`.
error: could not compile `playground` due to previous error
```
Notably, it says the same thing for "expected" and "found"!

Fix the output so that we instead emit:
```
error[E0308]: mismatched types
 --> /home/gh-compiler-errors/test.rs:6:5
  |
6 |     a(|_: usize| {});
  |     ^ types differ
  |
  = note: expected trait `Fn<usize>`
             found trait `Fn<(usize,)>`
note: required by a bound in `a`
 --> /home/gh-compiler-errors/test.rs:3:9
  |
3 | fn a<F: Fn<usize>>(f: F) {}
  |         ^^^^^^^^^ required by this bound in `a`

error: aborting due to previous error
```

The error could still use some work, namely the "mismatched types" part, but I'm leaving it a bit rough since the only way you'd ever get this error is when you're messing with `#![feature(unboxed_closures)]`.

Simply making sure we actually print out the difference in trait-refs is good enough for me. I could probably factor in some additional improvements if those are desired.
2022-08-16 18:16:11 +05:30
yukang
89a51a1a48 use proper words in help message for floating point 2022-08-16 19:12:36 +08:00
bors
a39bdb1d6b Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
Fix #95079 unhelpful error when missing move in nested closure

Fix #95079 by adding help for missing move in nested closure
2022-08-16 11:00:25 +00:00
Taiki Endo
5bb04f30cb Support 128-bit atomics on all aarch64 targets 2022-08-16 19:52:19 +09:00
Taiki Endo
8439080f27 Pass +atomics-32 feature for {arm,thumb}v4t-none-eabi 2022-08-16 19:24:12 +09:00
Laurențiu Nicola
a06da98f21 ⬆️ rust-analyzer 2022-08-16 11:24:50 +03:00
bors
14a459bf37 Auto merge of #100441 - nnethercote:shrink-ast-Attribute, r=petrochenkov
Shrink `ast::Attribute`.

r? `@ghost`
2022-08-16 07:54:22 +00:00
Ikko Ashimine
96c91afebb
compiletest: fix typo in runtest.rs
nonexistant -> nonexistent
2022-08-16 16:51:52 +09:00
bors
8556e6620e Auto merge of #100611 - matthiaskrgr:rollup-rxj10ur, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #100338 (when there are 3 or more return statements in the loop)
 - #100384 (Add support for generating unique profraw files by default when using `-C instrument-coverage`)
 - #100460 (Update the minimum external LLVM to 13)
 - #100567 (Add missing closing quote)
 - #100590 (Suggest adding an array length if possible)
 - #100600 (Rename Machine memory hooks to suggest when they run)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-16 05:13:38 +00:00
Matthias Krüger
88af506e94
Rollup merge of #100600 - saethlin:rename-memory-hooks, r=RalfJung
Rename Machine memory hooks to suggest when they run

Some of the other memory hooks start with `before_` or `after_` to indicate that they run before or after a certain operation. These don't, so I was a bit confused as to when they are supposed to run.

`memory_read` can be read two ways in English, "memory was read" or "this is a memory read" so without the prefix this was especially ambiguous.
2022-08-16 06:06:00 +02:00
Matthias Krüger
76dd1663d9
Rollup merge of #100590 - TaKO8Ki:suggest-adding-array-length, r=compiler-errors
Suggest adding an array length if possible

fixes #100448
2022-08-16 06:05:59 +02:00
Matthias Krüger
fc735b05b8
Rollup merge of #100567 - Rageking8:fix-100563, r=wesleywiser
Add missing closing quote

fixes #100563
2022-08-16 06:05:58 +02:00
Matthias Krüger
0b19a185db
Rollup merge of #100460 - cuviper:drop-llvm-12, r=nagisa
Update the minimum external LLVM to 13

With this change, we'll have stable support for LLVM 13 through 15 (pending release).
For reference, the previous increase to LLVM 12 was #90175.

r? `@nagisa`
2022-08-16 06:05:57 +02:00
Matthias Krüger
f347c42461
Rollup merge of #100384 - ridwanabdillahi:instr_profile_output, r=wesleywiser
Add support for generating unique profraw files by default when using `-C instrument-coverage`

Currently, enabling the rustc flag `-C instrument-coverage` instruments the given crate and by default uses the naming scheme `default.profraw` for any instrumented profile files generated during the execution of a binary linked against this crate. This leads to multiple binaries being executed overwriting one another and causing only the last executable run to contain actual coverage results.

This can be overridden by manually setting the environment variable `LLVM_PROFILE_FILE` to use a unique naming scheme.

This PR adds a change to add support for a reasonable default for rustc to use when enabling coverage instrumentation similar to how the Rust compiler treats generating these same `profraw` files when PGO is enabled.

The new naming scheme is set to `default_%m_%p.profraw` to ensure the uniqueness of each file being generated using [LLVMs special pattern strings](https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#running-the-instrumented-program).

Today the compiler sets the default for PGO `profraw` files to `default_%m.profraw` to ensure a unique file for each run. The same can be done for the instrumented profile files generated via the `-C instrument-coverage` flag as well which LLVM has API support for.

Linked Issue: https://github.com/rust-lang/rust/issues/100381

r? `@wesleywiser`
2022-08-16 06:05:56 +02:00
Matthias Krüger
836f706d9a
Rollup merge of #100338 - lyming2007:issue-100285-fix, r=petrochenkov
when there are 3 or more return statements in the loop

emit the first 3 errors and duplicated diagnostic information
	modified:   compiler/rustc_typeck/src/check/coercion.rs
	new file:   src/test/ui/typeck/issue-100285.rs
	new file:   src/test/ui/typeck/issue-100285.stderr
2022-08-16 06:05:55 +02:00