Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
043bd76
Make `layout_of` cycles fatal errors
Zoxc Feb 27, 2026
4fd1d97
Skip ICE message for fatal errors
Zoxc Mar 16, 2026
db30a36
Update tests
Zoxc Mar 16, 2026
8277043
Avoid creating async return opaques for foreign async fns
mu001999 Apr 1, 2026
910677f
Rename `HirCtx` as `Hcx`.
nnethercote Apr 1, 2026
d9a8a55
Reorder `use`/`mod` items in `rustc_session`.
nnethercote Apr 1, 2026
1a9a284
Simplify `HashStableContext`.
nnethercote Apr 1, 2026
e18dd4a
add `TypeFlags::HAS_NON_REGION_ERROR` and `TypeFlags::HAS_RE_ERROR`
makai410 Mar 16, 2026
339fb64
skip early return for region-only errors in projection types
makai410 Mar 16, 2026
fec0998
Export `derive` at `core::derive` and `std::derive`
nik-rev Mar 26, 2026
12f8364
Introduce #[diagnostic::on_move] on `Arc`
rperier Apr 1, 2026
a7a7938
Replace `DocContext` argument with `TyCtxt` in rustdoc `inline::load_…
GuillaumeGomez Apr 1, 2026
65fbfa4
Replace `DocContext` argument with `TyCtxt` in rustdoc `inline::merge…
GuillaumeGomez Apr 1, 2026
9f95c38
Replace `DocContext` argument with `TyCtxt` in rustdoc `utils::displa…
GuillaumeGomez Apr 1, 2026
f3ba2c4
Replace `DocContext` argument with `TyCtxt` in rustdoc `inline::build…
GuillaumeGomez Apr 1, 2026
58077cc
Replace `DocContext` argument with `TyCtxt` in rustdoc `clean::clean_…
GuillaumeGomez Apr 1, 2026
5a48d5e
Replace `DocContext` argument with `TyCtxt` in rustdoc `clean::clean_…
GuillaumeGomez Apr 1, 2026
d77a2ea
Replace `DocContext` argument with `TyCtxt` in rustdoc `clean::clean_…
GuillaumeGomez Apr 1, 2026
3520351
Replace `DocContext` argument with `TyCtxt` in rustdoc `Type::from_de…
GuillaumeGomez Apr 1, 2026
509a444
Replace `DocContext` argument with `TyCtxt` in rustdoc `clean::clean_…
GuillaumeGomez Apr 1, 2026
822579e
Replace `DocContext` argument with `TyCtxt` in rustdoc `types::Generi…
GuillaumeGomez Apr 1, 2026
e2f3f78
Replace `DocContext` argument with `TyCtxt` in rustdoc `clean::clean_…
GuillaumeGomez Apr 1, 2026
28ca36d
Replace `DocContext` argument with `TyCtxt` in rustdoc `simplify` fun…
GuillaumeGomez Apr 1, 2026
14aa3a9
Remove unused `DocContext` argument in `clean_middle_const`
GuillaumeGomez Apr 1, 2026
4b39934
Replace `DocContext` argument with `TyCtxt` in rustdoc `utils::print_…
GuillaumeGomez Apr 1, 2026
0b941ed
Last `DocContext`/`TyCtxt` cleanup
GuillaumeGomez Apr 1, 2026
3edc8d7
Rollup merge of #153105 - makai410:erase-if-error, r=lcnr
GuillaumeGomez Apr 1, 2026
dbc2bf6
Rollup merge of #153960 - Zoxc:fatal-layout-of-cycles, r=TaKO8Ki
GuillaumeGomez Apr 1, 2026
2395137
Rollup merge of #154666 - nnethercote:rm-StableHashContext-impls, r=p…
GuillaumeGomez Apr 1, 2026
800f338
Rollup merge of #154669 - rperier:diagnostic_on_move_for_the_arc_type…
GuillaumeGomez Apr 1, 2026
7ee62ee
Rollup merge of #154442 - nik-contrib:derive-root, r=jhpratt
GuillaumeGomez Apr 1, 2026
b52f667
Rollup merge of #154660 - mu001999-contrib:fix/146754, r=Kivooeo
GuillaumeGomez Apr 1, 2026
14b4011
Rollup merge of #154680 - GuillaumeGomez:doccontext-cleanup, r=Urgau
GuillaumeGomez Apr 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
#![feature(core_intrinsics)]
#![feature(deprecated_suggestion)]
#![feature(deref_pure_trait)]
#![feature(diagnostic_on_move)]
#![feature(dispatch_from_dyn)]
#![feature(ergonomic_clones)]
#![feature(error_generic_member_access)]
Expand Down
5 changes: 5 additions & 0 deletions library/alloc/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ macro_rules! acquire {
#[rustc_diagnostic_item = "Arc"]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_insignificant_dtor]
#[diagnostic::on_move(
message = "the type `{Self}` does not implement `Copy`",
label = "this move could be avoided by cloning the original `{Self}`, which is inexpensive",
note = "consider using `Arc::clone`"
)]
pub struct Arc<
T: ?Sized,
#[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
Expand Down
3 changes: 2 additions & 1 deletion tests/ui/moves/arc-consumed-in-looped-closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl ThreadPool {
}

fn main() {
let results = Arc::new(Mutex::new(Vec::new())); //~ NOTE move occurs because
let results = Arc::new(Mutex::new(Vec::new())); //~ NOTE this move could be avoided by cloning the original `Arc`, which is inexpensive
let pool = ThreadPool {
workers: vec![],
queue: Arc::new(()),
Expand All @@ -29,6 +29,7 @@ fn main() {
// let results = Arc::clone(&results); // Forgot this.
pool.execute(move || { //~ ERROR E0382
//~^ NOTE value moved into closure here, in previous iteration of loop
//~| NOTE consider using `Arc::clone`
//~| HELP consider cloning the value before moving it into the closure
let mut r = results.lock().unwrap(); //~ NOTE use occurs due to use in closure
r.push(i);
Expand Down
6 changes: 4 additions & 2 deletions tests/ui/moves/arc-consumed-in-looped-closure.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0382]: use of moved value: `results`
error[E0382]: the type `Arc` does not implement `Copy`
--> $DIR/arc-consumed-in-looped-closure.rs:30:22
|
LL | let results = Arc::new(Mutex::new(Vec::new()));
| ------- move occurs because `results` has type `Arc<std::sync::Mutex<Vec<i32>>>`, which does not implement the `Copy` trait
| ------- this move could be avoided by cloning the original `Arc`, which is inexpensive
...
LL | for i in 0..20 {
| -------------- inside of this loop
Expand All @@ -13,12 +13,14 @@ LL | pool.execute(move || {
LL | let mut r = results.lock().unwrap();
| ------- use occurs due to use in closure
|
= note: consider using `Arc::clone`
help: consider cloning the value before moving it into the closure
|
LL ~ let value = results.clone();
LL ~ pool.execute(move || {
LL |
LL |
LL |
LL ~ let mut r = value.lock().unwrap();
|

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/moves/no-capture-arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn main() {
assert_eq!((*arc_v)[3], 4);
});

assert_eq!((*arc_v)[2], 3); //~ ERROR borrow of moved value: `arc_v`
assert_eq!((*arc_v)[2], 3); //~ ERROR the type `Arc` does not implement `Copy`

println!("{:?}", *arc_v);
}
5 changes: 3 additions & 2 deletions tests/ui/moves/no-capture-arc.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0382]: borrow of moved value: `arc_v`
error[E0382]: the type `Arc` does not implement `Copy`
--> $DIR/no-capture-arc.rs:12:18
|
LL | let arc_v = Arc::new(v);
| ----- move occurs because `arc_v` has type `Arc<Vec<i32>>`, which does not implement the `Copy` trait
| ----- this move could be avoided by cloning the original `Arc`, which is inexpensive
LL |
LL | thread::spawn(move|| {
| ------ value moved into closure here
Expand All @@ -12,6 +12,7 @@ LL | assert_eq!((*arc_v)[3], 4);
LL | assert_eq!((*arc_v)[2], 3);
| ^^^^^ value borrowed here after move
|
= note: consider using `Arc::clone`
= note: borrow occurs due to deref coercion to `Vec<i32>`
help: consider cloning the value before moving it into the closure
|
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/moves/no-reuse-move-arc.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fn main() {
assert_eq!((*value)[3], 4);
});

assert_eq!((*arc_v)[2], 3); //~ ERROR borrow of moved value: `arc_v`
assert_eq!((*arc_v)[2], 3); //~ ERROR the type `Arc` does not implement `Copy`

println!("{:?}", *arc_v);
}
2 changes: 1 addition & 1 deletion tests/ui/moves/no-reuse-move-arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn main() {
assert_eq!((*arc_v)[3], 4);
});

assert_eq!((*arc_v)[2], 3); //~ ERROR borrow of moved value: `arc_v`
assert_eq!((*arc_v)[2], 3); //~ ERROR the type `Arc` does not implement `Copy`

println!("{:?}", *arc_v);
}
5 changes: 3 additions & 2 deletions tests/ui/moves/no-reuse-move-arc.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0382]: borrow of moved value: `arc_v`
error[E0382]: the type `Arc` does not implement `Copy`
--> $DIR/no-reuse-move-arc.rs:13:18
|
LL | let arc_v = Arc::new(v);
| ----- move occurs because `arc_v` has type `Arc<Vec<i32>>`, which does not implement the `Copy` trait
| ----- this move could be avoided by cloning the original `Arc`, which is inexpensive
LL |
LL | thread::spawn(move|| {
| ------ value moved into closure here
Expand All @@ -12,6 +12,7 @@ LL | assert_eq!((*arc_v)[3], 4);
LL | assert_eq!((*arc_v)[2], 3);
| ^^^^^ value borrowed here after move
|
= note: consider using `Arc::clone`
= note: borrow occurs due to deref coercion to `Vec<i32>`
help: consider cloning the value before moving it into the closure
|
Expand Down