Nicholas Nethercote
84ac80f192
Reformat use
declarations.
...
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
2024-07-29 08:26:52 +10:00
Oli Scherer
393dea8bc3
Allow tracing through item_bounds query invocations on opaques
...
Previously these caused cycles when printing the result
2024-06-19 08:47:55 +00:00
Nicholas Nethercote
75b164d836
Use tidy
to sort crate attributes for all compiler crates.
...
We already do this for a number of crates, e.g. `rustc_middle`,
`rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`.
For the ones we don't, in many cases the attributes are a mess.
- There is no consistency about order of attribute kinds (e.g.
`allow`/`deny`/`feature`).
- Within attribute kind groups (e.g. the `feature` attributes),
sometimes the order is alphabetical, and sometimes there is no
particular order.
- Sometimes the attributes of a particular kind aren't even grouped
all together, e.g. there might be a `feature`, then an `allow`, then
another `feature`.
This commit extends the existing sorting to all compiler crates,
increasing consistency. If any new attribute line is added there is now
only one place it can go -- no need for arbitrary decisions.
Exceptions:
- `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`,
because they have no crate attributes.
- `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's
ignored in `rustfmt.toml`).
2024-06-12 15:49:10 +10:00
Nicholas Nethercote
573aa9f677
Remove extern crate rustc_middle
from rustc_query_impl
.
2024-05-13 08:20:18 +10:00
Nicholas Nethercote
b68b92041c
Simplify use crate::rustc_foo::bar
occurrences.
...
They can just be written as `use rustc_foo::bar`, which is far more
standard. (I didn't even know that a `crate::` prefix was valid.)
2024-05-08 16:57:31 +10:00
Markus Reiter
33e68aadc9
Stabilize generic NonZero
.
2024-04-22 18:48:47 +02:00
klensy
124837d463
move QueryKeyStringCache from rustc_middle to rustc_query_impl, where it actually used
...
also allows to drop measureme dep on rustc_middle
2024-04-11 14:33:48 +03:00
John Kåre Alsaker
55ba7a7c62
Verify that query keys result in unique dep nodes
2024-03-12 05:31:41 +01:00
John Kåre Alsaker
fb9161028b
Avoid using unnecessary queries when printing the query stack in panics
2024-03-04 20:43:58 +01:00
John Kåre Alsaker
6fb4ac64ec
Add a proper with_no_queries
to printing
2024-03-03 21:12:04 +01:00
Nicholas Nethercote
6588f5b749
Rename Diagnostic
as DiagInner
.
...
I started by changing it to `DiagData`, but that didn't feel right.
`DiagInner` felt much better.
2024-02-28 08:33:25 +11:00
Markus Reiter
a90cc05233
Replace NonZero::<_>::new
with NonZero::new
.
2024-02-15 08:09:42 +01:00
Markus Reiter
746a58d435
Use generic NonZero
internally.
2024-02-15 08:09:42 +01:00
Nicholas Nethercote
0ac1195ee0
Invert diagnostic lints.
...
That is, change `diagnostic_outside_of_impl` and
`untranslatable_diagnostic` from `allow` to `deny`, because more than
half of the compiler has be converted to use translated diagnostics.
This commit removes more `deny` attributes than it adds `allow`
attributes, which proves that this change is warranted.
2024-02-06 13:12:33 +11:00
clubby789
fd29f74ff8
Remove unused features
2024-01-25 14:01:33 +00:00
Guillaume Gomez
d3574beb5d
Rollup merge of #119527 - klensy:ordering, r=compiler-errors
...
don't reexport atomic::ordering via rustc_data_structures, use std import
This looks simpler.
2024-01-09 13:23:17 +01:00
Michael Goulet
82a2215481
Don't check for recursion in generator witness fields
2024-01-08 20:30:21 +00:00
Michael Goulet
755b2da841
Value recovery can take the whole CycleError
2024-01-08 20:30:10 +00:00
klensy
56173611d6
don't reexport atomic::ordering via rustc_data_structures, use std import
2024-01-06 15:01:10 +03:00
bjorn3
f118c76235
Remove two unused feature gates from rustc_query_impl
2023-12-31 20:51:53 +00:00
bors
2fe50cd72c
Auto merge of #119129 - jyn514:verbose, r=compiler-errors,estebank
...
rework `-Zverbose`
implements the changes described in https://github.com/rust-lang/compiler-team/issues/706
the first commit is only a name change from `-Zverbose` to `-Zverbose-internals` and does not change behavior. the second commit changes diagnostics.
possible follow up work:
- `ty::pretty` could print more info with `--verbose` than it does currently. `-Z verbose-internals` shows too much info in a way that's not helpful to users. michael had ideas about this i didn't fully understand: 408984200
- `--verbose` should imply `-Z write-long-types-to-disk=no`. the code in `ty_string_with_limit` should take `--verbose` into account (apparently this affects `Ty::sort_string`, i'm not familiar with this code). writing a file to disk should suggest passing `--verbose`.
r? `@compiler-errors` cc `@estebank`
2023-12-26 12:27:29 +00:00
Nicholas Nethercote
99472c7049
Remove Session
methods that duplicate DiagCtxt
methods.
...
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier
access.
2023-12-24 08:05:28 +11:00
jyn
b5d8361909
rename to verbose-internals
2023-12-19 13:35:37 -05:00
klensy
31d99836bf
QueryContext: rename try_collect_active_jobs -> collect_active_jobs and change it's return type from Option<QueryMap> to QueryMap
...
As there currently always Some(...) inside
2023-11-27 18:13:15 +03:00
Vadim Petrochenkov
2c23386344
rustc: Make def_kind
mandatory for all DefId
s
2023-11-25 14:49:43 +03:00
Nilstrieb
21a870515b
Fix clippy::needless_borrow
in the compiler
...
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`.
Then I had to remove a few unnecessary parens and muts that were exposed
now.
2023-11-21 20:13:40 +01:00
Mark Rousskov
db3e2bacb6
Bump cfg(bootstrap)s
2023-11-15 19:41:28 -05:00
Jubilee
975d042d4c
Rollup merge of #116534 - cjgillot:no-dep-tasks, r=davidtwco
...
Remove -Zdep-tasks.
This option is not useful any more, we can use `tracing` and `RUSTC_LOG` to debug the dep-graph.
2023-10-28 01:07:35 -07:00
Michael Goulet
1836c1fbbd
Stash and cancel cycle errors for auto trait leakage in opaques
2023-10-26 17:58:02 +00:00
Michael Howell
c6e6ecb1af
rustdoc: remove rust logo from non-Rust crates
2023-10-08 20:17:53 -07:00
Camille GILLOT
8531ebfc95
Remove useless debugging.
2023-10-08 12:24:20 +00:00
John Kåre Alsaker
1806efe7f2
Move DepKind
to rustc_query_system
and define it as u16
2023-09-21 17:06:14 +02:00
John Kåre Alsaker
f742d88326
Remove verbose_generic_activity_with_arg
2023-09-10 17:47:16 +02:00
Michael Goulet
e7b3c94b0e
Pass ErrorGuaranteed to cycle error
2023-08-27 22:03:00 +00:00
Mark Rousskov
0a916062aa
Bump cfg(bootstrap)
2023-08-23 20:05:14 -04:00
Nilstrieb
5830ca216d
Add internal_features
lint
...
It lints against features that are inteded to be internal to the
compiler and standard library. Implements MCP #596 .
We allow `internal_features` in the standard library and compiler as those
use many features and this _is_ the standard library from the "internal to the compiler and
standard library" after all.
Marking some features as internal wasn't exactly the most scientific approach, I just marked some
mostly obvious features. While there is a categorization in the macro,
it's not very well upheld (should probably be fixed in another PR).
We always pass `-Ainternal_features` in the testsuite
About 400 UI tests and several other tests use internal features.
Instead of throwing the attribute on each one, just always allow them.
There's nothing wrong with testing internal features^^
2023-08-03 14:50:50 +02:00
Matthias Krüger
adf759bf6a
fix couple of clippy findings:
...
filter_map_identity
iter_kv_map
needless_question_mark
redundant_at_rest_pattern
filter_next
derivable_impls
2023-07-23 10:50:14 +02:00
Oli Scherer
b0142f603d
Avoid calling queries during query stack printing
2023-06-27 16:12:07 +02:00
Oli Scherer
81e37743a5
Make queries traceable again
2023-06-21 10:25:25 +00:00
John Kåre Alsaker
aa5d43647b
Add comment
2023-05-21 11:25:07 +02:00
John Kåre Alsaker
9c978b955e
Replace QueryStruct
with arrays local to rustc_query_impl
2023-05-21 03:12:56 +02:00
John Kåre Alsaker
9e755d98cc
Merge some query impl modules into one
2023-05-19 01:38:27 +02:00
John Kåre Alsaker
f6c6d10443
Merge query property modules into one
2023-05-18 09:45:12 +02:00
bors
77c836e1ae
Auto merge of #108938 - chenyukang:yukang/fix-107910-shorten-ice, r=cjgillot
...
Shorten backtraces for queries in ICEs
r? `@jyn514`
Fixes #107910
2023-05-18 04:21:15 +00:00
yukang
c3394b3eaa
Fix #107910 , Shorten backtraces in ICEs
2023-05-17 17:56:26 +08:00
John Kåre Alsaker
54b582a0e8
Finish move of query.rs
2023-05-17 01:57:21 +02:00
bors
b652d9a0fd
Auto merge of #108062 - Zoxc:spec-incr, r=cjgillot
...
Specialize query execution for incremental and non-incremental
This specializes query execution for incremental and non-incremental by passing in a separate `dyn QueryEngine` types, taking advantage of the virtual dispatch to avoid a branch. This ends up duplicating `try_execute_query`, hopefully the compile time cost of that is relatively low.
This is a performance improvement for the non-incremental path:
<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.8420s</td><td align="right">1.8331s</td><td align="right"> -0.48%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2652s</td><td align="right">0.2631s</td><td align="right"> -0.78%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">1.0161s</td><td align="right">1.0062s</td><td align="right"> -0.98%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.6408s</td><td align="right">1.6197s</td><td align="right">💚 -1.28%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.3939s</td><td align="right">6.3558s</td><td align="right"> -0.60%</td></tr><tr><td>Total</td><td align="right">11.1580s</td><td align="right">11.0780s</td><td align="right"> -0.72%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9918s</td><td align="right"> -0.82%</td></tr></table>
The incremental path is more neutral:
<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:initial</td><td align="right">2.2210s</td><td align="right">2.2227s</td><td align="right"> 0.08%</td></tr><tr><td>🟣 <b>hyper</b>:check:initial</td><td align="right">0.3441s</td><td align="right">0.3443s</td><td align="right"> 0.05%</td></tr><tr><td>🟣 <b>regex</b>:check:initial</td><td align="right">1.2919s</td><td align="right">1.2877s</td><td align="right"> -0.33%</td></tr><tr><td>🟣 <b>syn</b>:check:initial</td><td align="right">2.0749s</td><td align="right">2.0721s</td><td align="right"> -0.14%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:initial</td><td align="right">7.9266s</td><td align="right">7.9206s</td><td align="right"> -0.07%</td></tr><tr><td>Total</td><td align="right">13.8585s</td><td align="right">13.8474s</td><td align="right"> -0.08%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9992s</td><td align="right"> -0.08%</td></tr></table>
r? `@cjgillot`
2023-05-16 16:02:53 +00:00
John Kåre Alsaker
fff20a703d
Move expansion of query macros in rustc_middle to rustc_middle::query
2023-05-15 08:49:13 +02:00
John Kåre Alsaker
882a9684f9
Specialize query execution for incremental and non-incremental
2023-05-14 21:53:05 +02:00
John Kåre Alsaker
2fe28ae0a4
Use dynamic dispatch for queries
2023-04-30 09:48:47 +02:00