Commit Graph

232235 Commits

Author SHA1 Message Date
Michael Goulet
822caa8b80 Avoid side-effects from try_coerce when suggesting borrowing LHS of cast 2023-08-19 22:12:51 +00:00
bors
6ef7d16be0 Auto merge of #114979 - weihanglo:update-cargo, r=weihanglo
Update cargo

15 commits in 7c3904d6c3ed54e8a413023519b55a536ad44d5b..80eca0e58fb2ff52c1e94fc191b55b37ed73e0e4
2023-08-14 20:11:43 +0000 to 2023-08-19 00:52:06 +0000
- chore: Downgrade serde below the binary blob (rust-lang/cargo#12528)
- Improve error message for when no credential providers are available (rust-lang/cargo#12526)
- Fix typo: "use" -> "used" (rust-lang/cargo#12522)
- Document layout SemVer compatibility. (rust-lang/cargo#12169)
- Make cargo-credential-gnome-secret built-in as cargo:libsecret (rust-lang/cargo#12521)
- login: allow passing additional args to provider (rust-lang/cargo#12499)
- cargo-credential-gnome-secret: dynamically load libsecret (rust-lang/cargo#12518)
- credential-providers: make 1password no longer built-in (rust-lang/cargo#12507)
- Print environment variables for `cargo run` in extra verbose mode (rust-lang/cargo#12498)
- chore(cargo-util): bump version to 0.2.6 (rust-lang/cargo#12517)
- credential: rename cargo:basic to cargo:token-from-stdout (rust-lang/cargo#12512)
- fix(xtask-bump-check): query by package name to detect changes (rust-lang/cargo#12513)
- ci: use pull request head commit whenever possible (rust-lang/cargo#12508)
- Update hermit-abi (rust-lang/cargo#12504)
- Crate checksum lookup query should match on semver build metadata (rust-lang/cargo#11447)

r? ghost
2023-08-19 14:20:06 +00:00
bors
3e50a641da Auto merge of #114980 - matthiaskrgr:rollup-3y7651q, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #114953 (Add myself back to review rotation)
 - #114958 (`ignore-cross-compile` on `optimization-remarks-dir-pgo` test)
 - #114971 (Add doc aliases for trigonometry and other f32,f64 methods.)
 - #114972 (Add a test to check that inline const is in required_consts)
 - #114977 (Add `modulo` and `mod` as doc aliases for `rem_euclid`.)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-19 10:58:57 +00:00
Weihang Lo
07ff87bf73
Update cargo 2023-08-19 08:46:37 +01:00
Matthias Krüger
8e0a8cdecb
Rollup merge of #114977 - kpreid:modulo, r=thomcc
Add `modulo` and `mod` as doc aliases for `rem_euclid`.

When I was learning Rust I looked for “a modulo function” and couldn’t find one, so thought I had to write my own; it wasn't at all obvious that a function with “rem” in the name was the function I wanted. Hopefully this will save the next learner from that.

However, it does have the disadvantage that the top results in rustdoc for “mod” are now these aliases instead of the Rust keyword, which probably isn't ideal.
2023-08-19 03:27:01 +02:00
Matthias Krüger
d8bde4878a
Rollup merge of #114972 - nbdd0121:const_check, r=compiler-errors
Add a test to check that inline const is in required_consts

This was a commit in #104087. This commit, as a test, can go in while the overall inline const stabilisation is blocked.

Suggested in https://github.com/rust-lang/rust/issues/76001#issuecomment-1315975027
2023-08-19 03:27:00 +02:00
Matthias Krüger
8d52b4d2f3
Rollup merge of #114971 - kpreid:trig, r=joshtriplett
Add doc aliases for trigonometry and other f32,f64 methods.

These are common alternate names, usually a less-abbreviated form, for the operation; e.g. `arctan` instead of `atan`. Prompted by <https://users.rust-lang.org/t/64-bit-trigonometry/98599>
2023-08-19 03:27:00 +02:00
Matthias Krüger
2b13128be8
Rollup merge of #114958 - ferrocene:optimization-remarks-dir-pgo, r=lqd
`ignore-cross-compile` on `optimization-remarks-dir-pgo` test

We noticed this on our upstream pull on ferrocene a week ago as it was failing our CI. The test attempts to run the produced binary which won't work when cross compiling.
2023-08-19 03:26:59 +02:00
Matthias Krüger
0e609c4610
Rollup merge of #114953 - WaffleLapkin:waffle-back-to-rotation-hehehee, r=WaffleLapkin
Add myself back to review rotation

r? ``@ghost``
2023-08-19 03:26:59 +02:00
Kevin Reid
2c21635382 Add modulo and mod as doc aliases for rem_euclid.
When I was learning Rust I looked for “a modulo function” and couldn’t
find one, so thought I had to write my own; it wasn't at all obvious
that a function with “rem” in the name was the function I wanted.
Hopefully this will save the next learner from that.

However, it does have the disadvantage that the top results in rustdoc
for “mod” are now these aliases instead of the Rust keyword, which
probably isn't ideal.
2023-08-18 12:28:27 -07:00
bors
d06ca0ffaf Auto merge of #114591 - joboet:thread_parking_ordering_fix, r=thomcc
Synchronize with all calls to `unpark` in id-based thread parker

[The documentation for `thread::park`](https://doc.rust-lang.org/nightly/std/thread/fn.park.html#memory-ordering) guarantees that "park synchronizes-with all prior unpark operations". In the id-based thread parking implementation, this is not implemented correctly, as the state variable is reset with a simple store, so there will not be a *synchronizes-with* edge if an `unpark` happens just before the reset. This PR corrects this, replacing the load-check-reset sequence with a single `compare_exchange`.
2023-08-18 19:03:38 +00:00
bors
ee5cb9e3a6 Auto merge of #114915 - nnethercote:Nonterminal-cleanups, r=petrochenkov
`Nonterminal`-related cleanups

In #114647 I am trying to remove `Nonterminal`. It has a number of preliminary cleanups that are worth merging even if #114647 doesn't merge, so let's do them in this PR.

r? `@petrochenkov`
2023-08-18 16:07:40 +00:00
Gary Guo
26fe88fedb Add a test to check that inline const is in required_consts
Suggested in
https://github.com/rust-lang/rust/issues/76001#issuecomment-1315975027
2023-08-18 17:07:07 +01:00
Kevin Reid
c353dbd57f Add doc aliases for trigonometry and other f32,f64 methods.
These are common alternate names, usually a less-abbreviated form,
for the operation; e.g. `arctan` instead of `atan`. Prompted by
<https://users.rust-lang.org/t/64-bit-trigonometry/98599>
2023-08-18 08:08:35 -07:00
bors
2ceed0b6cb Auto merge of #113814 - ChoKyuWon:master, r=davidtwco
Replace the \01__gnu_mcount_nc to LLVM intrinsic for ARM

Current `-Zinstrument-mcount` for ARM32 use the `\01__gnu_mcount_nc` directly for its instrumentation function.

However, the LLVM does not use this mcount function directly, but it wraps it to intrinsic, `llvm.arm.gnu.eabi.mcount` and the transform pass also only handle the intrinsic.

As a result, current `-Zinstrument-mcount` not work on ARM32. Refer: https://github.com/namhyung/uftrace/issues/1764

This commit replaces the mcount name from native function to the LLVM intrinsic so that the transform pass can handle it.
2023-08-18 13:20:37 +00:00
bors
b9177c0adb Auto merge of #111908 - c410-f3r:yetegdfqwer, r=petrochenkov
[RFC-3086] Restrict the parsing of `count`

Fix #111904

The original RFC didn't mention the possibility of using `${count(t,)}` and such thing isn't very semantically accurate which can lead to confusion.
2023-08-18 11:32:56 +00:00
bors
0f7f6b7061 Auto merge of #114948 - compiler-errors:normalize-before-freeze, r=lcnr
Normalize before checking if local is freeze in `deduced_param_attrs`

Not normalizing the local type eagerly results in possibly exponential amounts of normalization happening downstream in `is_freeze_raw`.

Fixes #113372
2023-08-18 08:15:57 +00:00
Lukas Wirth
fb148f682e ignore-cross-compile on optimization-remarks-dir-pgo test 2023-08-18 09:41:08 +02:00
Nicholas Nethercote
9e22351c74 Rename NtOrTt as ParseNtResult.
It's more descriptive, and future-proofs it if/when additional variants
get added.
2023-08-18 16:50:41 +10:00
Nicholas Nethercote
3449304722 Make enum decoding errors more informative.
By printing the actual value, as long as the expected range. I found
this helpful when I encountered one of these errors.
2023-08-18 16:50:41 +10:00
Nicholas Nethercote
9167eea553 Use interpolated_or_expr_span in one suitable place. 2023-08-18 16:50:41 +10:00
Nicholas Nethercote
dee6c9241f Refactor interpolated_or_expr_span.
It's much more complicated than it needs to be, and it doesn't modify
the expression. We can do the `Result` handling outside of it, and
change it to just return a span.

Also fix an errant comma that makes the comment hard to read.
2023-08-18 16:50:41 +10:00
bors
a1e1dba9cc Auto merge of #114611 - nnethercote:type-system-chess, r=compiler-errors
Speed up compilation of `type-system-chess`

[`type-system-chess`](https://github.com/rust-lang/rustc-perf/pull/1680) is an unusual program that implements a compile-time chess position solver in the trait system(!)  This PR is about making it compile faster.

r? `@ghost`
2023-08-18 06:29:38 +00:00
bors
fe3eae3f31 Auto merge of #114938 - flip1995:clippy_backport, r=matthiaskrgr
Clippy backport

r? `@Manishearth`

This is the accompanying PR to https://github.com/rust-lang/rust/pull/114937. This needs to be merged before tomorrow, so that it gets into master, before beta is branched.

The second commit is pretty much an out-of cycle sync, so that we don't get backport-debt for next release cycle right away.

cc `@Mark-Simulacrum` also mentioning you here, to make sure this is included in the beta branching.
2023-08-18 02:06:50 +00:00
bors
9b4119009e Auto merge of #114951 - cuviper:rollup-iitoep5, r=cuviper
Rollup of 5 pull requests

Successful merges:

 - #113715 (Unstable Book: update `lang_items` page and split it)
 - #114897 (Partially revert #107200)
 - #114913 (Fix suggestion for attempting to define a string with single quotes)
 - #114931 (Revert PR #114052 to fix invalid suggestion)
 - #114944 (update `thiserror` to version >= 1.0.46)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-18 00:12:59 +00:00
Waffle Maybe
54bd826d56
Add waffle back to review rotation 2023-08-18 04:00:43 +04:00
Josh Stone
df877c0353
Rollup merge of #114944 - lqd:fix-thiserror, r=RalfJung
update `thiserror` to version >= 1.0.46

1.0.46 version is the one with [the workaround](https://github.com/dtolnay/thiserror/pull/248) for #114839. I'm also encountering this issue, so let's update the dependency so that everyone doesn't have to `./x clean`.

Fixes #114839.

r? `@RalfJung`
2023-08-17 15:40:09 -07:00
Josh Stone
5861815559
Rollup merge of #114931 - Urgau:revert-114052, r=compiler-errors
Revert PR #114052 to fix invalid suggestion

This PR reverts https://github.com/rust-lang/rust/pull/114052 to fix the invalid suggestion produced by the PR.

Unfortunately the invalid suggestion cannot be improved from the current position where it's emitted since we lack enough information (is an assignment?, left or right?, ...) to be able to fix it here. Furthermore the previous wasn't wrong, just suboptimal, contrary to the current one which is just wrong.

Added a regression test and commented out some code instead of removing it so we can use it later.

Reopens https://github.com/rust-lang/rust/issues/114050
Fixes https://github.com/rust-lang/rust/issues/114925
2023-08-17 15:40:09 -07:00
Josh Stone
7ea4de9632
Rollup merge of #114913 - beetrees:escape-double-quote, r=davidtwco
Fix suggestion for attempting to define a string with single quotes

Currently attempting to compile `fn main() { let _ = '\\"'; }` will result in the following error message:
```
error: character literal may only contain one codepoint
 --> src/main.rs:1:21
  |
1 | fn main() { let _ = '\\"'; }
  |                     ^^^^^
  |
help: if you meant to write a `str` literal, use double quotes
  |
1 | fn main() { let _ = "\\""; }
  |                     ~~~~~
```
The suggestion is invalid as it fails to escape the `"`. This PR fixes the suggestion so that it now reads:
```
help: if you meant to write a `str` literal, use double quotes
  |
1 | fn main() { let _ = "\\\""; }
  |                     ~~~~~~
```
The relevant test is also updated to ensure that this does not regress in future.
2023-08-17 15:40:09 -07:00
Josh Stone
4f14451d7c
Rollup merge of #114897 - joshtriplett:partial-revert-ok-0, r=m-ou-se
Partially revert #107200

`Ok(0)` is indeed something the caller may interpret as an error, but
that's the *correct* thing to return if the writer can't accept any more
bytes.
2023-08-17 15:40:08 -07:00
Josh Stone
cd50556e90
Rollup merge of #113715 - kadiwa4:lang_items_doc, r=JohnTitor
Unstable Book: update `lang_items` page and split it

[`lang_items` rendered](https://github.com/kadiwa4/rust/blob/lang_items_doc/src/doc/unstable-book/src/language-features/lang-items.md), [`start` rendered](https://github.com/kadiwa4/rust/blob/lang_items_doc/src/doc/unstable-book/src/language-features/start.md)
Closes #110274
Rustonomicon PR: rust-lang/nomicon#413, Rust Book PR: rust-lang/book#3705

A lot of information doesn't belong on the `lang_items` page. I added a separate page for the `start` feature and moved some text into the Rustonomicon because the `lang_items` page should not be a tutorial on how to build a `#![no_std]` executable.
The list of existing lang items is too long/unstable, so I removed it.

The doctests still don't work. :(
2023-08-17 15:40:08 -07:00
bors
ccc3ac0cae Auto merge of #114904 - cjgillot:no-ref-debuginfo, r=wesleywiser
Remove references in VarDebugInfo

The codegen implementation is broken, and attempted to read uninitialized memory.

Fixes https://github.com/rust-lang/rust/issues/114488
2023-08-17 22:22:06 +00:00
Michael Goulet
20c648c582 Normalize before checking if local is freeze in deduced_param_attrs 2023-08-17 14:33:24 -07:00
Rémy Rakic
df3819bd96 update thsiserror to release >= 1.0.46
this version is the one containing the workaround for the provider API
changes on nightly
2023-08-17 19:48:22 +00:00
Camille GILLOT
3798bca605 Bless codegen tests. 2023-08-17 18:28:33 +00:00
bors
0768872680 Auto merge of #114802 - chenyukang:yukang-fix-114979-bad-parens-dyn, r=estebank
Fix bad suggestion when wrong parentheses around a dyn trait

Fixes #114797
2023-08-17 17:54:50 +00:00
Camille GILLOT
b542c5526f Bless mir-opt tests. 2023-08-17 17:07:53 +00:00
Camille GILLOT
c535326537 Add test. 2023-08-17 17:02:04 +00:00
Camille GILLOT
933b618360 Revert "Implement references VarDebugInfo."
This reverts commit 2ec0071913.
2023-08-17 17:02:04 +00:00
ChoKyuWon
3bd54c14bc
Replace the \01__gnu_mcount_nc to LLVM intrinsic for ARM
Current `-Zinstrument-mcount` for ARM32 use the `\01__gnu_mcount_nc`
directly for its instrumentation function.

However, the LLVM does not use this mcount function directly, but it wraps
it to intrinsic, `llvm.arm.gnu.eabi.mcount` and the transform pass also
only handle the intrinsic.

As a result, current `-Zinstrument-mcount` not work on ARM32.
Refer: https://github.com/namhyung/uftrace/issues/1764

This commit replaces the mcount name from native function to the
LLVM intrinsic so that the transform pass can handle it.

Signed-off-by: ChoKyuWon <kyuwoncho18@gmail.com>
2023-08-18 01:52:40 +09:00
bors
ff89efeda2
Auto merge of #11314 - GuillaumeGomez:needless_ref_mut_async_block, r=Centri3
Correctly handle async blocks for NEEDLESS_PASS_BY_REF_MUT

Fixes https://github.com/rust-lang/rust-clippy/issues/11299.

The problem was that the `async block`s are popping a closure which we didn't go into, making it miss the mutable access to the variables.

cc `@Centri3`

changelog: none
2023-08-17 18:06:36 +02:00
bors
09d05c04da
Auto merge of #11070 - y21:issue11065, r=flip1995
[`useless_conversion`]: only lint on paths to fn items and fix FP in macro

Fixes #11065 (which is actually two issues: an ICE and a false positive)

It now makes sure that the function call path points to a function-like item (and not e.g. a `const` like in the linked issue), so that calling `TyCtxt::fn_sig` later in the lint does not ICE (fixes https://github.com/rust-lang/rust-clippy/issues/11065#issuecomment-1616836099).
It *also* makes sure that the expression is not part of a macro call (fixes https://github.com/rust-lang/rust-clippy/issues/11065#issuecomment-1616919639). ~~I'm not sure if there's a better way to check this other than to walk the parent expr chain and see if any of them are expansions.~~ (edit: it doesn't do this anymore)

changelog: [`useless_conversion`]: fix ICE when call receiver is a non-fn item
changelog: [`useless_conversion`]: don't lint if argument is a macro argument (fixes a FP)

r? `@llogiq` (reviewed #10814, which introduced these issues)
2023-08-17 18:06:36 +02:00
bors
4a0402cd80 Auto merge of #114932 - RalfJung:miri, r=RalfJung
update Miri

r? `@ghost`
2023-08-17 14:04:37 +00:00
Urgau
1c73248b67 Revert PR #114052 to fix invalid suggestion 2023-08-17 14:33:33 +02:00
Caio
6395dc2cde [RFC-3086] Restrict the parsing of count 2023-08-17 08:52:37 -03:00
bors
bd138e2ae1 Auto merge of #114799 - RalfJung:less-transmute, r=m-ou-se
avoid transmuting Box when we can just cast raw pointers instead

Always better to avoid a transmute, in particular when the layout assumptions it is making are not clearly documented. :)
2023-08-17 09:09:29 +00:00
bors
d4a881e143 Auto merge of #114922 - matthiaskrgr:rollup-qktdihi, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #112751 (rustdoc: Fixes with --test-run-directory and relative paths.)
 - #114749 (Update `mpsc::Sender` doc to reflect that it implements `Sync`)
 - #114876 (Don't ICE in `is_trivially_sized` when encountering late-bound self ty)
 - #114881 (clarify CStr lack of layout guarnatees)
 - #114921 (Remove Folyd from librustdoc static files)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-17 07:21:53 +00:00
Matthias Krüger
40edd35079
Rollup merge of #114921 - Folyd:Folyd-patch-1, r=compiler-errors
Remove Folyd from librustdoc static files

r?`@GuillaumeGomez`
2023-08-17 08:39:22 +02:00
Matthias Krüger
503a8fc92d
Rollup merge of #114881 - RalfJung:cstr, r=cuviper
clarify CStr lack of layout guarnatees

Follow-up to https://github.com/rust-lang/rust/pull/114800
r? `@cuviper`
2023-08-17 08:39:22 +02:00
Matthias Krüger
084c87dfea
Rollup merge of #114876 - compiler-errors:non-lifetime-binders-sized, r=wesleywiser
Don't ICE in `is_trivially_sized` when encountering late-bound self ty

We can see a bound ty var here:
b531630f42/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs (L13-L34)

Fixes #114872
2023-08-17 08:39:21 +02:00