| Age | Commit message (Collapse) | Author | Lines |
|
give the resolver access to TyCtxt
The resolver is now created after TyCtxt is created. Then macro expansion and name resolution are run and the results fed into queries just like before this PR.
Since the resolver had (before this PR) mutable access to the `CStore` and the source span table, these two datastructures are now behind a `RwLock`. To ensure that these are not mutated anymore after the resolver is done, a read lock to them is leaked right after the resolver finishes.
### PRs split out of this one and leading up to it:
* https://github.com/rust-lang/rust/pull/105423
* https://github.com/rust-lang/rust/pull/105357
* https://github.com/rust-lang/rust/pull/105603
* https://github.com/rust-lang/rust/pull/106776
* https://github.com/rust-lang/rust/pull/106810
* https://github.com/rust-lang/rust/pull/106812
* https://github.com/rust-lang/rust/pull/108032
|
|
|
|
|
|
|
|
|
|
if it fails instead of bubbling out an error
|
|
|
|
|
|
|
|
using TyCtxt
|
|
|
|
Most tests involving save-analysis were removed, but I kept a few where
the `-Zsave-analysis` was an add-on to the main thing being tested,
rather than the main thing being tested.
For `x.py install`, the `rust-analysis` target has been removed.
For `x.py dist`, the `rust-analysis` target has been kept in a
degenerate form: it just produces a single file `reduced.json`
indicating that save-analysis has been removed. This is necessary for
rustup to keep working.
Closes #43606.
|
|
|
|
|
|
|
|
|
|
And remove `Clone` impls and `Lrc`s that are no longer necessary
|
|
Query refactoring
Just some cleanups I found when learning about the query system.
Best reviewed one commit at a time.
r? `@oli-obk`
|
|
Add `-Z instrument-xray` flag
Implement MCP https://github.com/rust-lang/compiler-team/issues/561, adding `-Z instrument-xray` flag which enables XRay instrumentation in LLVM.
|
|
There is a type `QueryCtxt`, which impls the trait `QueryContext`.
Confusingly, there is another type `QueryContext`. The latter is (like
`TyCtxt`) just a pointer to a `GlobalContext`. It's not used much, e.g.
its `impl` block has a single method.
This commit removes `QueryContext`, replacing its use with direct
`GlobalCtxt` use.
|
|
|
|
Recognize all bells and whistles that LLVM's XRay pass is capable of.
The always/never settings are a bit dumb without attributes but they're
still there. The default instruction count is chosen by the compiler,
not LLVM pass. We'll do it later.
|
|
tracing loggers at their own discretion
|
|
|
|
|
|
Apply the diagnostic migration lint to more functions on `Session`.
Signed-off-by: David Wood <david.wood@huawei.com>
|
|
Use stable metric for const eval limit instead of current terminator-based logic
This patch adds a `MirPass` that inserts a new MIR instruction `ConstEvalCounter` to any loops and function calls in the CFG. This instruction is used during Const Eval to count against the `const_eval_limit`, and emit the `StepLimitReached` error, replacing the current logic which uses Terminators only.
The new method of counting loops and function calls should be more stable across compiler versions (i.e., not cause crates that compiled successfully before, to no longer compile when changes to the MIR generation/optimization are made).
Also see: #103877
|
|
|
|
- Remove logic that limits const eval based on terminators, and use the
stable metric instead (back edges + fn calls)
- Add unstable flag `tiny-const-eval-limit` to add UI tests that do not
have to go up to the regular 2M step limit
|
|
|
|
|
|
|
|
Remove some `ref` patterns from the compiler
Previous PR: https://github.com/rust-lang/rust/pull/105368
r? `@Nilstrieb`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Warn when using panic-strategy abort for proc-macro crates
See https://github.com/rust-lang/rust/issues/82320, this simply warns for now as that seems like the best step that can be immediately taken (opposed to straight up rejecting or ignoring)
|
|
Add log-backtrace option to show backtraces along with logging
according to #90698, I added a compiler option, `-Zlog-backtrace=filter`, where `filter` is a module name, to show backtraces for logging without rebuilding.
resolve #90698
|
|
|
|
|
|
|
|
|
|
|
|
untracked field
|
|
|
|
|