| Age | Commit message (Collapse) | Author | Lines |
|
-Z unpretty no longer requires -Z unstable-options. Also, I mildly
changed the syntax of the flag to match the other -Z flags. All uses of
the flag take the form `unpretty=something` where something can either
`string` or `string=string` (see the help messages of the CLI).
|
|
This avoids a breaking change to dep-info output, putting the
gcc/clang-compliant dep-info behavior behind a flag
|
|
|
|
Move "no asm" check into AST validation
|
|
rustc: Tweak `#[target_feature]` syntax
This is an implementation of the `#[target_feature]` syntax-related changes of
[RFC 2045][rfc]. Notably two changes have been implemented:
* The new syntax is `#[target_feature(enable = "..")]` instead of
`#[target_feature = "+.."]`. The `enable` key is necessary instead of the `+`
to indicate that a feature is being enabled, and a sub-list is used for
possible expansion in the future. Additionally within this syntax the feature
names being enabled are now whitelisted against a known set of target feature
names that we know about.
* The `#[target_feature]` attribute can only be applied to unsafe functions. It
was decided in the RFC that invoking an instruction possibly not defined for
the current processor is undefined behavior, so to enable this feature for now
it requires an `unsafe` intervention.
[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/2045-target-feature.md
|
|
This'll enable running queries that could be cached and overall be more amenable
to the query infastructure.
|
|
|
|
No longer parse it.
Remove AutoTrait variant from AST and HIR.
Remove backwards compatibility lint.
Remove coherence checks, they make no sense for the new syntax.
Remove from rustdoc.
|
|
r=alexcrichton
Add -Ztime-passes line for dep-graph loading.
We measure how much time the background thread spends on loading the dep-graph but not how long the main thread is blocked while the background thread is still working. Let's change that!
|
|
|
|
|
|
Remove unused LLVM related code
Ticks a few more boxes on #46437
|
|
Upgrade `log` to `0.4` in multiple crates.
|
|
The same effect can be achieved using -Cllvm-args=-debug
Refs #46437 as it removes LLVMRustSetDebug()
|
|
These no longer work now that Cargo changes the cwd of rustc while it's running.
Instead use an absolute path that's set by rustbuild.
|
|
|
|
Work towards thread safety in rustc
This PR is split out from https://github.com/rust-lang/rust/pull/45912. It contains changes which do not require the `sync` module.
|
|
Do not emit type errors on recovered blocks
When a parse error occurs on a block, the parser will recover and create
a block with the statements collected until that point. Now a flag
stating that a recovery has been performed in this block is propagated
so that the type checker knows that the type of the block (which will be
identified as `()`) shouldn't be checked against the expectation to
reduce the amount of irrelevant diagnostic errors shown to the user.
Fix #44579.
|
|
When a parse error occurs on a block, the parser will recover and create
a block with the statements collected until that point. Now a flag
stating that a recovery has been performed in this block is propagated
so that the type checker knows that the type of the block (which will be
identified as `()`) shouldn't be checked against the expectation to
reduce the amount of irrelevant diagnostic errors shown to the user.
|
|
Prevent rustc overwriting input files
If rustc is invoked on a file that would be overwritten by the
compilation, the compilation now fails, to avoid accidental loss. This
resolves #13019. Kudos to @estebank, whose patch I finished off.
|
|
|
|
|
|
|
|
If rustc is invoked on a file that would be overwritten by the
compilation, the compilation now fails, to avoid accidental loss. This
resolves #13019.
|
|
|
|
Loading the dependency graph in the background
Patch is a bit longer than I expected, due to the fact that most of this code relies upon a `Session` value, which is not `Sync`.
|
|
background thread
|
|
Help Cargo tolerate RUSTFLAGS="--print=native-static-libs"
Alternative to https://github.com/rust-lang/cargo/pull/4807
Having this "error" message was a mistake, as it's firing at exactly wrong time when Cargo is trying to read the output of other print commands.
|
|
[MIR-borrowck] Two phase borrows
This adds limited support for two-phase borrows as described in
http://smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/
The support is off by default; you opt into it via the flag `-Z two-phase-borrows`
I have written "*limited* support" above because there are simple variants of the simple `v.push(v.len())` example that one would think should work but currently do not, such as the one documented in the test compile-fail/borrowck/two-phase-reservation-sharing-interference-2.rs
(To be clear, that test is not describing something that is unsound. It is just providing an explicit example of a limitation in the implementation given in this PR. I have ideas on how to fix, but I want to land the work that is in this PR first, so that I can stop repeatedly rebasing this branch.)
|
|
|
|
|
|
Having the HIR local id is useful for cases like understanding the
ReScope identifiers, which are now derived from the HIR local id, and
thus one can map an ReScope back to the HIR node, once one knows what
those local ids are.
|
|
|
|
Now that we made `resolve_lifetimes` into a query, elision errors no
longer abort compilation, which affects some tests.
Also, remove `dep_graph_crosscontaminate_tables` -- there is no a path in
the dep-graph, though red-green handles it. The same scenario
is (correctly) tested by issue-42602.rs in any case.
|
|
|
|
Clarify what `-D warnings` or `-F warnings` does
They set all lints currently on the warning level to `deny` or `forbid`,
respectively.
|
|
This revealed some shortcomings, one of which is fixed. Fixes #45937.
|
|
|
|
This commit alters how we compile LLVM by default enabling the WebAssembly
backend. This then also adds the wasm32-unknown-unknown target to get compiled
on the `cross` builder and distributed through rustup. Tests are not yet enabled
for this target but that should hopefully be coming soon!
|
|
add -Zunpretty=hir-tree
This uses the debug impls to dump the raw HIR. Particularly useful when
learning how the compiler works.
cc @qmx
|
|
They set all lints currently on the warning level to `deny` or `forbid`,
respectively.
|
|
Good riddance.
|
|
rustc_driver: expose a way to override query providers in CompileController.
This API has been a long-time coming and will probably become the main method for custom drivers (that is, binaries other than `rustc` itself that use `librustc_driver`) to adapt the compiler's behavior.
|
|
|
|
|
|
|
|
Allow overriding the TLS model
This PR adds the ability to override the default "global-dynamic" TLS model with a more specific one through a target json option or a command-line option. This allows for better code generation in certain situations.
This is similar to the `-ftls-model=` option in GCC and Clang.
|
|
DefaultImpl is a highly confusing name for what we now call auto impls,
as in `impl Send for ..`. The name auto impl is not formally decided
but for sanity anything is better than `DefaultImpl` which refers
neither to `default impl` nor to `impl Default`.
|
|
|
|
This uses the debug impls to dump the raw HIR. Particularly useful when
learning how the compiler works.
|