Commit Graph

226384 Commits

Author SHA1 Message Date
bors
7f3bfc6ae7 Auto merge of #14951 - HKalbasi:mir-fix, r=HKalbasi
Fix string pattern matching in mir interpreter
2023-06-02 20:16:28 +00:00
hkalbasi
aab7589c40 Fix string pattern matching in mir interpreter 2023-06-02 23:45:29 +03:30
bors
dd5d7c729d Auto merge of #112162 - nnethercote:clarify-mono-item-usage, r=wesleywiser
Clarify mono item usage

Some commits that make the terminology around mono items clearer, and simplify related data structures.

r? `@wesleywiser`
2023-06-02 19:53:32 +00:00
Michael Goulet
ecd7809784 Don't ICE in new solver when auto traits have associated types 2023-06-02 19:22:25 +00:00
Eval EXEC
8657a64a68
Add --lib to cargo doc 2023-06-03 01:58:48 +08:00
Arlo Siemsen
4d9b476bb1 Update dependencies with reported vulnerabilities
bumpalo 3.12.1 (yanked)
  * updated to 3.13.0
tokio 1.8.4 - https://rustsec.org/advisories/RUSTSEC-2023-0001
  * updated to 1.28.2
remove_dir_all 0.5.3 - https://rustsec.org/advisories/RUSTSEC-2023-0018
  * removed by using the standard library function in `rust-installer` instead and updating to `tempfile@3.5.0` (which also removes the dependency).
2023-06-02 12:34:01 -05:00
bors
794249d768 Auto merge of #112212 - matthiaskrgr:rollup-e5ilgf0, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #111647 (use c literals in compiler and library)
 - #112165 (Rename `impl_defaultness` to `defaultness`)
 - #112182 (CFI: Fix cfi with repr(transparent): transform_ty: unexpected Alias(Proj)
 - #112189 (Debug-assert that closures and generators are made with the right number of substitutions)
 - #112205 (Add rustdoc test for double-hyphen to dash doc comment conversion)
 - #112206 (Fix typo in `std::cell` module docs)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-02 16:53:40 +00:00
Michael Goulet
9f70efb31a only suppress coercion error if type is definitely unsized 2023-06-02 16:38:08 +00:00
Matthias Krüger
4435544c35
Rollup merge of #112206 - k0ur0x:typo, r=Nilstrieb
Fix typo in `std::cell` module docs
2023-06-02 18:12:47 +02:00
Matthias Krüger
5397b31744
Rollup merge of #112205 - GuillaumeGomez:double-hyphen-to-dash, r=notriddle
Add rustdoc test for double-hyphen to dash doc comment conversion

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

This PR adds a regression test for #64081 so the issue can be closed.

r? `@notriddle`
2023-06-02 18:12:46 +02:00
Matthias Krüger
82130eb9d2
Rollup merge of #112189 - compiler-errors:bad-gen, r=cjgillot
Debug-assert that closures and generators are made with the right number of substitutions

Just in case.
2023-06-02 18:12:46 +02:00
Matthias Krüger
ec51b15b81
Rollup merge of #112182 - rcvalle:rust-cfi-fix-111185, r=compiler-errors
CFI: Fix cfi with repr(transparent): transform_ty: unexpected Alias(Proj

Fixes https://github.com/rust-lang/rust/issues/111185 by normalizing ty::Alias before encoding.
2023-06-02 18:12:45 +02:00
Matthias Krüger
f121f77d8a
Rollup merge of #112165 - fee1-dead-contrib:rn-defualtness, r=compiler-errors
Rename `impl_defaultness` to `defaultness`

Since this isn't just about the `impl`.
2023-06-02 18:12:45 +02:00
Matthias Krüger
a3b639ce43
Rollup merge of #111647 - klensy:cstr, r=oli-obk
use c literals in compiler and library

Use c literals #108801 in compiler and library

currently blocked on:
* <strike>rustfmt: don't know how to format c literals</strike> nope, nightly one works.
* <strike>bootstrap</strike>

r? `@ghost`
`@rustbot` blocked
2023-06-02 18:12:45 +02:00
Florian Bartels
716cc5ac93 Only determine clock res once; give up before sleeping more than 1 second 2023-06-02 17:52:14 +02:00
Florian Bartels
d8f21101ec Remove "one thread in tests" limitation in nto-qnx.md 2023-06-02 16:12:21 +02:00
Florian Bartels
bdb475cf6c Retry to fork/spawn with exponential backoff 2023-06-02 16:12:21 +02:00
bors
a9baa16482 Auto merge of #112152 - jyn514:doc-msg, r=clubby789
Fix the progress message for `x doc rustc`

This makes it more clear that we're using stage 0 *to document* rustc, not that we're documenting stage0 rustc itself.

It also fixes a bug in `msg_sysroot_tool` that would print `Docing`, and removes the `Debug` impl for `Kind` to make sure it doesn't happen again.

Before:
```
Documenting stage0 compiler {rustc-main} (aarch64-apple-darwin)
```

After:
```
Documenting compiler {rustc-main} (stage0 -> stage1, aarch64-apple-darwin)
```

thanks `@BoxyUwU` for catching this!
2023-06-02 14:03:37 +00:00
bors
dfaca9398a Auto merge of #14950 - HKalbasi:render-const, r=HKalbasi
Support floating point intrinsics in const eval
2023-06-02 13:59:47 +00:00
hkalbasi
a6a27a7ff8 Support floating point intrinsics in const eval 2023-06-02 17:29:17 +03:30
bors
7738ff4927 Auto merge of #14945 - justahero:gh-14626, r=Veykril
Fix Assist "replace named generic type with impl trait"

This is a follow-up PR to fix the assist "replace named generic type with impl trait" described in #14626 to filter invalid param types. It integrates the feedback given in PR #14816 .

The change updates the logic to determine when a function parameter is safe to replace a type param with its trait implementation. Some parameter definitions are invalid & should not be replaced by their traits, therefore skipping the assist completely.

First, all usages of the generic type under the cursor are determined. These usage references are checked to see if they occur outside the function parameter list. If an outside reference is found, e.g. in body, return type or where clause, the assist is skipped. All remaining usages need to appear only in the function param list. For each usage the param type is further inspected to see if it's valid. The logic to determine if a function parameter is valid, follows a heuristic and may not cover all possible parameter definitions.

With this change the following param types (as given in [this comment](https://github.com/rust-lang/rust-analyzer/pull/14816#discussion_r1206834603)) are not replaced & therefore skip the assist.

```rust
fn foo<P: Trait>(
    _: <P as Trait>::Assoc,          // within path type qualifier
    _: <() as OtherTrait<P>>::Assoc, // same as above
    _: P::Assoc,                     // associated type shorthand
    _: impl OtherTrait<P>            // generic arg in impl trait (note that associated type bindings are fine)
    _: &dyn Fn(P)                    // param type and/or return type for Fn* traits
) {}
```
2023-06-02 13:09:31 +00:00
Kourosh
9df4572277
Fix typo in std::cell module docs 2023-06-02 15:30:40 +03:30
Guillaume Gomez
653f9c7f28 Add rustdoc test for double-hyphen to dash doc comment conversion 2023-06-02 13:51:01 +02:00
bors
0939ec13d8 Auto merge of #112203 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`
2023-06-02 10:55:54 +00:00
Sebastian Ziebell
c0e9b57371 Improve assist to filter invalid params
The change updates the logic to determine if a function parameter is
valid for replacing the type param with the trait implementation.

First all usages are determined, to check if they are used outside the function
parameter list. If an outside reference is found, e.g. in body, return type or
where clause, the assist is skipped. All remaining usages only appear in the
function param list. For each usage the param type is checked to see if
it's valid.

**Please note** the logic currently follows a heuristic and may not cover
all existing parameter declarations.

* determine valid usage references by checking ancestors (on AST level)
* split test into separate ones
2023-06-02 12:46:01 +02:00
bors
0677c204ca Auto merge of #14947 - HKalbasi:render-const, r=HKalbasi
Add enum, reference, array and slice to `render_const_scalar`
2023-06-02 10:18:36 +00:00
hkalbasi
f9e3b180b7 Add enum, reference, array and slice to render_const_scalar 2023-06-02 13:47:02 +03:30
Philipp Krones
612c342346
Update Cargo.lock 2023-06-02 11:42:42 +02:00
Philipp Krones
1c161271de
Merge commit '30448e8cf98d4754350db0c959644564f317bc0f' into clippyup 2023-06-02 11:41:57 +02:00
klensy
2f459f7f14 fix ptr cast 2023-06-02 11:26:34 +03:00
bors
30448e8cf9 Auto merge of #10871 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2023-06-02 08:22:37 +00:00
Philipp Krones
84f8ce801e
Bump Clippy version -> 0.1.72 2023-06-02 10:18:34 +02:00
Philipp Krones
dfdc25834e
Bump nightly version -> 2023-06-02 2023-06-02 10:18:17 +02:00
Philipp Krones
aa3247c891
Merge remote-tracking branch 'upstream/master' into rustup 2023-06-02 10:17:55 +02:00
bors
507055bc50 Auto merge of #2911 - RalfJung:rustup, r=RalfJung
Rustup
2023-06-02 08:09:48 +00:00
Ralf Jung
be4e05a190 fmt 2023-06-02 10:09:32 +02:00
Ralf Jung
c5aebfb934 Merge from rustc 2023-06-02 10:03:49 +02:00
Ralf Jung
777db72b08 Preparing for merge from rustc 2023-06-02 10:03:43 +02:00
bors
50ab3ce6c9 Auto merge of #10607 - beetrees:toml-spans, r=giraffate
Add spans to `clippy.toml` error messages

Adds spans to errors and warnings encountered when parsing `clippy.toml`.

changelog: Errors and warnings generated when parsing `clippy.toml` now point to the location in the TOML file the error/warning occurred.
2023-06-02 08:01:31 +00:00
bors
8ebf04225d Auto merge of #112198 - compiler-errors:rollup-o2xe4of, r=compiler-errors
Rollup of 7 pull requests

Successful merges:

 - #111670 (Require that const param tys implement `ConstParamTy`)
 - #111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…)
 - #112030 (Migrate `item_trait_alias` to Askama)
 - #112150 (Support 128-bit atomics on all x86_64 Apple targets)
 - #112174 (Fix broken link)
 - #112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.)
 - #112193 (Check tuple elements are `Sized` in `offset_of`)

Failed merges:

 - #112071 (Group rfcs tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-02 07:57:21 +00:00
Michael Goulet
ebb7f642e4
Rollup merge of #112193 - clubby789:offset-of-tuple-sized, r=est31
Check tuple elements are `Sized` in `offset_of`

Fixes #112186
2023-06-01 23:07:39 -07:00
Michael Goulet
2286046412
Rollup merge of #112190 - nnethercote:improve-comments-TyCtxt-GlobalCtxt, r=compiler-errors
Improve comments on `TyCtxt` and `GlobalCtxt`.

By adding some non-obvious information that took me a little while to figure out.

r? `@compiler-errors`
2023-06-01 23:07:39 -07:00
Michael Goulet
71982341b4
Rollup merge of #112174 - cuishuang:master, r=jyn514
Fix broken link

The previous link is no longer accessible.

Use the latest link.
2023-06-01 23:07:39 -07:00
Michael Goulet
fc557576a4
Rollup merge of #112150 - taiki-e:apple-atomic-128, r=Amanieu
Support 128-bit atomics on all x86_64 Apple targets

On x86_64, we currently set `max_atomic_width` to 128 only on macOS.

ad8304a0d5/compiler/rustc_target/src/spec/x86_64_apple_darwin.rs (L8)

However, other x86_64 Apple targets (iOS, tvOS, and watchOS) are also core2+ and support cmpxchg16b.

ad8304a0d5/compiler/rustc_target/src/spec/apple_base.rs (L71-L76)

```console
# Script to get targets that support cmpxchg16b by default:
$ (for target in $(rustc --print target-list); do [[ $target == "x86_64"* ]] && rustc --print cfg --target "$target" | grep -q cmpxchg16b && echo "$target"; done)
x86_64-apple-darwin
x86_64-apple-ios
x86_64-apple-ios-macabi
x86_64-apple-tvos
x86_64-apple-watchos-sim
x86_64h-apple-darwin
```

r? `@Amanieu`
2023-06-01 23:07:38 -07:00
Michael Goulet
8ceb283c92
Rollup merge of #112030 - sladyn98:item-trait-alias, r=GuillaumeGomez
Migrate `item_trait_alias` to Askama

This PR migrates `item_trait_alias` to Askama

Refers https://github.com/rust-lang/rust/issues/108868
2023-06-01 23:07:37 -07:00
Michael Goulet
ceec2250a3
Rollup merge of #111914 - rcvalle:rust-cfi-fix-111184, r=compiler-errors
CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…

Fixes https://github.com/rust-lang/rust/issues/111184 by encoding ty::Generator parent substs only.
2023-06-01 23:07:37 -07:00
Michael Goulet
24404e6409
Rollup merge of #111670 - compiler-errors:const-param-ty, r=BoxyUwU
Require that const param tys implement `ConstParamTy`

1. Require that const param tys implement `ConstParamTy` instead of using `search_for_adt_const_param_violation`
2. Add `StructuralPartialEq` as a supertrait for `ConstParamTy`, since we need to make sure that we derive *both* `PartialEq` and `Eq`
3. Implement `ConstParamTy` for tuples up to 12 (or whatever the default for tuples is)
4. Add some custom diagnostics to `ConstParamTy` errors, to avoid regressions from (1.). It's still not as great as it could be -- will point out inline in comments.

r? `@BoxyUwU`
2023-06-01 23:07:36 -07:00
bors
33c3d10128 Auto merge of #111677 - fee1-dead-contrib:rustc_const_eval-translatable, r=oli-obk,RalfJung
Use translatable diagnostics in `rustc_const_eval`

This PR:

* adds a `no_span` parameter to `note` / `help` attributes when using `Subdiagnostic` to allow adding notes/helps without using a span
* has minor tweaks and changes to error messages
2023-06-02 05:11:49 +00:00
Nicholas Nethercote
4f800b56d0 Clarify follow_inlining.
I found this confusing because it includes the root item, plus the
inlined items reachable from the root item. The new formulation
separates the two parts more clearly.
2023-06-02 13:07:30 +10:00
Nicholas Nethercote
3806bad6cf Simplify place_inlined_mono_items.
Currently it overwrites all the CGUs with new CGUs. But those new CGUs
are just copies of the old CGUs, possibly with some things added. This
commit changes things so that each CGU just gets added to in place,
which makes things simpler and clearer.
2023-06-02 13:07:30 +10:00