| Age | Commit message (Collapse) | Author | Lines |
|
The reduction in `memcpy` calls greatly outweighs the cost of the extra
allocations, for a net performance win.
|
|
These are types that get memcpy'd a lot.
|
|
Modify files performing pluralisation checks to incorporate the
dedicated macro located in `syntax::errors`.
|
|
Add methods for converting `bool` to `Option<T>`
This provides a reference implementation for https://github.com/rust-lang/rfcs/pull/2757.
|
|
Support "soft" feature-gating using a lint
Use it for feature-gating `#[bench]`.
Closes https://github.com/rust-lang/rust/issues/63798.
|
|
Use it for feature-gating `#[bench]`
|
|
Aggregation of cosmetic changes made during work on REPL PRs: librustc
Factored out from hacking on rustc for work on the REPL.
r? @Centril
|
|
Migrate internal diagnostic registration to macro_rules
Review is best done commit-by-commit.
Fixes #64132.
|
|
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
|
|
|
|
|
|
Correct pluralisation of various diagnostic messages
|
|
Move the HIR CFG to `rustc_ast_borrowck`
No new code should be using it.
|
|
Use hygiene for AST passes
AST passes are now able to have resolve consider their expansions as if they were opaque macros defined either in some module in the current crate, or a fake empty module with `#[no_implicit_prelude]`.
* Add an ExpnKind for AST passes.
* Remove gensyms in AST passes.
* Remove gensyms in`#[test]`, `#[bench]` and `#[test_case]`.
* Allow opaque macros to define tests.
* Move tests for unit tests to their own directory.
* Remove `Ident::{gensym, is_gensymed}` - `Ident::gensym_if_underscore` still exists.
cc #60869, #61019
r? @petrochenkov
|
|
|
|
No new code should be using it.
|
|
Fixed grammar/style in some error messages
Factored out from hacking on rustc for work on the REPL.
r? @Centril
|
|
Fix miri
fixes #64109
cc @HeroicKatora
cc @RalfJung
|
|
|
|
or-patterns: Uniformly use `PatKind::Or` in AST & Fix/Cleanup resolve
Following up on work in https://github.com/rust-lang/rust/pull/63693 and https://github.com/rust-lang/rust/pull/61708, in this PR we:
- Uniformly use `PatKind::Or(...)` in AST:
- Change `ast::Arm.pats: Vec<P<Pat>>` => `ast::Arm.pat: P<Pat>`
- Change `ast::ExprKind::Let.0: Vec<P<Pat>>` => `ast::ExprKind::Let.0: P<Pat>`
- Adjust `librustc_resolve/late.rs` to correctly handle or-patterns at any level of nesting as a result.
In particular, the already-bound check which rejects e.g. `let (a, a);` now accounts for or-patterns. The consistency checking (ensures no missing bindings and binding mode consistency) also now accounts for or-patterns. In the process, a bug was found in the current compiler which allowed:
```rust
enum E<T> { A(T, T), B(T) }
use E::*;
fn foo() {
match A(0, 1) {
B(mut a) | A(mut a, mut a) => {}
}
}
```
The new algorithms took a few iterations to get right. I tried several clever schemes but ultimately a version based on a stack of hashsets and recording product/sum contexts was chosen since it is more clearly correct.
- Clean up `librustc_resolve/late.rs` by, among other things, using a new `with_rib` function to better ensure stack dicipline.
- Do not push the change in AST to HIR for now to avoid doing too much in this PR. To cope with this, we introduce a temporary hack in `rustc::hir::lowering` (clearly marked in the diff).
cc https://github.com/rust-lang/rust/issues/54883
cc @dlrobertson @matthewjasper
r? @petrochenkov
|
|
|
|
|
|
|
|
The global restriction is 100, but since error codes are printed out via
--explain we want to restrict them to just 80 columns.
|
|
|
|
|
|
Rollup of 11 pull requests
Successful merges:
- #62848 (Use unicode-xid crate instead of libcore)
- #63774 (Fix `window.hashchange is not a function`)
- #63930 (Account for doc comments coming from proc macros without spans)
- #64003 (place: Passing `align` = `layout.align.abi`, when also passing `layout`)
- #64030 (Fix unlock ordering in SGX synchronization primitives)
- #64041 (use TokenStream rather than &[TokenTree] for built-in macros)
- #64051 (Add x86_64-linux-kernel target)
- #64063 (Fix const_err with `-(-0.0)`)
- #64083 (Point at appropriate arm on type error on if/else/match with one non-! arm)
- #64100 (Fix const eval bug breaking run-pass tests in Miri)
- #64157 (Opaque type locations in error message for clarity.)
Failed merges:
r? @ghost
|
|
Opaque type locations in error message for clarity.
Attempts to fix #63167
|
|
Extend Polonius fact generation for (some) move tracking
This PR will extend rustc to emit facts used for tracking moves and initialization in Polonius. It is most likely the final part of my master's thesis work.
|
|
Introduces a temporary hack to keep `Vec<P<Pat>>` in
`hir::Arm.pats` so that we keep the changes more incremental.
|
|
|
|
r=petrochenkov
Minimize uses of `LocalInternedString`
`LocalInternedString` is described as "An alternative to `Symbol` and `InternedString`, useful when the chars within the symbol need to be accessed. It is best used for temporary values."
This PR makes the code match that comment, by removing all non-local uses of `LocalInternedString`. This allows the removal of a number of operations on `LocalInternedString` and a couple of uses of `unsafe`.
|
|
Refer to "`self` type" instead of "receiver type"
Fix https://github.com/rust-lang/rust/issues/42603.
|
|
r=varkor
Check impl trait substs when checking for recursive types
closes #64004
|
|
Add a `Place::is_indirect` method to determine whether a `Place` contains a `Deref` projection
Working on #63860 requires tracking some property about each local. This requires differentiating `Place`s like `x` and `x.field[index]` from ones like `*x` and `*x.field`, since the first two will always access the same region of memory as `x` while the latter two may access any region of memory. This functionality is duplicated in various places across the compiler. This PR adds a helper method to `Place` which determines whether that `Place` has a `Deref` projection at any point and changes some existing code to use the new method.
I've not converted `qualify_consts.rs` to use the new method, since it's not a trivial conversion and it will get replaced anyway by #63860. There may be other potential uses besides the two I change in this PR.
r? @oli-obk
|
|
|
|
|
|
|
|
This is not a compelling change in isolation, but it is a necessary
step.
|
|
|
|
Emit error on intrinsic to fn ptr casts
I'm not sure if a type error is the best way of doing this but it seemed like a relatively correct place to do it, and I expect this is a pretty rare case to hit anyway.
Fixes #15694
|
|
Account for arbitrary self types in E0599
Fix https://github.com/rust-lang/rust/issues/62373
|
|
Value was renamed to Operand in https://github.com/rust-lang/rust/commit/ad2de8b4ee099916113b7b3577ac86857b1568be
ScalarPair to Slice in https://github.com/rust-lang/rust/commit/fe50b4eb1d6f7a31c53798bca3d0fa2b0670fa3d
Not familiar enough with rustc's source to know if the comment is even still applicable.
|
|
|
|
|
|
|
|
|
|
Make Allocation::bytes private
Fixes #62931.
Direct immutable access to the bytes is still possible but redirected through the new method `raw_bytes_with_undef_and_ptr`, similar to `get_bytes_with_undef_and_ptr` but without requiring an interpretation context and not doing *any* relocation or bounds checks. The `size` of the allocation is stored separately which makes access as `Size` and `usize` more ergonomic.
cc: @RalfJung
|
|
|
|
|