Commit Graph

220419 Commits

Author SHA1 Message Date
Eric Huss
2da2ade0f7 Rename tests to ensure they don't have overlapping names.
Some tests will delete their output directory before starting.
The output directory is based on the test names.
If one test is the prefix of another test, then when that test
starts, it could try to delete the output directory of the other
test with the longer path.
2023-03-22 21:12:40 -07:00
bors
8859fde21f Auto merge of #109497 - matthiaskrgr:rollup-6txuxm0, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #109373 (Set LLVM `LLVM_UNREACHABLE_OPTIMIZE` to `OFF`)
 - #109392 (Custom MIR: Allow optional RET type annotation)
 - #109394 (adapt tests/codegen/vec-shrink-panik for LLVM 17)
 - #109412 (rustdoc: Add GUI test for "Auto-hide item contents for large items" setting)
 - #109452 (Ignore the vendor directory for tidy tests.)
 - #109457 (Remove comment about reusing rib allocations)
 - #109461 (rustdoc: remove redundant `.content` prefix from span/a colors)
 - #109477 (`HirId` to `LocalDefId` cleanup)
 - #109489 (More general captures)
 - #109494 (Do not feed param_env for RPITITs impl side)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-22 21:35:02 +00:00
Matthias Krüger
6244b94377
Rollup merge of #109494 - spastorino:new-rpitit-18, r=compiler-errors
Do not feed param_env for RPITITs impl side

r? `@compiler-errors`

I don't think this needs more comments or things that we already have but please let me know if you want some comments or something else in this PR.
2023-03-22 20:08:05 +01:00
Matthias Krüger
9629156fc7
Rollup merge of #109489 - est31:generalize_captures, r=WaffleLapkin
More general captures

This avoids repetition of the binding.
2023-03-22 20:08:04 +01:00
Matthias Krüger
040001e7c1
Rollup merge of #109477 - lcnr:cleanup, r=cjgillot
`HirId` to `LocalDefId` cleanup

revival of the still relevant parts of #109125
2023-03-22 20:08:04 +01:00
Matthias Krüger
8139f47f43
Rollup merge of #109461 - notriddle:notriddle/css-content, r=GuillaumeGomez
rustdoc: remove redundant `.content` prefix from span/a colors

Reverts a1d4ebe496, as well as fixing the problem it solved with links losing their color.
2023-03-22 20:08:03 +01:00
Matthias Krüger
3712bfff1b
Rollup merge of #109457 - Veykril:ribstack, r=petrochenkov
Remove comment about reusing rib allocations

Perf indicates this to not be worth the complexity

cc #4948
2023-03-22 20:08:03 +01:00
Matthias Krüger
6673d0a534
Rollup merge of #109452 - jfgoog:ignore-vendor, r=ozkanonur
Ignore the vendor directory for tidy tests.

When running `x.py test` on a downloaded source distribution (e.g. https://static.rust-lang.org/dist/rustc-<version>-src.tar.gz), the crates in the vendor directory contain a number of executable files that cause the tidy test to fail with the following message:

tidy error: binary checked into source: <path>

I see 26 such errors with the 1.68.0 source distribution. A few of these are .rs source files with incorrect executable permission, but most are scripts that are correctly marked executable.
2023-03-22 20:08:02 +01:00
Matthias Krüger
a7570b022e
Rollup merge of #109412 - GuillaumeGomez:add-gui-test, r=notriddle
rustdoc: Add GUI test for "Auto-hide item contents for large items" setting

Part of https://github.com/rust-lang/rust/issues/66181.

The `browser-ui-test` version update is because there wasn't `null` check for attributes so I added it (PR is [here](https://github.com/GuillaumeGomez/browser-UI-test/pull/440)).

r? ``@notriddle``
2023-03-22 20:08:02 +01:00
Matthias Krüger
44942ad10f
Rollup merge of #109394 - krasimirgg:llvm-17-vec-panic, r=nikic
adapt tests/codegen/vec-shrink-panik for LLVM 17

After 0d4a709bb8 LLVM now doesn't generate references to panic_cannot_unwind:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/17978#0186ff55-ca6f-4bc5-b1ec-2622c77d0ed5/744-746

Adapted as suggested by ````@nikic```` on Zulip:
https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/a.20couple.20codegen.20test.20failures.20after.20llvm.200d4a709bb876824a/near/342664944
>Okay, so LLVM now realizes that double panic is not possible, so that's fine.
2023-03-22 20:08:01 +01:00
Matthias Krüger
9545ab8e12
Rollup merge of #109392 - cbeuw:composite-ret, r=JakobDegen
Custom MIR: Allow optional RET type annotation

This currently doesn't compile because the type of `RET` is inferred, which fails if RET is a composite type and fields are initialised separately.
```rust
#![feature(custom_mir, core_intrinsics)]
extern crate core;
use core::intrinsics::mir::*;
#[custom_mir(dialect = "runtime", phase = "optimized")]
fn fn0() -> (i32, bool) {
    mir! ({
        RET.0 = 0;
        RET.1 = true;
        Return()
    })
}
```
```
error[E0282]: type annotations needed
 --> src/lib.rs:8:9
  |
8 |         RET.0 = 0;
  |         ^^^ cannot infer type

For more information about this error, try `rustc --explain E0282`.
```

This PR allows the user to manually specify the return type with `type RET = ...;` if required:

```rust
#[custom_mir(dialect = "runtime", phase = "optimized")]
fn fn0() -> (i32, bool) {
    mir! (
        type RET = (i32, bool);
        {
            RET.0 = 0;
            RET.1 = true;
            Return()
        }
    )
}
```

The syntax is not optimal, I'm happy to see other suggestions. Ideally I wanted it to be a normal type annotation like `let RET: ...;`, but this runs into the multiple parsing options error during macro expansion, as it can be parsed as a normal `let` declaration as well.

r? ```@oli-obk``` or ```@tmiasko``` or ```@JakobDegen```
2023-03-22 20:08:01 +01:00
Matthias Krüger
56959e5fe3
Rollup merge of #109373 - ids1024:llvm-unreachable-optimize, r=ozkanonur
Set LLVM `LLVM_UNREACHABLE_OPTIMIZE` to `OFF`

This option was added to LLVM in https://reviews.llvm.org/D121750?id=416339. It makes `llvm_unreachable` in builds without assertions compile to an `LLVM_BUILTIN_TRAP` instead of `LLVM_BUILTIN_UNREACHABLE` (which causes undefined behavior and is equivalent to `std::hint::unreachable_unchecked`).

Having compiler bugs triggering undefined behavior generally seems undesirable and inconsistent with Rust's goals. There is a check in `src/tools/tidy/src/style.rs` to reject code using `llvm_unreachable`. But it is used a lot within LLVM itself.

For instance, this changes a failure I get compiling `libcore` for m68k from a `SIGSEGV` to `SIGILL`, which seems better though it still doesn't provide a useful message without switching to an LLVM build with asserts.

It may be best not to do this if it noticeably degrades compiler performance, but worthwhile if it doesn't do so in any significant way. I haven't looked into what benchmarks there are for Rustc. That should be considered before merging.
2023-03-22 20:08:00 +01:00
bors
a266f11990 Auto merge of #109496 - Dylan-DPC:rollup-u8rsi3h, r=Dylan-DPC
Rollup of 11 pull requests

Successful merges:

 - #100311 (Fix handling of trailing bare CR in str::lines)
 - #108997 (Change text -> rust highlighting in sanitizer.md)
 - #109179 (move Option::as_slice to intrinsic)
 - #109187 (Render source page layout with Askama)
 - #109280 (Remove `VecMap`)
 - #109295 (refactor `fn bootstrap::builder::Builder::compiler_for` logic)
 - #109312 (rustdoc: Cleanup parent module tracking for doc links)
 - #109317 (Update links for custom discriminants.)
 - #109405 (RPITITs are `DefKind::Opaque` with new lowering strategy)
 - #109414 (Do not consider synthesized RPITITs on missing items checks)
 - #109435 (Detect uninhabited types early in const eval)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-22 19:04:49 +00:00
Dylan DPC
eda88a30c7
Rollup merge of #109435 - oli-obk:🇨🇭🥚_copy_op, r=RalfJung
Detect uninhabited types early in const eval

r? `@RalfJung`

implements https://github.com/rust-lang/rust/pull/108442#discussion_r1143003840

this is a breaking change, as some UB during const eval is now detected instead of silently being ignored. Users can see this and other UB that may cause future breakage with `-Zextra-const-ub-checks` or just by running miri on their code, which sets that flag by default.
2023-03-23 00:00:35 +05:30
Dylan DPC
031640ccd2
Rollup merge of #109414 - spastorino:new-rpitit-16, r=compiler-errors
Do not consider synthesized RPITITs on missing items checks

Without this patch for `tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs` we get ...

```
warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
 --> tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs:4:12
  |
4 | #![feature(return_position_impl_trait_in_trait)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0046]: not all trait items implemented, missing: `foo`, ``
  --> tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs:12:1
   |
8  |     fn foo(&self) -> impl Sized;
   |     ----------------------------
   |     |                |
   |     |                `` from trait
   |     `foo` from trait
...
12 | impl MyTrait for i32 {
   | ^^^^^^^^^^^^^^^^^^^^ missing `foo`, `` in implementation

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0046`.
```

instead of ...

```
warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
  --> $DIR/dont-project-to-rpitit-with-no-value.rs:4:12
   |
LL | #![feature(return_position_impl_trait_in_trait)]
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
   = note: `#[warn(incomplete_features)]` on by default

error[E0046]: not all trait items implemented, missing: `foo`
  --> $DIR/dont-project-to-rpitit-with-no-value.rs:12:1
   |
LL |     fn foo(&self) -> impl Sized;
   |     ---------------------------- `foo` from trait
...
LL | impl MyTrait for i32 {
   | ^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0046`.
```

r? `@compiler-errors`
2023-03-23 00:00:35 +05:30
Dylan DPC
b9151b2d70
Rollup merge of #109405 - compiler-errors:rpitit-as-opaques, r=spastorino
RPITITs are `DefKind::Opaque` with new lowering strategy

r? `@spastorino`

Kinda cherry-picked #109400
2023-03-23 00:00:34 +05:30
Dylan DPC
8ce52b7b65
Rollup merge of #109317 - ehuss:discriminant-link-fix, r=Nilstrieb
Update links for custom discriminants.

The discriminant documentation was updated in https://github.com/rust-lang/reference/pull/1055 which changed the layout a bit. This updates the links to the updated locations.
2023-03-23 00:00:34 +05:30
Dylan DPC
af3bd22783
Rollup merge of #109312 - petrochenkov:docice5, r=GuillaumeGomez
rustdoc: Cleanup parent module tracking for doc links

Keep ids of the documented items themselves, not their parent modules. Parent modules can be retreived from those ids when necessary.

Fixes https://github.com/rust-lang/rust/issues/108501.
That issue could be fixed in a more local way, but this refactoring is something that I wanted to do since https://github.com/rust-lang/rust/pull/93805 anyway.
2023-03-23 00:00:33 +05:30
Dylan DPC
7a57d8883e
Rollup merge of #109295 - ozkanonur:issue-109286, r=ozkanonur
refactor `fn bootstrap::builder::Builder::compiler_for` logic

- check compiler stage before forcing for stage2.
- check if download_rustc is not set before forcing for stage1.

resolves #109286
2023-03-23 00:00:33 +05:30
Dylan DPC
70918ecf06
Rollup merge of #109280 - compiler-errors:no-vec-map, r=Mark-Simulacrum
Remove `VecMap`

Not sure what the use of this data structure is over just using `FxIndexMap` or a `Vec`.

r? ```@ghost```
2023-03-23 00:00:32 +05:30
Dylan DPC
d8543abc55
Rollup merge of #109187 - clubby789:askama-source, r=GuillaumeGomez
Render source page layout with Askama

~~I was looking at making `code_html` render into the buffer instead of in advance, but it turned out to need a pretty big refactor, so starting with rearranging the high-level layout.~~
Found another approach which required much less changes

cc #108868
2023-03-23 00:00:32 +05:30
Dylan DPC
14d06467f0
Rollup merge of #109179 - llogiq:intrinsically-option-as-slice, r=eholk
move Option::as_slice to intrinsic

````@scottmcm```` suggested on #109095 I use a direct approach of unpacking the operation in MIR lowering, so here's the implementation.

cc ````@nikic```` as this should hopefully unblock #107224 (though perhaps other changes to the prior implementation, which I left for bootstrapping, are needed).
2023-03-23 00:00:31 +05:30
Dylan DPC
59d9cbfa14
Rollup merge of #108997 - tgross35:patch-1, r=JohnTitor
Change text -> rust highlighting in sanitizer.md

Not sure why this has syntax highlighting turned off, but it doesn't need to be

Relevant page: https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html
2023-03-23 00:00:30 +05:30
Dylan DPC
d694f47baa
Rollup merge of #100311 - xfix:lines-fix-handling-of-bare-cr, r=ChrisDenton
Fix handling of trailing bare CR in str::lines

Continuing from #91191.

Fixes #94435.
2023-03-23 00:00:30 +05:30
Santiago Pastorino
1c9ad28dd2
Do not feed param_env for RPITITs impl side 2023-03-22 14:06:22 -03:00
est31
edd7d4a9f7 More general captures
This avoids repetition
2023-03-22 15:39:24 +01:00
bors
439292bc79 Auto merge of #109163 - hi-rustin:rustin-patch-dockerfile, r=Mark-Simulacrum
Add RANLIB_x86_64_unknown_illumos env for dist-x86_64-illumos dockerfile

close https://github.com/rust-lang/cc-rs/issues/798

We already set `AR_x86_64_unknown_illumos` in the dockerfile. So it is reasonable to set the `RANLIB_x86_64_unknown_illumos`.
2023-03-22 11:45:52 +00:00
Lukas Wirth
204807d8a9 Remove comment about re-using Rib allocations 2023-03-22 12:09:19 +01:00
lcnr
0882def9aa review 2023-03-22 11:58:08 +01:00
lcnr
45b44c7758 HirId to LocalDefId cleanup 2023-03-22 10:36:30 +01:00
bors
6502613a81 Auto merge of #109073 - michaelwoerister:limit-mingw-llvm-link-jobs, r=Mark-Simulacrum
Limit the number of parallel link jobs during LLVM build for mingw.

This PR is an attempt to unblock https://github.com/rust-lang/rust/pull/108355, which keeps failing while trying to link various LLVM artifacts on mingw runners. It looks like doing too many linking jobs might put too much load on the system? (Although I don't understand why the jobs are only failing for #108355 while they seem to pass for others)

r? infra-ci
2023-03-22 09:15:00 +00:00
bors
9bdb4881c7 Auto merge of #109119 - lcnr:trait-system-cleanup, r=compiler-errors
a general type system cleanup

removes the helper functions `traits::fully_solve_X` as they add more complexity then they are worth. It's confusing which of these helpers should be used in which context.

changes the way we deal with overflow to always add depth in `evaluate_predicates_recursively`. It may make sense to actually fully transition to not have `recursion_depth` on obligations but that's probably a bit too much for this PR.

also removes some other small - and imo unnecessary - helpers.

r? types
2023-03-22 05:33:18 +00:00
Trevor Gross
df034b06b7 Change text -> rust,ignore highlighting in sanitizer.md
Marked ignore due to difficulty getting doctests to pass cross-platform
2023-03-22 01:11:39 -04:00
bors
5fa73a75ce Auto merge of #109087 - cjgillot:sparse-bb-clear, r=davidtwco
Only clear written-to locals in ConstProp

This aims to revert the regression in https://github.com/rust-lang/rust/pull/108872

Clearing all locals at the end of each bb is very costly.
This PR goes back to the original implementation of recording which locals are modified.
2023-03-22 02:49:04 +00:00
bors
6dc3999c26 Auto merge of #109463 - weihanglo:update-cargo, r=weihanglo
Update cargo

11 commits in 4a3c588b1f0a8e2dc8dd8789dbf3b6a71b02ed49..15d090969743630bff549a1b068bcaa8174e5ee3
2023-03-14 14:05:36 +0000 to 2023-03-21 17:54:28 +0000
- docs(contrib): Move higher level resolver docs into doc comments (rust-lang/cargo#11870)
- docs(contrib): Pull impl info out of architecture (rust-lang/cargo#11869)
- Update curl-sys (rust-lang/cargo#11871)
- Poll loop fixes (rust-lang/cargo#11624)
- clippy: warn `disallowed_methods` for `std::env::var` and friends (rust-lang/cargo#11828)
- Add --ignore-rust-version flag to cargo install (rust-lang/cargo#11859)
- Handle case mismatches when looking up env vars in the Config snapshot (rust-lang/cargo#11824)
- align semantics of generated vcs ignore files (rust-lang/cargo#11855)
- Add more information to wait-for-publish (rust-lang/cargo#11713)
- docs: Address warnings (rust-lang/cargo#11856)
- docs(contrib): Create a file overview in the nightly docs (rust-lang/cargo#11850)
2023-03-22 00:18:44 +00:00
Michael Goulet
c3e6f68931 RPITITs are DefKind::Opaque with new lowering strategy 2023-03-21 23:36:07 +00:00
Santiago Pastorino
c1f3529c91 Always encode RPITITs 2023-03-21 23:35:46 +00:00
Weihang Lo
30cef3a292
Update cargo 2023-03-22 07:22:51 +08:00
Michael Howell
9852980594 rustdoc: remove redundant .content prefix from span/a colors
Reverts a1d4ebe496, as well as
fixing the problem it solved with links losing their color.
2023-03-21 15:39:21 -07:00
bors
1db9c061d3 Auto merge of #109453 - matthiaskrgr:rollup-odn02wu, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #96391 (Windows: make `Command` prefer non-verbatim paths)
 - #108164 (Drop all messages in bounded channel when destroying the last receiver)
 - #108729 (fix: modify the condition that `resolve_imports` stops)
 - #109336 (Constrain const vars to error if const types are mismatched)
 - #109403 (Avoid ICE of attempt to add with overflow in emitter)
 - #109415 (Refactor `handle_missing_lit`.)
 - #109441 (Only implement Fn* traits for extern "Rust" safe function pointers and items)
 - #109446 (Do not suggest bounds restrictions for synthesized RPITITs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-21 20:56:38 +00:00
Santiago Pastorino
364a5d4b54
Do not consider synthesized RPITITs on missing items checks 2023-03-21 15:44:12 -03:00
bors
77d50a8870 Auto merge of #109092 - compiler-errors:local-key, r=cjgillot
Make local query providers receive local keys

When a query is marked `separate_provide_extern`, we can map a query key to a "local" form of the key, e.g. `DefId` -> `LocalDefId`. This simplifies a ton of code which either has to assert or use something like `expect_local` to assert that the query key is local.
2023-03-21 18:24:44 +00:00
Matthias Krüger
94d2028abd
Rollup merge of #109446 - spastorino:new-rpitit-17, r=compiler-errors
Do not suggest bounds restrictions for synthesized RPITITs

Before this PR we were getting ...

```
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
 --> tests/ui/async-await/in-trait/missing-send-bound.rs:5:12
  |
5 | #![feature(async_fn_in_trait)]
  |            ^^^^^^^^^^^^^^^^^
  |
  = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
  = note: `#[warn(incomplete_features)]` on by default

error: future cannot be sent between threads safely
  --> tests/ui/async-await/in-trait/missing-send-bound.rs:17:20
   |
17 |     assert_is_send(test::<T>());
   |                    ^^^^^^^^^^^ future returned by `test` is not `Send`
   |
   = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`
note: future is not `Send` as it awaits another future which is not `Send`
  --> tests/ui/async-await/in-trait/missing-send-bound.rs:13:5
   |
13 |     T::bar().await;
   |     ^^^^^^^^ await occurs here on type `impl Future<Output = ()>`, which is not `Send`
note: required by a bound in `assert_is_send`
  --> tests/ui/async-await/in-trait/missing-send-bound.rs:21:27
   |
21 | fn assert_is_send(_: impl Send) {}
   |                           ^^^^ required by this bound in `assert_is_send`
help: consider further restricting the associated type
   |
16 | fn test2<T: Foo>() where impl Future<Output = ()>: Send {
   |                    ++++++++++++++++++++++++++++++++++++

error: aborting due to previous error; 1 warning emitted
```

and we want this output ...

```
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
  --> $DIR/missing-send-bound.rs:5:12
   |
LL | #![feature(async_fn_in_trait)]
   |            ^^^^^^^^^^^^^^^^^
   |
   = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
   = note: `#[warn(incomplete_features)]` on by default

error: future cannot be sent between threads safely
  --> $DIR/missing-send-bound.rs:17:20
   |
LL |     assert_is_send(test::<T>());
   |                    ^^^^^^^^^^^ future returned by `test` is not `Send`
   |
   = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`
note: future is not `Send` as it awaits another future which is not `Send`
  --> $DIR/missing-send-bound.rs:13:5
   |
LL |     T::bar().await;
   |     ^^^^^^^^ await occurs here on type `impl Future<Output = ()>`, which is not `Send`
note: required by a bound in `assert_is_send`
  --> $DIR/missing-send-bound.rs:21:27
   |
LL | fn assert_is_send(_: impl Send) {}
   |                           ^^^^ required by this bound in `assert_is_send`

error: aborting due to previous error; 1 warning emitted
```

r? `@compiler-errors`
2023-03-21 19:00:15 +01:00
Matthias Krüger
fef1fc4349
Rollup merge of #109441 - oli-obk:fn_trait_new_solver, r=compiler-errors
Only implement Fn* traits for extern "Rust" safe function pointers and items

Since calling the function via an `Fn` trait will assume `extern "Rust"` ABI and not do any safety checks, only safe `extern "Rust"` function can implement the `Fn` traits. This syncs the logic between the old solver and the new solver.

r? `@compiler-errors`
2023-03-21 19:00:14 +01:00
Matthias Krüger
96f35ed720
Rollup merge of #109415 - nnethercote:refactor-handle_missing_lit, r=petrochenkov
Refactor `handle_missing_lit`.

A small code readability improvement.

r? ```@petrochenkov```
2023-03-21 19:00:14 +01:00
Matthias Krüger
25b062d586
Rollup merge of #109403 - chenyukang:yukang/fix-109396, r=estebank
Avoid ICE of attempt to add with overflow in emitter

Fixes #109396
r? ```@estebank```
2023-03-21 19:00:13 +01:00
Matthias Krüger
081c607b0a
Rollup merge of #109336 - compiler-errors:constrain-to-ct-err, r=BoxyUwU
Constrain const vars to error if const types are mismatched

When equating two consts of different types, if either are const variables, constrain them to the correct const error kind.

This helps us avoid "successfully" matching a const against an impl signature but leaving unconstrained const vars, which will lead to incremental ICEs when we call const-eval queries during const projection.

Fixes #109296

The second commit in the stack fixes a regression in the first commit where we end up mentioning `[const error]` in an impl overlap error message. I think the error message changes for the better, but I could implement alternative strategies to avoid this without delaying the overlap error message...

r? `@BoxyUwU`
2023-03-21 19:00:12 +01:00
Matthias Krüger
ee330a3ff5
Rollup merge of #108729 - bvanjoi:fix-issue-97534, r=petrochenkov
fix: modify the condition that `resolve_imports` stops

close #97534
2023-03-21 19:00:12 +01:00
Matthias Krüger
93a82a44a1
Rollup merge of #108164 - joboet:discard_messages_mpmc_array, r=Amanieu
Drop all messages in bounded channel when destroying the last receiver

Fixes #107466 by splitting the `disconnect` function for receivers/transmitters and dropping all messages in `disconnect_receivers` like the unbounded channel does. Since all receivers must be dropped before the channel is, the messages will already be discarded at that point, so the `Drop` implementation for the channel can be removed.

``@rustbot`` label +T-libs +A-concurrency
2023-03-21 19:00:11 +01:00
Matthias Krüger
1a43859a74
Rollup merge of #96391 - ChrisDenton:command-non-verbatim, r=joshtriplett
Windows: make `Command` prefer non-verbatim paths

When spawning Commands, the path we use can end up being queried using `env::current_exe` (or the equivalent in other languages). Not all applications handle these paths properly therefore we should have a stronger preference for non-verbatim paths when spawning processes.
2023-03-21 19:00:10 +01:00