Commit Graph

226500 Commits

Author SHA1 Message Date
yukang
2d27932b6c remove EarlySyntaxWarning for type ascription 2023-06-03 09:22:47 +08:00
yukang
b002c9ff11 remove type ascription feature gate 2023-06-03 09:22:47 +08:00
bors
7a0070eaea Auto merge of #112228 - compiler-errors:rollup-97i0pli, r=compiler-errors
Rollup of 6 pull requests

Successful merges:

 - #109609 (Separate AnonConst from ConstBlock in HIR.)
 - #112166 (bootstrap: Rename profile = user to profile = dist)
 - #112168 (Lower `unchecked_div`/`_rem` to MIR's `BinOp::Div`/`Rem`)
 - #112183 (Normalize anon consts in new solver)
 - #112211 (pass `--lib` to `x doc`)
 - #112223 (Don't ICE in new solver when auto traits have associated types)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-06-02 23:02:42 +00:00
Michael Goulet
18763cb464
Rollup merge of #112223 - compiler-errors:new-solver-auto-proj, r=BoxyUwU
Don't ICE in new solver when auto traits have associated types

People can write malformed auto traits, and that shouldn't cause the new solver to ICE
2023-06-02 16:02:07 -07:00
Michael Goulet
163ce686be
Rollup merge of #112211 - eval-exec:exec/fix-bootstrap-rustdoc, r=ozkanonur
pass `--lib` to `x doc`

This PR want to close #112082
2023-06-02 16:02:07 -07:00
Michael Goulet
e4a6b24245
Rollup merge of #112183 - compiler-errors:new-solver-anon-ct, r=BoxyUwU
Normalize anon consts in new solver

We don't do any of that `expand_abstract_consts` stuff so this isn't sufficient to make GCE work, but it does allow, e.g. `[(); 1]: Default`, to solve.

r? `@BoxyUwU`
2023-06-02 16:02:06 -07:00
Michael Goulet
5460f92a0f
Rollup merge of #112168 - scottmcm:lower-div-rem-unchecked-to-mir, r=oli-obk
Lower `unchecked_div`/`_rem` to MIR's `BinOp::Div`/`Rem`

As described in <https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.BinOp.html#variant.Div>, the ordinary `BinOp`s for these are already UB for division by zero ([or overflow](https://llvm.org/docs/LangRef.html#sdiv-instruction), [demo](https://rust.godbolt.org/z/71e7P7Exh)), as MIR building is responsible for inserting code to panic for those cases regardless of whether the overflow checks are enabled.

So we can lower these in the same arm that lowers `wrapping_add` to MIR `BinOp::Add` and such, as all these cases turn into ordinary `Rvalue::BinaryOp`s.
2023-06-02 16:02:06 -07:00
Michael Goulet
dd09f4d35c
Rollup merge of #112166 - AnakinSkywalkeer:master, r=clubby789
bootstrap: Rename profile = user to profile = dist

Fixes #112074
2023-06-02 16:02:05 -07:00
Michael Goulet
6c9b7d6cbf
Rollup merge of #109609 - cjgillot:split-anon-const, r=BoxyUwU
Separate AnonConst from ConstBlock in HIR.

Their behaviours are different enough to justify having separate nodes.
2023-06-02 16:02:05 -07:00
Michael Goulet
84196f3371 Elaborate comment, make sure we do normalizes-to hack eventually for IATs, don't partially support const projection for impls 2023-06-02 22:07:58 +00:00
Michael Goulet
8912015f71 No const equate in new solver 2023-06-02 22:07:57 +00:00
Michael Goulet
2c1473ca70 Normalize anon consts in new solver 2023-06-02 22:07:57 +00:00
Michael Goulet
4fbb43e70f No more TyCtxt::lazy_normalization 2023-06-02 22:07:57 +00:00
Camille GILLOT
ca4d0d4c24 Separate AnonConst from ConstBlock in HIR. 2023-06-02 21:25:18 +00:00
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