| Age | Commit message (Collapse) | Author | Lines |
|
- libarena
- librustc_allocator
- librustc_borrowck
- librustc_codegen_ssa
- librustc_codegen_utils
- librustc_driver
- librustc_errors
- librustc_incremental
- librustc_metadata
- librustc_passes
- librustc_privacy
- librustc_resolve
- librustc_save_analysis
- librustc_target
- librustc_traits
- libsyntax
- libsyntax_ext
- libsyntax_pos
|
|
When moving out of a for loop head, suggest borrowing it
When encountering code like the following, suggest borrowing the for loop
head to avoid moving it into the for loop pattern:
```
fn main() {
let a = vec![1, 2, 3];
for i in &a {
for j in a {
println!("{} * {} = {}", i, j, i * j);
}
}
}
```
Fix #25534.
|
|
When encountering code like the following, suggest borrowing the for loop
head to avoid moving it into the for loop pattern:
```
fn main() {
let a = vec![1, 2, 3];
for i in &a {
for j in a {
println!("{} * {} = {}", i, j, i * j);
}
}
}
```
|
|
This commit removes `CtorOf` from `Node::Ctor` as the parent of the
constructor can be determined by looking at the node's parent in the few
places where knowing this is necessary.
|
|
This commit makes two changes - separating the `NodeId` that identifies
an enum variant from the `NodeId` that identifies the variant's
constructor; and no longer creating a `NodeId` for `Struct`-style enum
variants and structs.
Separation of the variant id and variant constructor id will allow the
rest of RFC 2008 to be implemented by lowering the visibility of the
variant's constructor without lowering the visbility of the variant
itself.
No longer creating a `NodeId` for `Struct`-style enum variants and
structs mostly simplifies logic as previously this `NodeId` wasn't used.
There were various cases where the `NodeId` wouldn't be used unless
there was an unit or tuple struct or enum variant but not all uses of
this `NodeId` had that condition, by removing this `NodeId`, this must
be explicitly dealt with. This change mostly applied cleanly, but there
were one or two cases in name resolution and one case in type check
where the existing logic required a id for `Struct`-style enum variants
and structs.
|
|
HirIdification: kill off NodeId stragglers
The final stages of HirIdification (#57578).
This PR, along with https://github.com/rust-lang/rust/pull/59042, should finalize the HirIdification process (at least the more straightforward bits).
- replace `NodeId` with `HirId` in `trait_impls`
- remove all `NodeId`s from `borrowck`
- remove all `NodeId`s from `typeck`
- remove all `NodeId`s from `mir`
- remove `trait_auto_impl` (unused)
I would be cool to also remove `NodeId` from `hir::def::Def`, `middle::privacy::AccessLevel` and `hir::ItemId`, but I don't know if this is feasible.
I'll be happy to do more if I've missed anything.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Cleanup: rename node_id_to_type(_opt)
Renames `node_id_to_type(_opt)` to `hir_id_to_type(_opt)`; this makes it clear we are dealing with HIR nodes and their IDs here.
In addition, a drive-by commit removing `ty::item_path::hir_path_str` (as requested by @eddyb).
|
|
|
|
|
|
librustc_borrowck => 2018
Transitions `librustc_borrowck` to Rust 2018; cc #58099
r? @Centril
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NLL: Add union justifications to conflicting borrows.
Fixes #57100.
This PR adds justifications to error messages for conflicting borrows of union fields.
Where previously an error message would say ``cannot borrow `u.b` as mutable..``, it now says ``cannot borrow `u` (via `u.b`) as mutable..``.
r? @pnkfelix
|
|
This commit improves diagnostic labels to mention which field a borrow
overlaps with and adds a note explaining that the fields overlap.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Refactoring out the HirId of the UpvarId in another struct.
|
|
|
|
pnkfelix:issues-47215-54797-fix-ice-from-moving-out-of-thread-local-under-ast-borrowck, r=nikomatsakis
Do not allow moving out of thread local under ast borrowck
AST borrowck failed to prevent moving out of a thread-local static.
This was broken. And it also (sometimes?) caused an ICE during drop elaboration.
Fix #47215
Fix #54797
|
|
|
|
|
|
|
|
This commit extends existing special-casing of closures to highlight the
use of variables within generators that are causing the generator to
borrow them.
|
|
quite rvalues
(and of course they are not quite statics either).
Namely, they *do* have a restricted region (like rvalues), but they
also cannot be moved out of (like statics).
|
|
Cleanup: remove graphviz::IntoCow
It's just `Into<Cow<...>>` and the applicable methods already exist for `Vec`/`[T]` and `String`/`str`.
|
|
|
|
Only warn about unused `mut` in user-written code
Fixes https://github.com/rust-lang/rust/issues/54586.
r? @pnkfelix
cc @blitzerr
|
|
|
|
|
|
|
|
This commit adds an `ImplicitSelfKind` to the HIR and the MIR that keeps
track of whether a implicit self argument is immutable by-value, mutable
by-value, immutable reference or mutable reference so that the addition
of the `mut` keyword can be suggested for the immutable by-value case.
|