]> git.lizzy.rs Git - rust.git/log
rust.git
20 months agoRollup merge of #104906 - spastorino:remove-ascribeusertypecx, r=compiler-errors
Matthias Krüger [Sat, 26 Nov 2022 09:39:12 +0000 (10:39 +0100)]
Rollup merge of #104906 - spastorino:remove-ascribeusertypecx, r=compiler-errors

Remove AscribeUserTypeCx

r? ``@compiler-errors``

This basically inlines `AscribeUserTypeCx::relate_mir_and_user_ty` into `type_op_ascribe_user_type_with_span` which is the only place where it's used and makes direct use of `ObligationCtxt` API.

20 months agoRollup merge of #104899 - notriddle:notriddle/help-dt, r=GuillaumeGomez
Matthias Krüger [Sat, 26 Nov 2022 09:39:12 +0000 (10:39 +0100)]
Rollup merge of #104899 - notriddle:notriddle/help-dt, r=GuillaumeGomez

rustdoc: remove no-op CSS `#help dt { display: block }`

`display: block` is the [default UA style] for dt.

[default UA style]: https://html.spec.whatwg.org/multipage/rendering.html#lists

20 months agoRollup merge of #104880 - krasimirgg:llvm-16-ctx, r=cuviper
Matthias Krüger [Sat, 26 Nov 2022 09:39:11 +0000 (10:39 +0100)]
Rollup merge of #104880 - krasimirgg:llvm-16-ctx, r=cuviper

[llvm-wrapper] adapt for LLVM API change

Adapt for the LLVM API changes from https://github.com/llvm/llvm-project/commit/721f975d3518403502f770ce11f3f02509b30c5b.

Found via our experimental rust + llvm @ HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/15203#0184ae73-5169-4b9b-92f4-d4e6e9b86ad9/194-531

20 months agoRollup merge of #104839 - HintringerFabian:docs_array_from_fn, r=scottmcm
Matthias Krüger [Sat, 26 Nov 2022 09:39:11 +0000 (10:39 +0100)]
Rollup merge of #104839 - HintringerFabian:docs_array_from_fn, r=scottmcm

improve array_from_fn documenation

Improves array::from_fn documentation
Fixes #102609

There were also unresolved comments from [this PR #100462](https://github.com/rust-lang/rust/pull/100462), which have been added to my PR

20 months agoRollup merge of #104675 - SarthakSingh31:issue-101666, r=jyn514
Matthias Krüger [Sat, 26 Nov 2022 09:39:10 +0000 (10:39 +0100)]
Rollup merge of #104675 - SarthakSingh31:issue-101666, r=jyn514

Unsupported query error now specifies if its unsupported for local or external crate

Fixes #101666.
I had to move `keys.rs` from `rustc_query_impl` to `rustc_middle`. I don't know if that is problematic. I couldn't think of any other way to get the needed information inside `rustc_middle`.

r? ```@jyn514```

20 months agoRollup merge of #104121 - Lokathor:mir-opt-when-instruction-set-missing-on-callee...
Matthias Krüger [Sat, 26 Nov 2022 09:39:10 +0000 (10:39 +0100)]
Rollup merge of #104121 - Lokathor:mir-opt-when-instruction-set-missing-on-callee, r=tmiasko

Refine `instruction_set` MIR inline rules

Previously an exact match of the `instruction_set` attribute was required for an MIR inline to be considered. This change checks for an exact match *only* if the callee sets an `instruction_set` in the first place. When the callee does not declare an instruction set then it is considered to be platform agnostic code and it's allowed to be inline'd into the caller.

cc ``@oli-obk``

[Edit] Zulip Context: https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/What.20exactly.20does.20the.20MIR.20optimizer.20do.3F

20 months agoRemove redundant `all` in cfg
Chris Denton [Sat, 26 Nov 2022 09:31:40 +0000 (09:31 +0000)]
Remove redundant `all` in cfg

20 months agoAuto merge of #103556 - clubby789:specialize-option-partial-eq, r=scottmcm
bors [Sat, 26 Nov 2022 08:56:20 +0000 (08:56 +0000)]
Auto merge of #103556 - clubby789:specialize-option-partial-eq, r=scottmcm

Manually implement PartialEq for Option<T> and specialize non-nullable types

This PR manually implements `PartialEq` and `StructuralPartialEq` for `Option`, which seems to produce slightly better codegen than the automatically derived implementation.

It also allows specializing on the `core::num::NonZero*` and `core::ptr::NonNull` types, taking advantage of the niche optimization by transmuting the `Option<T>` to `T` to be compared directly, which can be done in just two instructions.

A comparison of the original, new and specialized code generation is available [here](https://godbolt.org/z/dE4jxdYsa).

20 months agoAuto merge of #104730 - petrochenkov:modchild5, r=cjgillot
bors [Sat, 26 Nov 2022 05:41:34 +0000 (05:41 +0000)]
Auto merge of #104730 - petrochenkov:modchild5, r=cjgillot

rustc_metadata: Switch module children decoding to an iterator

Previously https://github.com/rust-lang/rust/pull/103578, https://github.com/rust-lang/rust/pull/103524 and previous PRs simplified it as much as possible.

A couple of cleanup commits is also added.
r? `@cjgillot`

20 months agoDo not record unresolved const vars in generator interior
Michael Goulet [Wed, 23 Nov 2022 19:38:22 +0000 (19:38 +0000)]
Do not record unresolved const vars in generator interior

20 months agoRemove unnecessary binder from get_impl_future_output_ty
Michael Goulet [Sat, 26 Nov 2022 00:46:09 +0000 (00:46 +0000)]
Remove unnecessary binder from get_impl_future_output_ty

20 months agosimplify some binder shifting logic
Michael Goulet [Sat, 26 Nov 2022 05:11:06 +0000 (05:11 +0000)]
simplify some binder shifting logic

20 months agorustdoc: use flexbox CSS to align sidebar button instead of position
Michael Howell [Sat, 26 Nov 2022 05:06:22 +0000 (22:06 -0700)]
rustdoc: use flexbox CSS to align sidebar button instead of position

This accomplishes the same thing with significantly less code.

20 months agoAuto merge of #104431 - alistair23:alistair/rv64-profiler, r=Mark-Simulacrum
bors [Sat, 26 Nov 2022 02:43:08 +0000 (02:43 +0000)]
Auto merge of #104431 - alistair23:alistair/rv64-profiler, r=Mark-Simulacrum

Enable profiler in dist-riscv64-linux

Build the profiler runtime to allow using -C profile-generate and -C instrument-coverage on riscv64-linux.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
20 months agojsondoclint: Accept trait alias is places where trait expected.
Nixon Enraght-Moony [Sat, 26 Nov 2022 01:40:08 +0000 (01:40 +0000)]
jsondoclint: Accept trait alias is places where trait expected.

Closes #104923

20 months agoAllow non-org members to label `requires-debug-assertions`
Michael Goulet [Sat, 26 Nov 2022 00:06:52 +0000 (16:06 -0800)]
Allow non-org members to label `requires-debug-assertions`

jruderman tried to add this in #104916, for example. I think I've seen this happen before as well.

20 months agoDon't use `Take` in `SpecExtend` impl
Markus Everling [Fri, 25 Nov 2022 13:47:58 +0000 (14:47 +0100)]
Don't use `Take` in `SpecExtend` impl

20 months agoRemove SelectionContext::infcx() in favor of field access
Michael Goulet [Fri, 25 Nov 2022 23:31:28 +0000 (23:31 +0000)]
Remove SelectionContext::infcx() in favor of field access

20 months agoAuto merge of #99798 - JulianKnodt:ac1, r=BoxyUwU
bors [Fri, 25 Nov 2022 22:56:59 +0000 (22:56 +0000)]
Auto merge of #99798 - JulianKnodt:ac1, r=BoxyUwU

Add `ConstKind::Expr`

Starting to implement `ty::ConstKind::Abstract`, most of the match cases are stubbed out, some I was unsure what to add, others I didn't want to add until a more complete implementation was ready.

r? `@lcnr`

20 months agoRefine instruction_set inline rules
Lokathor [Mon, 7 Nov 2022 19:07:07 +0000 (12:07 -0700)]
Refine instruction_set inline rules

Previously an exact match of the `instruction_set` attribute was required for an MIR inline to be considered. This change checks for an exact match *only* if the callee sets an `instruction_set` in the first place. When the callee does not declare an instruction set then it is considered to be platform agnostic code and it's allowed to be inline'd into the caller.

20 months agoRename normalize_opaque_types to reveal_opaque_types_in_bounds
Michael Goulet [Fri, 25 Nov 2022 19:30:37 +0000 (19:30 +0000)]
Rename normalize_opaque_types to reveal_opaque_types_in_bounds

20 months agoAuto merge of #104902 - matthiaskrgr:rollup-oo27a4u, r=matthiaskrgr
bors [Fri, 25 Nov 2022 19:09:30 +0000 (19:09 +0000)]
Auto merge of #104902 - matthiaskrgr:rollup-oo27a4u, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #104716 (move 2 candidates into builtin candidate)
 - #104760 (Clarify `SyntaxExtensionKind::LegacyDerive`.)
 - #104797 (rustc_codegen_ssa: write `.dwp` in a streaming fashion)
 - #104835 (Use infcx.partially_normalize_associated_types_in)
 - #104853 (Fix typo in miri sysroot)
 - #104879 (jsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath)
 - #104887 (rustbuild: Don't build doc::SharedAssets when building JSON docs.)
 - #104896 (rustdoc: fix broken tooltip CSS)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

20 months agoDefine all clauses as dummy_with_span as the usages are all equivalent
Santiago Pastorino [Fri, 25 Nov 2022 18:36:15 +0000 (15:36 -0300)]
Define all clauses as dummy_with_span as the usages are all equivalent

20 months agoRemove AscribeUserTypeCx
Santiago Pastorino [Fri, 25 Nov 2022 18:07:19 +0000 (15:07 -0300)]
Remove AscribeUserTypeCx

20 months agoUse None when the stack is empty
Ben Kimock [Fri, 25 Nov 2022 18:12:43 +0000 (13:12 -0500)]
Use None when the stack is empty

20 months agoRollup merge of #104896 - notriddle:notriddle/tooltip, r=GuillaumeGomez
Matthias Krüger [Fri, 25 Nov 2022 17:35:42 +0000 (18:35 +0100)]
Rollup merge of #104896 - notriddle:notriddle/tooltip, r=GuillaumeGomez

rustdoc: fix broken tooltip CSS

text `#ffffff` on background `#fdffd3` fails the [WCAG color contrast checker], and seems like a mistake in https://github.com/rust-lang/rust/commit/16b55903ee16503e7026677c169727d1907704c2.

Making the cursor a pointer is misleading, since clicking it doesn't do anything.

[WCAG color contrast checker]: https://accessibleweb.com/color-contrast-checker/

20 months agoRollup merge of #104887 - aDotInTheVoid:rustbuild-json-doc-shared-assets, r=jyn514
Matthias Krüger [Fri, 25 Nov 2022 17:35:42 +0000 (18:35 +0100)]
Rollup merge of #104887 - aDotInTheVoid:rustbuild-json-doc-shared-assets, r=jyn514

rustbuild: Don't build doc::SharedAssets when building JSON docs.

Previously, running `./x doc library/core/ --json` on a plain build would panic bootstrap.

```
$ ./x doc library/core/ --json
Building rustbuild
    Blocking waiting for file lock on package cache
   Compiling bootstrap v0.0.0 (/home/nixon/dev/rust/rust/src/bootstrap)
    Finished dev [unoptimized] target(s) in 4.47s
thread 'main' panicked at 'fs::write(&version_info, &info) failed with No such file or directory (os error 2) ("/home/nixon/dev/rust/rust/build/x86_64-unknown-linux-gnu/doc/version_info.html")', doc.rs:410:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:04
```

Becuase the `SharedAssets` step assumes that the HTML out dir has been created. This isn't true for JSON.

The fix is to not build shared assets when doing a JSON doc build, as it doesn't need them.

r? ``@jyn514``

``@rustbot`` modify labels: +A-rustdoc-json

20 months agoRollup merge of #104879 - aDotInTheVoid:jsondoclint-typedef, r=GuillaumeGomez
Matthias Krüger [Fri, 25 Nov 2022 17:35:42 +0000 (18:35 +0100)]
Rollup merge of #104879 - aDotInTheVoid:jsondoclint-typedef, r=GuillaumeGomez

jsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath

Closes #104851

r? ``@GuillaumeGomez``

``@rustbot`` modify labels: +A-testsuite

20 months agoRollup merge of #104853 - jyn514:sysroot-typo, r=RalfJung
Matthias Krüger [Fri, 25 Nov 2022 17:35:41 +0000 (18:35 +0100)]
Rollup merge of #104853 - jyn514:sysroot-typo, r=RalfJung

Fix typo in miri sysroot

r? ``@RalfJung``

20 months agoRollup merge of #104835 - spastorino:use-partially_normalize_associated_types_in...
Matthias Krüger [Fri, 25 Nov 2022 17:35:41 +0000 (18:35 +0100)]
Rollup merge of #104835 - spastorino:use-partially_normalize_associated_types_in, r=lcnr

Use infcx.partially_normalize_associated_types_in

r? ``@lcnr``

20 months agoRollup merge of #104797 - weihanglo:stream-write-dwp, r=jackh726
Matthias Krüger [Fri, 25 Nov 2022 17:35:40 +0000 (18:35 +0100)]
Rollup merge of #104797 - weihanglo:stream-write-dwp, r=jackh726

rustc_codegen_ssa: write `.dwp` in a streaming fashion

When writing a `.dwp` file, rustc writes to a Vec first then to a BufWriter-wrapped file. It seems very likely that we can write in a streaming fashion to avoid double buffering in an intermediate Vec.

On my Linux machine, `.dwp` from the latest rust-lang/cargo is 113MiB. It may worth a stream writer, though I didn't do any benchmark 🙇🏾‍♂️.

20 months agoRollup merge of #104760 - nnethercote:rm-LegacyDerive, r=petrochenkov
Matthias Krüger [Fri, 25 Nov 2022 17:35:39 +0000 (18:35 +0100)]
Rollup merge of #104760 - nnethercote:rm-LegacyDerive, r=petrochenkov

Clarify `SyntaxExtensionKind::LegacyDerive`.

It's always treated the same as `SyntaxExtensionKind::Derive`.

20 months agoRollup merge of #104716 - lcnr:selection-candidate, r=jackh726
Matthias Krüger [Fri, 25 Nov 2022 17:35:39 +0000 (18:35 +0100)]
Rollup merge of #104716 - lcnr:selection-candidate, r=jackh726

move 2 candidates into builtin candidate

having separate candidates for these isn't too helpful i think

r? types

20 months agoTest a small cargo-miri smoke test even in `run_tests_minimal`
Nilstrieb [Thu, 24 Nov 2022 20:22:12 +0000 (21:22 +0100)]
Test a small cargo-miri smoke test even in `run_tests_minimal`

This makes sure that cargo-miri works on all targets.

20 months agorustdoc: remove no-op CSS `#help dt { display: block }`
Michael Howell [Fri, 25 Nov 2022 17:07:21 +0000 (10:07 -0700)]
rustdoc: remove no-op CSS `#help dt { display: block }`

`display: block` is the [default UA style] for dt.

[default UA style]: https://html.spec.whatwg.org/multipage/rendering.html#lists

20 months agorustdoc: revert tooltip background color on light theme to readable
Michael Howell [Fri, 25 Nov 2022 16:17:58 +0000 (09:17 -0700)]
rustdoc: revert tooltip background color on light theme to readable

text #fff on background #fdffd3 fails the [WCAG color contrast checker], and
seems like a mistake in 16b55903ee16503e7026677c169727d1907704c2.

[WCAG color contrast checker]: https://accessibleweb.com/color-contrast-checker/

20 months agorustdoc: remove `cursor: pointer` from unclickable tooltip
Michael Howell [Fri, 25 Nov 2022 16:16:27 +0000 (09:16 -0700)]
rustdoc: remove `cursor: pointer` from unclickable tooltip

It's misleading unless it gets changed to respond to being clicked.

20 months agoAuto merge of #104846 - spastorino:santa-clauses-make-goals-early-christmas-🎄, r...
bors [Fri, 25 Nov 2022 15:59:31 +0000 (15:59 +0000)]
Auto merge of #104846 - spastorino:santa-clauses-make-goals-early-christmas-🎄, r=oli-obk

Branch Clause from Predicate

r? `@oli-obk`

This is part of what's proposed in https://github.com/rust-lang/compiler-team/issues/531

20 months agoremove confusing comment
lcnr [Fri, 25 Nov 2022 15:35:10 +0000 (16:35 +0100)]
remove confusing comment

`?0: CoerceUnsized<SomeTy>` can definitely apply because
`?0` matches any type, same for `SomeTy: CoerceUnsized<?0>`

20 months agoremove `TypeError::ObjectUnsafeCoercion`
lcnr [Fri, 25 Nov 2022 15:21:42 +0000 (16:21 +0100)]
remove `TypeError::ObjectUnsafeCoercion`

20 months agosmall method code cleanup
lcnr [Fri, 25 Nov 2022 14:51:46 +0000 (15:51 +0100)]
small method code cleanup

20 months agoremove unused code
Tshepang Mbambo [Fri, 25 Nov 2022 14:28:18 +0000 (16:28 +0200)]
remove unused code

20 months agoremove obsolete comment
Tshepang Mbambo [Mon, 31 Oct 2022 02:23:46 +0000 (04:23 +0200)]
remove obsolete comment

20 months agorustbuild: Don't build doc::SharedAssets when building JSON docs.
Nixon Enraght-Moony [Fri, 25 Nov 2022 13:50:41 +0000 (13:50 +0000)]
rustbuild: Don't build doc::SharedAssets when building JSON docs.

20 months agonotify lcnr on changes to `ObligationCtxt`
lcnr [Fri, 25 Nov 2022 13:26:10 +0000 (14:26 +0100)]
notify lcnr on changes to `ObligationCtxt`

20 months agoAuto merge of #104877 - matthiaskrgr:rollup-s7taiq8, r=matthiaskrgr
bors [Fri, 25 Nov 2022 13:01:45 +0000 (13:01 +0000)]
Auto merge of #104877 - matthiaskrgr:rollup-s7taiq8, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #103648 (Don't set `is_preview` for clippy and rustfmt)
 - #104654 (Add `#![deny(unsafe_op_in_unsafe_fn)]` in liballoc tests)
 - #104793 (unstable-book: Add page for the `abi_efiapi` feature)
 - #104841 (Assert that we don't capture escaping bound vars in `Fn` trait selection)
 - #104849 (Migrate source code elements style to CSS variables)
 - #104873 (RefCell::get_mut: fix typo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

20 months ago[llvm-wrapper] adapt for LLVM API change
Krasimir Georgiev [Fri, 25 Nov 2022 11:29:00 +0000 (11:29 +0000)]
[llvm-wrapper] adapt for LLVM API change

Adapt for the LLVM API changes from
https://github.com/llvm/llvm-project/commit/721f975d3518403502f770ce11f3f02509b30c5b#diff-5a347903b8412ed1b1b1948c3fce47f9a6ff05dc70bfaeedb6d06b622e399d91.

20 months agoadd comment
lcnr [Wed, 23 Nov 2022 16:39:51 +0000 (17:39 +0100)]
add comment

20 months agomove 2 candidates into builtin candidate
lcnr [Tue, 22 Nov 2022 14:46:01 +0000 (15:46 +0100)]
move 2 candidates into builtin candidate

20 months agojsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath
Nixon Enraght-Moony [Fri, 25 Nov 2022 10:53:14 +0000 (10:53 +0000)]
jsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath

Closes #104851

20 months agoRollup merge of #104873 - RalfJung:therefore, r=Dylan-DPC
Matthias Krüger [Fri, 25 Nov 2022 09:44:40 +0000 (10:44 +0100)]
Rollup merge of #104873 - RalfJung:therefore, r=Dylan-DPC

RefCell::get_mut: fix typo

and fix the same typo in a bunch of other places

20 months agoRollup merge of #104849 - GuillaumeGomez:source-code-sidebar-css-migration, r=notriddle
Matthias Krüger [Fri, 25 Nov 2022 09:44:40 +0000 (10:44 +0100)]
Rollup merge of #104849 - GuillaumeGomez:source-code-sidebar-css-migration, r=notriddle

Migrate source code elements style to CSS variables

r? ``@notriddle``

20 months agoRollup merge of #104841 - compiler-errors:fishy-bound-var, r=jackh726
Matthias Krüger [Fri, 25 Nov 2022 09:44:39 +0000 (10:44 +0100)]
Rollup merge of #104841 - compiler-errors:fishy-bound-var, r=jackh726

Assert that we don't capture escaping bound vars in `Fn` trait selection

Fixes #104825

20 months agoRollup merge of #104793 - nicholasbishop:bishop-add-efiapi, r=JohnTitor
Matthias Krüger [Fri, 25 Nov 2022 09:44:39 +0000 (10:44 +0100)]
Rollup merge of #104793 - nicholasbishop:bishop-add-efiapi, r=JohnTitor

unstable-book: Add page for the `abi_efiapi` feature

Tracking issue for `abi_efiapi`: https://github.com/rust-lang/rust/issues/65815

20 months agoRollup merge of #104654 - thomcc:alloc-tests-unsafe_op_in_unsafe_fn, r=Mark-Simulacrum
Matthias Krüger [Fri, 25 Nov 2022 09:44:38 +0000 (10:44 +0100)]
Rollup merge of #104654 - thomcc:alloc-tests-unsafe_op_in_unsafe_fn, r=Mark-Simulacrum

Add `#![deny(unsafe_op_in_unsafe_fn)]` in liballoc tests

In https://github.com/rust-lang/rust/pull/104647#discussion_r1027332930 it was mentioned that liballoc tests should probably have this enabled (we have it pretty much everywhere else in the stdlib), so I added it.

This will probably conflict with https://github.com/rust-lang/rust/pull/104647 so I'll rebase after that lands.

20 months agoRollup merge of #103648 - jyn514:no-preview, r=Mark-Simulacrum
Matthias Krüger [Fri, 25 Nov 2022 09:44:37 +0000 (10:44 +0100)]
Rollup merge of #103648 - jyn514:no-preview, r=Mark-Simulacrum

Don't set `is_preview` for clippy and rustfmt

These have been shipped on stable for many years now and it would be very disruptive to ever remove them.
Remove the `-preview` suffix from their dist components.

Based on https://github.com/rust-lang/rust/pull/102565.

20 months agoAuto merge of #104650 - BlackHoleFox:stuck-with-xcode-13, r=Mark-Simulacrum
bors [Fri, 25 Nov 2022 09:44:16 +0000 (09:44 +0000)]
Auto merge of #104650 - BlackHoleFox:stuck-with-xcode-13, r=Mark-Simulacrum

Build macOS distribution artifacts with XCode 13

After all of the `rust-lang/rust` Apple runners started using macOS 12, the builds created by CI began to use XCode 14.0.1. Due to this (as far as we can tell), XCode's build tools started to ignore the `MACOSX_DEPLOYMENT_TARGET` being defined by us for the distributed builds that let both `rustc` and `libstd` work on older versions. The current idea is that since XCode 14's macOS SDK doesn't support deployment targets before 10.13, it uses some default of its own. You can see the difference between stable's and the most recent nighty's supported versions [here](https://github.com/rust-lang/rust/issues/104570#issuecomment-1321225907).

I wasn't able to confirm my SDK versioning hypothesis locally since I think there's something jammed with my XCode installation, but hopefully this should still fix it for releases.

Closes https://github.com/rust-lang/rust/issues/104570

r? `@Mark-Simulacrum`

20 months agoFix mk_const_list
kadmin [Fri, 25 Nov 2022 09:35:37 +0000 (09:35 +0000)]
Fix mk_const_list

20 months agoonly emit "enable gce" error if it would fix compile error
Boxy [Thu, 24 Nov 2022 11:25:19 +0000 (11:25 +0000)]
only emit "enable gce" error if it would fix compile error

20 months agoMake `expand_abstract_consts` infallible
Boxy [Thu, 24 Nov 2022 11:09:15 +0000 (11:09 +0000)]
Make `expand_abstract_consts` infallible

20 months ago`super_relate_consts` do not spurriously fail on assoc consts
Boxy [Thu, 24 Nov 2022 08:36:28 +0000 (08:36 +0000)]
`super_relate_consts` do not spurriously fail on assoc consts

20 months agoadd FIXME's
Boxy [Thu, 24 Nov 2022 08:20:51 +0000 (08:20 +0000)]
add FIXME's

20 months agocorrectly intern `List<Const<'tcx>>`
Boxy [Wed, 23 Nov 2022 09:25:01 +0000 (09:25 +0000)]
correctly intern `List<Const<'tcx>>`

20 months agodont skip const evalautable of non unevaluateds
Boxy [Tue, 22 Nov 2022 12:22:36 +0000 (12:22 +0000)]
dont skip const evalautable of non unevaluateds

20 months agoadd FIXME for things that I couldn't find ways to trigger
Boxy [Tue, 22 Nov 2022 12:20:05 +0000 (12:20 +0000)]
add FIXME for things that I couldn't find ways to trigger

20 months agofmt
Boxy [Mon, 21 Nov 2022 04:32:07 +0000 (04:32 +0000)]
fmt

20 months agoreduce duplicated argument logic
Boxy [Tue, 15 Nov 2022 23:23:31 +0000 (23:23 +0000)]
reduce duplicated argument logic

20 months agoalso handle it in evaluate
Boxy [Tue, 15 Nov 2022 23:11:30 +0000 (23:11 +0000)]
also handle it in evaluate

20 months agohandle assoc consts in fulfill `ConstEquate`
Boxy [Tue, 15 Nov 2022 22:53:30 +0000 (22:53 +0000)]
handle assoc consts in fulfill `ConstEquate`

20 months agofmt
Boxy [Tue, 15 Nov 2022 20:45:57 +0000 (20:45 +0000)]
fmt

20 months agohandle nested obligations in `satisfied_from_param_env`
Boxy [Mon, 14 Nov 2022 18:20:53 +0000 (18:20 +0000)]
handle nested obligations in `satisfied_from_param_env`

20 months agoAdd expand_abstract_const
kadmin [Tue, 25 Oct 2022 08:16:43 +0000 (08:16 +0000)]
Add expand_abstract_const

Adds the ability to directly expand a const to an expr without having to deal with intermediate
steps.

20 months agoAdd empty ConstKind::Abstract
kadmin [Wed, 27 Jul 2022 07:27:52 +0000 (07:27 +0000)]
Add empty ConstKind::Abstract

Initial pass at expr/abstract const/s

Address comments

Switch to using a list instead of &[ty::Const], rm `AbstractConst`

Remove try_unify_abstract_consts

Update comments

Add edits

Recurse more

More edits

Prevent equating associated consts

Move failing test to ui

Changes this test from incremental to ui, and mark it as failing and a known bug.
Does not cause the compiler to ICE, so should be ok.

20 months agochange example of array_from_fn to match suggestion
Fabian Hintringer [Fri, 25 Nov 2022 09:05:07 +0000 (10:05 +0100)]
change example of array_from_fn to match suggestion

20 months agoUse "must be init" instead of "must not be uninit" everywhere
Oli Scherer [Mon, 7 Nov 2022 10:52:48 +0000 (10:52 +0000)]
Use "must be init" instead of "must not be uninit" everywhere

20 months agoAdd a `because` to errors derived from fields
Oli Scherer [Mon, 7 Nov 2022 10:48:40 +0000 (10:48 +0000)]
Add a `because` to errors derived from fields

20 months agoAdd a test for OOB ranges
Oli Scherer [Mon, 7 Nov 2022 10:26:23 +0000 (10:26 +0000)]
Add a test for OOB ranges

20 months agoSimplify and document range layout computation
Oli Scherer [Mon, 7 Nov 2022 10:26:14 +0000 (10:26 +0000)]
Simplify and document range layout computation

20 months agoDon't show fields from other crates
Oli Scherer [Thu, 3 Nov 2022 15:30:52 +0000 (15:30 +0000)]
Don't show fields from other crates

20 months agoMove a comment to the right place
Oli Scherer [Thu, 3 Nov 2022 12:04:26 +0000 (12:04 +0000)]
Move a comment to the right place

20 months agoReinstate the previous compact form of "in this field" errors
Oli Scherer [Thu, 3 Nov 2022 10:17:50 +0000 (10:17 +0000)]
Reinstate the previous compact form of "in this field" errors

20 months agoAdd a test for scalar pair layout validation
Oli Scherer [Thu, 3 Nov 2022 10:12:49 +0000 (10:12 +0000)]
Add a test for scalar pair layout validation

20 months agoDon't try to compute the layout of generic types.
Oli Scherer [Thu, 3 Nov 2022 09:43:52 +0000 (09:43 +0000)]
Don't try to compute the layout of generic types.

20 months agoCompute layout instead of manually procesisng the layout restriction attributes
Oli Scherer [Thu, 3 Nov 2022 09:20:27 +0000 (09:20 +0000)]
Compute layout  instead of manually procesisng the layout restriction attributes

20 months agoPrint a trace through types to show how to get to the problematic type
Oli Scherer [Thu, 3 Nov 2022 09:10:31 +0000 (09:10 +0000)]
Print a trace through types to show how to get to the problematic type

20 months agoMake the ICEs in the mir typechecker have more spans helpful
Oli Scherer [Thu, 3 Nov 2022 08:17:55 +0000 (08:17 +0000)]
Make the ICEs in the mir typechecker have more spans helpful

20 months agoMore manual formatting
Oli Scherer [Thu, 3 Nov 2022 08:17:32 +0000 (08:17 +0000)]
More manual formatting

20 months ago`rustc_layout_scalar_valid_range` can be applied to scalar pairs and affects teh...
Oli Scherer [Thu, 3 Nov 2022 08:17:08 +0000 (08:17 +0000)]
`rustc_layout_scalar_valid_range` can be applied to scalar pairs and affects teh first scalar

20 months agoSome manual formatting of let..else statements
Oli Scherer [Thu, 3 Nov 2022 08:14:43 +0000 (08:14 +0000)]
Some manual formatting of let..else statements

20 months agoAuto merge of #2691 - RalfJung:get_mut, r=RalfJung
bors [Fri, 25 Nov 2022 07:58:00 +0000 (07:58 +0000)]
Auto merge of #2691 - RalfJung:get_mut, r=RalfJung

replace a borrow_mut by get_mut

20 months agoreplace a borrow_mut by get_mut
Ralf Jung [Fri, 25 Nov 2022 07:57:16 +0000 (08:57 +0100)]
replace a borrow_mut by get_mut

20 months agoRefCell::get_mut: fix typo
Ralf Jung [Fri, 25 Nov 2022 07:47:59 +0000 (08:47 +0100)]
RefCell::get_mut: fix typo

and fix the same typo in a bunch of other places

20 months agoPrefer not accessing the private field of newtype_index types
Oli Scherer [Thu, 3 Nov 2022 08:12:19 +0000 (08:12 +0000)]
Prefer not accessing the private field of newtype_index types

20 months agoAdd helper method to `ScalarInt`
Oli Scherer [Thu, 3 Nov 2022 08:11:52 +0000 (08:11 +0000)]
Add helper method to `ScalarInt`

20 months agoAuto merge of #104602 - petrochenkov:effvisperf5, r=oli-obk
bors [Fri, 25 Nov 2022 06:14:42 +0000 (06:14 +0000)]
Auto merge of #104602 - petrochenkov:effvisperf5, r=oli-obk

privacy: Fix more (potential) issues with effective visibilities

Continuation of https://github.com/rust-lang/rust/pull/103965.
See individual commits for more detailed description of the changes.

The shortcuts removed in https://github.com/rust-lang/rust/pull/104602/commits/4eb63f618e601efee657d24cd4e8833fb03fac4c and https://github.com/rust-lang/rust/pull/104602/commits/c7c7d1672739e38c8d39ae861b284486aefd5b48 could actually be correct (or correct after some tweaks), but they used global reasoning like "we can skip this update because if the code compiles then some other update should do the same thing eventually".
I have some expertise in this area, but I still have doubt whether such global reasoning was correct or not, especially in presence of all possible exotic cases with imports.
After this PR all table changes should be "locally correct" after every update, even if it may be overcautious.
If similar optimizations are introduced again they will need detailed comments explaining why it's legal to do what they do and providing proofs.

Fixes https://github.com/rust-lang/rust/issues/104249.
Fixes https://github.com/rust-lang/rust/issues/104539.

20 months agoAuto merge of #104855 - thomcc:revert-noinline-wintls, r=ChrisDenton
bors [Fri, 25 Nov 2022 03:17:25 +0000 (03:17 +0000)]
Auto merge of #104855 - thomcc:revert-noinline-wintls, r=ChrisDenton

Revert "Forbid inlining `thread_local!`'s `__getit` function on Windows"

Revert of #101368, fixes #104852.

I'd rather not do this since that's a soundness fix and this is hitting some compiler bug, but I don't really know an alternative.

r? `@ChrisDenton`

20 months agoTune RepeatWith::try_fold and Take::for_each and Vec::extend_trusted
Scott McMurray [Fri, 25 Nov 2022 03:14:19 +0000 (19:14 -0800)]
Tune RepeatWith::try_fold and Take::for_each and Vec::extend_trusted

20 months agoIntroduce PredicateKind::Clause
Santiago Pastorino [Thu, 24 Nov 2022 21:14:58 +0000 (18:14 -0300)]
Introduce PredicateKind::Clause

20 months agoSimplify a bunch of trait ref obligation creations
Oli Scherer [Fri, 18 Nov 2022 21:29:26 +0000 (21:29 +0000)]
Simplify a bunch of trait ref obligation creations

20 months agoget rid of to_poly_trait_predicate
Oli Scherer [Fri, 18 Nov 2022 14:10:36 +0000 (14:10 +0000)]
get rid of to_poly_trait_predicate