Commit Graph

228927 Commits

Author SHA1 Message Date
Oli Scherer
d6b82ff761 Remove a redundant argument 2023-07-05 07:30:28 +00:00
Michael Goulet
d2a1803d6f Winnow specializing impls 2023-07-05 06:18:48 +00:00
bors
6dab6dc5fc Auto merge of #112697 - tgross35:explain-markdown, r=oli-obk
Add simple markdown formatting to `rustc --explain` output

This is a second attempt at #104540, which is #63128 without dependencies.

This PR adds basic markdown formatting to `rustc --explain` output when available. Currently, the output just displays raw markdown: this works of course, but it really doesn't look very elegant. (output is `rustc --explain E0038`)

<img width="583" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/ea418117-47af-455b-83c0-6fc59276efee">

After this patch, sample output from the same file:

<img width="693" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/12f7bf9b-a3fe-4104-b74b-c3e5227f3de9">

This also obeys the `--color always/auto/never` command option. Behavior:

- If pager is available and supports color, print with formatting to the pager
- If pager is not available or fails print with formatting to stdout - otherwise without formatting
- Follow `--color always/never` if suppied
- If everything fails, just print plain text to stdout

r? `@oli-obk`
cc `@estebank`
(since the two of you were involved in the previous discussion)
2023-07-05 06:18:46 +00:00
bors
9227ff28af Auto merge of #113329 - lcnr:probe_candidate, r=BoxyUwU
add `ecx.probe_candidate`

Not yet changing the candidate source to an enum because that would be more involved, but this by itself should already be a significant improvement imo

r? `@BoxyUwU`
2023-07-05 03:50:36 +00:00
bors
b7bc6f88ac Auto merge of #113330 - matthiaskrgr:rollup-zm3owin, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #113192 (`assemble_candidates_after_normalizing_self_ty` docs)
 - #113251 (Use scoped-tls for SMIR to  map between TyCtxt and SMIR datastructures)
 - #113282 (Update platform-support.md to improve ARM target descriptions)
 - #113296 (add flag for enabling global cache usage for proof trees and printing proof trees on error)
 - #113324 (implement `ConstEvaluatable` goals in new solver)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-04 23:51:52 +00:00
bors
f20afcc455 Auto merge of #113325 - BoxyUwU:move_mk_methods_to_const, r=lcnr
Replace `mk_const` with `Const::new_x` methods

Part of rust-lang/compiler-team#616. Instead of just havign `Const::new(` and nothing else I did it like this since this is more like how the `mk_x` works for `Ty`, and also another PR of mine will require changing from `Const::new(` to `Const::new_x(` anyway.

r? `@oli-bok`
2023-07-04 21:33:25 +00:00
bors
9e4e584705 Auto merge of #113274 - workingjubilee:demote-mips, r=jyn514
Remove `mips*-unknown-linux-gnu*` builders

Pursuant to the current consensus in https://github.com/rust-lang/compiler-team/issues/648
2023-07-04 19:17:05 +00:00
Deadbeef
25fc6c1586 add fixme 2023-07-04 17:21:52 +00:00
Deadbeef
58c105af04 include host_effect_index in Generics 2023-07-04 17:21:52 +00:00
klensy
d5dbe867f6 fix typo 2023-07-04 19:19:50 +03:00
klensy
ab914cf9f7 bootstrap: rust-installer no loger subtree, so allow running lints over it 2023-07-04 19:19:50 +03:00
klensy
a3bca31303 tidy: exclude sh files from rust-installer tests from tidy bins check 2023-07-04 19:19:49 +03:00
Matthias Krüger
7996908c4f
Rollup merge of #113324 - lcnr:const-evaluatable-goal, r=BoxyUwU
implement `ConstEvaluatable` goals in new solver

this only supports stable const generics. `feature(generic_const_exprs)` needs to extend that function is non-trivial ways. Leaving this for someone else or some later date.

r? `@BoxyUwU`
2023-07-04 17:46:28 +02:00
Matthias Krüger
494e67c63c
Rollup merge of #113296 - BoxyUwU:proof_trees_on_error, r=lcnr
add flag for enabling global cache usage for proof trees and printing proof trees on error

This adds a few new things:
- `-Zdump-solver-proof-tree=always/never/on-error`
    - `always`/`never` were previosuly specifiable by whether the flag exists or not, th new flag is `on_error` which reruns obligations of fulfillment and selection errors with proof tree generation enabled and prints them out
- `-Zdump-solver-proof-tree-uses-cache`
    - allows forcing global cache to be used or unused for all generated proof trees, global cache is enabled by default for `always` so that it accurately represents what happend. This flag currently would affect misc uses of `GenerateProofTree::Yes` which will be added in the future for things like diagnostics logic and rustdoc's auto_trait file. We can fix this when we start using proof tree generation for those use cases if it's desirable.

I also changed the output to go straight to stdout instead of going through `debug!` so that `-Zdump-solver-proof-tree` can be adequately used on `nightly` not just a locally built toolchain.

The idea for `on-error` is that it should hopefully make it easier to quickly figure out "why doesnt this code compile"- you just pass in `-Zdump-solver-proof-tree=on-error` and you'll only get proof trees you care about.

---

r? `@lcnr` `@compiler-errors`
2023-07-04 17:46:28 +02:00
Matthias Krüger
d951692057
Rollup merge of #113282 - jonathanpallant:update-arm-target-descriptions, r=JohnTitor
Update platform-support.md to improve ARM target descriptions

Updates the descriptions of the various ARM targets in platform-support.md so they are a little more consistent.

For example, all instances of ARMv7 are changed to ARMv7-A (as opposed to ARMv7-R and ARMv7-M). I also remove the Cortex-Mx CPUs on the thumbv6/7m targets, as most of the other targets refer only to CPU architectures and not specific CPUs (and the list was missing on thumbv8m anyway, so this is more consistent).
2023-07-04 17:46:27 +02:00
Matthias Krüger
d3fae79178
Rollup merge of #113251 - chenyukang:yukang-fix-112940-smir, r=oli-obk
Use scoped-tls for SMIR to  map between TyCtxt and SMIR datastructures

Fixes #112940
r? `@oli-obk`
2023-07-04 17:46:27 +02:00
Matthias Krüger
6fb790ad1a
Rollup merge of #113192 - lcnr:add-comment, r=compiler-errors
`assemble_candidates_after_normalizing_self_ty` docs

I already explained that in different places a few times, should have added that explanation as a doc comment the first time I did so :3

r? `@BoxyUwU`
2023-07-04 17:46:26 +02:00
klensy
46d3fc7812 fix bash long lines and replace TODO with FIXME 2023-07-04 18:39:53 +03:00
klensy
02e9262c11 replace tabs with 4 spaces in .sh 2023-07-04 18:39:52 +03:00
klensy
d9f77c74fd rust-installer and rls no longer submodule, so fix tidy walk list 2023-07-04 18:39:51 +03:00
klensy
f3d9248c22 rust-installer and rls no longer submodule, so fix rustfmt.toml 2023-07-04 18:39:48 +03:00
lcnr
795c2ef7d9 add ecx.probe_candidate 2023-07-04 17:08:07 +02:00
Boxy
d3cd406519
nit
Co-authored-by: lcnr <rust@lcnr.de>
2023-07-04 15:11:12 +01:00
Boxy
284b61417f reviews 2023-07-04 14:56:09 +01:00
lcnr
abcaf30f9b implement ConstEvaluatable goals in new solver
we don't yet handle `generic_const_exprs`, someone else
can do that :3
2023-07-04 15:54:18 +02:00
Boxy
d30f56dbf2 Replace const_error methods with Const::new_error 2023-07-04 14:46:32 +01:00
Jakub Beránek
be99bb9cbf
Use llvm-config instead of download-ci-llvm in PGO script
This should avoid CI breakage when the LLVM stamp is updated, and also it will avoid an unnecessary LLVM download from CI.
2023-07-04 15:38:32 +02:00
Boxy
ddbc774e74 Replace mk_const with Const::new_x methods 2023-07-04 14:26:33 +01:00
bors
4dbc7e3092 Auto merge of #113309 - chenyukang:yukang-fix-89640-space, r=Nilstrieb
Detect extra space in keyword for better hint

Fixes #89640

r? `@Nilstrieb`

I met the same issue, then found out this old issue :)
2023-07-04 12:04:57 +00:00
Deadbeef
30b21b758a add test 2023-07-04 11:47:46 +00:00
Deadbeef
0b095a60d2 allow host param to be lowercase 2023-07-04 11:47:46 +00:00
Deadbeef
8eb3e0bf30 enforce context effects in typeck 2023-07-04 11:47:46 +00:00
Deadbeef
1c837cb6f7 Add effects during lowering for ~const bounds 2023-07-04 11:47:45 +00:00
Deadbeef
2d5d56bb59 Add feature and attribute definition 2023-07-04 11:47:45 +00:00
yukang
799d2917e7 Detect extra space in keyword for better hint 2023-07-04 18:13:31 +08:00
lcnr
594cd84a94 TypeParameterDefinition always require a DefId 2023-07-04 11:51:07 +02:00
bors
cd68ead9ec Auto merge of #113303 - compiler-errors:yeet-chalk, r=lcnr
Remove chalk support from the compiler

Removes chalk (`-Ztrait-solver=chalk`) from the compiler and prunes any dead code resulting from this, mainly:
* Remove the chalk compatibility layer in `compiler/rustc_traits/src/chalk`
* Remove the chalk flag `-Ztrait-solver=chalk` and its `TraitEngine` implementation
* Remove `TypeWellFormedFromEnv` (and its many `bug!()` match arms)
* Remove the chalk migration mode from compiletest
* Remove the `chalkify` UI tests (do we want to keep any of these, but migrate them to `-Ztrait-solver=next`??)

Fulfills rust-lang/types-team#93.

r? `@jackh726`
2023-07-04 09:09:09 +00:00
Trevor Gross
a635bf7a3b Revert "alloc: Allow comparing Boxs over different allocators"
This reverts commit 001b081cc1.

This change was done as the above commit introduces a regression in type
inference. Regression test located at
`tests/ui/type-inference/issue-113283-alllocator-trait-eq.rs`
2023-07-04 05:02:00 -04:00
Boxy
276d628cac move logic for flags into separate function 2023-07-04 10:01:54 +01:00
Trevor Gross
3c9a7491c2 Add a test for PartialEq across Allocators breaking inference (#113283)
Verify that `PartialEq` implementations do not break type inference
when comparing types across different allocators. This catches a
regression in current nightly introduced in 001b081cc1 (alloc: Allow
comparing `Box`s over different allocators")

`Box` is the only type that currently impelements this, but tests are
included for `Rc` and `Arc` to prevent future regresssions.
2023-07-04 05:00:46 -04:00
Chris Denton
4309954187
Test Child::kill behaviour on exited process 2023-07-04 09:50:49 +01:00
lcnr
312994243a extend comment 2023-07-04 10:34:27 +02:00
Boxy
adefeb80c3 change flag name 2023-07-04 09:17:41 +01:00
Boxy
2ad00f471a reviews 2023-07-04 09:13:10 +01:00
lcnr
b468bfb361 -Ztrait-solver=next: stop depending on old solver 2023-07-04 10:06:39 +02:00
bors
52d8c490a3 Auto merge of #113304 - cuviper:indexmap-2, r=Mark-Simulacrum
Upgrade to indexmap 2.0.0

The new version was already added to the tree as an indirect dependency
in #113046, but now our direct dependents are using it too.
2023-07-04 06:49:20 +00:00
bors
0130c3a06e Auto merge of #113215 - compiler-errors:rpitit-predicates-tweaks, r=spastorino
Make RPITITs assume/require their parent method's predicates

Removes a FIXME from the `param_env` query where we were manually adding the parent function's predicates to the RPITIT's assumptions.

r? `@spastorino`
2023-07-04 04:24:24 +00:00
bors
e728b5b98d Auto merge of #112917 - chenyukang:yukang-fix-112590, r=estebank
Suggest importing for partial mod path matching in name resolving

Fixes #112590
2023-07-04 02:01:24 +00:00
Michael Goulet
0c73b41cd6 remove TypeWellFormedFromEnv 2023-07-03 21:40:04 +00:00
Michael Goulet
c6fcbaae0f Remove compare mode 2023-07-03 21:40:04 +00:00