| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
The new flag has been described in the Major Change Proposal at
https://github.com/rust-lang/compiler-team/issues/656
|
|
detects redundant imports that can be eliminated.
for #117772 :
In order to facilitate review and modification, split the checking code and
removing redundant imports code into two PR.
|
|
2. jobserver::initialize_checked should call before build_session, still should use EarlyErrorHandler, so revert stderr change in #118635
|
|
Fewer early errors
r? `@davidtwco`
|
|
Remove deprecated `--check-cfg` syntax
This PR removes the deprecated `--check-cfg` `names(...)` and `values(...)` syntax.
Follow up to https://github.com/rust-lang/rust/pull/111072
Part of https://github.com/rust-lang/compiler-team/issues/636
r? compiler
|
|
`build_session` is passed an `EarlyErrorHandler` and then constructs a
`Handler`. But the `EarlyErrorHandler` is still used for some time after
that.
This commit changes `build_session` so it consumes the passed
`EarlyErrorHandler`, and also drops it as soon as the `Handler` is
built. As a result, `parse_cfg` and `parse_check_cfg` now take a
`Handler` instead of an `EarlyErrorHandler`.
|
|
|
|
Instead of allowing `rustc::potential_query_instability` on the whole
crate we go over each lint and allow it individually if it is safe to
do. Turns out all instances were safe to allow in this crate.
|
|
|
|
|
|
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug`
follows the pattern used everywhere else: `span_err`, `span_warning`,
etc.
|
|
This is intended to be used for Linux kernel RETHUNK builds.
With this commit (optionally backported to Rust 1.73.0), plus a
patched Linux kernel to pass the flag, I get a RETHUNK build with
Rust enabled that is `objtool`-warning-free and is able to boot in
QEMU and load a sample Rust kernel module.
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
|
|
|
|
change it's return type from Option<QueryMap> to QueryMap
As there currently always Some(...) inside
|
|
Eagerly compute output_filenames
It can be computed before creating TyCtxt. Previously the query would also write the dep info file, which meant that the output filenames couldn't be accessed before macro expansion is done. The dep info file writing is now done as a separate non-query function. The old query was always executed again anyways due to depending on the HIR.
Also encode the output_filenames in rlink files to ensure `#![crate_name]` affects the linking stage when doing separate compiling and linking using `-Zno-link`/`-Zlink-only`.
|
|
It has side-effects and as such can't be cached.
|
|
build_output_filenames"
|
|
|
|
Since the introduction of the crate attribute pre-expansion pass we
don't need access to the TyCtxt to compute it.
|
|
This ensures that linking will use the correct crate name even when
`#![crate_name = "..."]` is used to specify the crate name.
|
|
|
|
|
|
Rollup of 4 pull requests
Successful merges:
- #118296 (rustdoc: replace `elemIsInParent` with `Node.contains`)
- #118302 (Clean dead codes)
- #118311 (merge `DefKind::Coroutine` into `Defkind::Closure`)
- #118318 (Remove myself from users on vacation)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Call FileEncoder::finish in rmeta encoding
Fixes https://github.com/rust-lang/rust/issues/117254
The bug here was that rmeta encoding never called FileEncoder::finish. Now it does. Most of the changes here are needed to support that, since rmeta encoding wants to finish _then_ access the File in the encoder, so finish can't move out.
I tried adding a `cfg(debug_assertions)` exploding Drop impl to FileEncoder that checked for finish being called before dropping, but fatal errors cause unwinding so this isn't really possible. If we encounter a fatal error with a dirty FileEncoder, the Drop impl ICEs even though the implementation is correct. If we try to paper over that by wrapping FileEncoder in ManuallyDrop then that just erases the fact that Drop automatically checks that we call finish on all paths.
I also changed the name of DepGraph::encode to DepGraph::finish_encoding, because that's what it does and it makes the fact that it is the path to FileEncoder::finish less confusing.
r? `@WaffleLapkin`
|
|
|
|
Currently we always do this:
```
use rustc_fluent_macro::fluent_messages;
...
fluent_messages! { "./example.ftl" }
```
But there is no need, we can just do this everywhere:
```
rustc_fluent_macro::fluent_messages! { "./example.ftl" }
```
which is shorter.
|
|
The `fluent_messages!` macro produces uses of
`crate::{D,Subd}iagnosticMessage`, which means that every crate using
the macro must have this import:
```
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
```
This commit changes the macro to instead use
`rustc_errors::{D,Subd}iagnosticMessage`, which avoids the need for the
imports.
|
|
This allows avoiding some if != 0 checks when allocating worker-local
datasets.
|
|
|
|
Queries cleanups
r? `@bjorn3`
|
|
`rustc_ast_pretty` cleanups
Some improvements I found while looking at this code.
r? `@fee1-dead`
|
|
There is no real need for them to be separate.
|
|
And remove the relevant getters on `Compiler` and `Queries`.
|
|
|
|
|
|
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`.
Then I had to remove a few unnecessary parens and muts that were exposed
now.
|
|
Like `Compiler::codegen_backend`.
|
|
|
|
It matches the type, and a noun makes more sense than a verb.
The `output_filenames` function still uses a profiling label named
`prepare_outputs`, but I think that makes sense as a verb and can be
left unchanged.
|
|
It can easily be passed in. And that removes the single clone of
`Compiler::codegen_backend`, which means it no longer needs to be `Lrc`.
|
|
It can easily be passed in. And that removes the single clone of
`Compiler::session`, which means it no longer needs to be `Lrc`.
|
|
|
|
Lint registration now happens early enough that we can run it from
`Config`, before `Compiler` is created.
|
|
This was made possible by the removal of plugin support, which
simplified lint store creation.
This simplifies the places in rustc and rustdoc that call
`describe_lints`, which are early on. The lint store is now built before
those places, so they don't have to create their own lint store for
temporary use, they can just use the main one.
|
|
|
|
|