| Age | Commit message (Collapse) | Author | Lines |
|
Split `join_codegen_and_link()` into two steps
`join_codegen_and_link()` is split to `join_codegen()` and `link()`.
|
|
`join_codegen_and_link()` is split to `join_codegen()` and `link()`.
|
|
Implement MIR lowering for or-patterns
This is the last thing needed to get meaningful run-pass tests for or-patterns. There probably need to be more tests before stabilizing this, but the most important cases should have been covered.
Note: we can generate exponentially large MIR CFGs when using or-patterns containing bindings, type ascriptions, or that are for a match arm with a guard. `src/test/mir-opt/exponential-or.rs` shows the best case for what we currently do.
cc #54883
closes #60350
closes #67514
cc @Centril
r? @pnkfelix
|
|
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
|
|
|
|
Test that `#[track_caller]` as `fn()` respects RT / CTFE equivalence
r? @RalfJung cc @anp @eddyb
|
|
Do not ICE in `type-alias-impl-trait` with save-analysis
FIxes #68621
Fixes #68750
|
|
|
|
add raw-addr-of variant to mir_raw_fat_ptr
As suggested at https://github.com/rust-lang/rust/pull/48300#discussion_r372520388
r? @eddyb
|
|
Avoid exponential behaviour when relating types
When equating bound types we check subtyping in both directions. Since closures are invariant in their substs, we end up comparing the two types an exponential number of times. If there are no bound variables this isn't needed.
Closes #68061
|
|
Fix ICE with save-analysis
Fixes #68749
It should be fine since it's the same way as `visit_expr`.
|
|
Use `next_point` to avoid ICE
Fixes #68730
r? @estebank (I think you're familiar with that)
|
|
|
|
parser: syntactically allow `self` in all `fn` contexts
Part of https://github.com/rust-lang/rust/pull/68728.
`self` parameters are now *syntactically* allowed as the first parameter irrespective of item context (and in function pointers). Instead, semantic validation (`ast_validation`) is used.
r? @petrochenkov
|
|
Do not suggest duplicate bounds
Fixes #68205
Fixes #68695
r? @estebank
|
|
Issue error on `compile-fail` header in UI test
Fixes #68732
r? @Centril
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Deduplicate types in the generator witness
For the `await-call-tree` benchmark this often reduces the types inside the witness from 12 to 2.
|
|
|
|
|
|
Do not suggest things named underscore
Fixes #68719
r? @estebank
|
|
xfix:remove-comment-about-pretty-printer-in-format-tests, r=jonas-schievink
Remove a comment about pretty printer in formatting tests
rustc is now using rustfmt, not the old formatter.
|
|
Suggest path separator for single-colon typos
This commit adds guidance for when a user means to type a path, but ends
up typing a single colon, such as `<<Impl as T>:Ty>`.
This change seemed pertinent as the current error message is
particularly misleading, emitting `error: unmatched angle bracket`,
despite the angle bracket being matched later on, leaving the user to
track down the typo'd colon.
|
|
Add some basic run-pass ui tests for or-patterns.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Slimmer syntax
High-level summary of changes:
- The `syntax::node_count` pass is moved into `rustc_ast_passes`. This works towards improving #65031 by making compiling `syntax` go faster.
- The `syntax::{GLOBALS, with_globals, ..}` business is consolidated into `syntax::attr` for cleaner code and future possible improvements.
- The pretty printer loses its dependency on `ParseSess`, opting to use `SourceMap` & friends directly instead.
- Some drive by cleanup of `syntax::attr::HasAttr` happens.
- Builtin attribute logic (`syntax::attr::builtin`) + `syntax::attr::allow_internal_unstable` is moved into a new `rustc_attr` crate. More logic from `syntax::attr` should be moved into that crate over time. This also means that `syntax` loses all mentions of `ParseSess`, which enables the next point.
- The pretty printer `syntax::print` is moved into a new crate `rustc_ast_pretty`.
- `rustc_session::node_id` is moved back as `syntax::node_id`. As a result, `syntax` gets to drop dependencies on `rustc_session` (and implicitly `rustc_target`), `rustc_error_codes`, and `rustc_errors`. Moreover `rustc_hir` gets to drop its dependency on `rustc_session` as well. At this point, these crates are mostly "pure data crates", which is approaching a desirable end state.
- We should consider renaming `syntax` to `rustc_ast` now.
|
|
|
|
|
|
Add support for Control Flow Guard on Windows.
LLVM now supports Windows Control Flow Guard (CFG): https://github.com/llvm/llvm-project/commit/d157a9bc8ba1085cc4808c6941412322a7fd884e
This patch adds support for rustc to emit the required LLVM module flags to enable CFG metadata (cfguard=1) or metadata and checks (cfguard=2). The LLVM module flags are ignored on unsupported targets and operating systems.
|
|
rustc is now using rustfmt, not the old formatter.
|
|
Remove incorrect debug assertions from catch_unwind
Previously the debug assertions in the implementation of catch_unwind
used to verify consistency of the panic count by checking that the count
is zero just before leaving the function. This incorrectly assumed that
no panic was in progress when entering `catch_unwind`.
Fixes #68696.
|
|
Avoid ICE in macro's diagnostics
Fixes #68629
r? @estebank
|
|
Address inconsistency in using "is" with "declared here"
"is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout.
r? @Centril
|
|
Rollup of 6 pull requests
Successful merges:
- #68588 (check_unsafety: more code reuse)
- #68638 (Add missing links for cmp traits)
- #68660 (Fix typo.)
- #68669 (suggest adding space in accidental doc comments)
- #68670 (clarify "incorrect issue" error)
- #68680 (Add `#![doc(html_playground_url = ...)]` to alloc crate)
Failed merges:
r? @ghost
|
|
clarify "incorrect issue" error
Changes the message to be more precise, shrinks the span and adds a label specifying why the `issue` field is incorrect.
|
|
Change opt-level from 2 back to 3
In Cargo.toml, the opt-level for `release` and `bench` was overridden to be 2. This was to work around a problem with LLVM 7. However, rust no longer uses LLVM 7, so this is hopefully no longer needed?
I tried a little bit to replicate the original problem, and could not. I think running this through CI is the best way to smoke test this :) Even if things break dramatically, the comment should be updated to reflect that things are still broken with LLVM 9.
I'm just getting started playing with the compiler, so apologies if I've missed an obvious problem here.
fixes #52378
(possibly relevant is the [current update to LLVM 10](https://github.com/rust-lang/rust/pull/67759))
|
|
Previously the debug assertions in the implementation of catch_unwind
used to verify consistency of the panic count by checking that the count
is zero just before leaving the function. This incorrectly assumed that
no panic was in progress when entering `catch_unwind`.
|
|
This commit adds guidance for when a user means to type a path, but ends
up typing a single colon, such as `<<Impl as T>:Ty>`.
This change seemed pertinent as the current error message is
particularly misleading, emitting `error: unmatched angle bracket`,
despite the angle bracket being matched later on, leaving the user to
track down the typo'd colon.
|
|
In Cargo.toml, the opt-level for `release` and `bench` was
overridden to be 2. This was to work around a problem with LLVM
7. However, rust no longer uses LLVM 7, so this is no longer
needed.
This creates a small compile time regression in MIR constant eval,
so I've added a #[inline(always)] on the `step` function used in
const eval
Also creates a binary size increase in wasm-stringify-ints-small,
so I've bumped the limit there.
|
|
|