Commit Graph

229037 Commits

Author SHA1 Message Date
Oli Scherer
62fbbac2d9 tidy: move a large function out of an even larger file 2023-07-05 07:46:04 +00:00
Oli Scherer
9e98feb84c Add some extra information to opaque type cycle errors 2023-07-05 07:43:35 +00:00
Oli Scherer
66ae9998d5 Remove redundant delay_span_bug 2023-07-05 07:43:35 +00:00
Oli Scherer
9cacfae3e9 Fix some tests to *only* test their main issue and not have secondary failures 2023-07-05 07:43:35 +00:00
Oli Scherer
a49b736568 Lint now-unnecessary associated type bounds 2023-07-05 07:42:53 +00:00
Oli Scherer
ca581f9161 Don't require associated types with Self: Sized bounds in dyn Trait objects 2023-07-05 07:42:53 +00:00
Oli Scherer
97d831d008 Show which type was not specialized on query cycle misuse 2023-07-05 07:30:28 +00:00
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
Eric Mark Martin
261c023123 rename constants in mir dump test 2023-07-05 04:28:45 +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
Eric Mark Martin
afccc44402 add mir dump test 2023-07-05 02:23:43 +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
7591c51436 Auto merge of #2960 - oli-obk:run_filter, r=oli-obk
Restore test filtering by substring.

Previously it was only looking for tests whose path was a prefix of the given filter

fixes #2958
2023-07-04 12:12:22 +00: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
bors
8fa48940a0 Auto merge of #2963 - RalfJung:start, r=RalfJung
better error on missing #[start]
2023-07-04 11:24:26 +00:00
Oli Scherer
da98baa493 Restore test filtering by substring.
Previously it was only looking for tests whose path was a prefix of the given filter
2023-07-04 11:23:14 +00:00
Ralf Jung
812f9b2620 better error on missing #[start] 2023-07-04 13:23:05 +02:00
yukang
799d2917e7 Detect extra space in keyword for better hint 2023-07-04 18:13:31 +08:00
Trevor Gross
b0a18cbadf Update debuginfo test runner to provide more useful output
This change makes debuginfo tests more user friendly. Changes:

-   Print all lines that fail to match the patterns instead of just
    the first
-   Provide better error messages that also say what did match
-   Strip leading whitespace from directives so they are not skipped if
    indented
-   Improve documentation and improve nesting on some related items

As an example, given the following debuginfo test with intentional
fails:

```rust
// from tests/debuginfo/rc_arc.rs

// cdb-command:dx rc,d
// cdb-check:rc,d             : 111 [Type: alloc::rc::Rc<i32>]
// cdb-check:    [Reference count] : 11 [Type: core::cell FAIL::Cell<usize>]
// cdb-check:    [Weak reference count] : 2 [Type: core::cell FAIL::Cell<usize>]

// ...
```

The current output (tested in #113313) only shows the first mismatch:

```
2023-07-04T08:10:00.1939267Z ---- [debuginfo-cdb] tests\debuginfo\rc_arc.rs stdout ----
2023-07-04T08:10:00.1942182Z
2023-07-04T08:10:00.1957463Z error: line not found in debugger output:     [Reference count] : 11 [Type: core::cell FAIL::Cell<usize>]
2023-07-04T08:10:00.1958272Z status: exit code: 0
```

With this change, you are able to see all failures in that check
group, as well as what parts were successful. The output is now:

```
2023-07-04T09:45:57.2514224Z error: check directive(s) from `C:\a\rust\rust\tests\debuginfo\rc_arc.rs` not found in debugger output. errors:
2023-07-04T09:45:57.2514631Z     (rc_arc.rs:31) `    [Reference count] : 11 [Type: core::cell FAIL::Cell<usize>]`
2023-07-04T09:45:57.2514908Z     (rc_arc.rs:32) `    [Weak reference count] : 2 [Type: core::cell FAIL::Cell<usize>]`
2023-07-04T09:45:57.2515181Z     (rc_arc.rs:41) `    [Reference count] : 21 [Type: core::sync::atomic FAIL::AtomicUsize]`
2023-07-04T09:45:57.2515452Z     (rc_arc.rs:50) `dyn_rc,d         [Type: alloc::rc::Rc<dyn$<core::fmt FAIL::Debug> >]`
2023-07-04T09:45:57.2515695Z the following subset of check directive(s) was found successfully::
2023-07-04T09:45:57.2516080Z     (rc_arc.rs:30) `rc,d             : 111 [Type: alloc::rc::Rc<i32>]`
2023-07-04T09:45:57.2516312Z     (rc_arc.rs:35) `weak_rc,d        : 111 [Type: alloc::rc::Weak<i32>]`
2023-07-04T09:45:57.2516555Z     (rc_arc.rs:36) `    [Reference count] : 11 [Type: core::cell::Cell<usize>]`
2023-07-04T09:45:57.2516881Z     (rc_arc.rs:37) `    [Weak reference count] : 2 [Type: core::cell::Cell<usize>]`
...
```

Which makes it easier to see what did and didn't succeed without
manual comparison against the source test file.
2023-07-04 06:12:17 -04:00
lcnr
594cd84a94 TypeParameterDefinition always require a DefId 2023-07-04 11:51:07 +02:00