Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a5e4dc9
Handle generic reborrow in expression-use adjustment walking
P8L1 May 28, 2026
640d7ae
Update task.rs
xmh0511 Jun 10, 2026
4671f48
Update wake.rs
xmh0511 Jun 10, 2026
4528827
Update wake.rs
xmh0511 Jun 10, 2026
61aa163
Update library/core/src/task/wake.rs
xmh0511 Jun 10, 2026
c5c5e81
Update wake.rs
xmh0511 Jun 10, 2026
e65db42
Update library/core/src/task/wake.rs
xmh0511 Jun 10, 2026
16ccf8e
Update library/alloc/src/task.rs
xmh0511 Jun 11, 2026
a0ecf25
Update library/core/src/task/wake.rs
xmh0511 Jun 11, 2026
0954d4c
Update wake.rs
xmh0511 Jun 12, 2026
42538ca
Update library/core/src/task/wake.rs
xmh0511 Jun 15, 2026
c3fc863
Make `proc_macro::ConversionErrorKind` non exhaustive
GuillaumeGomez Jun 15, 2026
d8953cd
Document Panic in `get_module_children`
bushrat011899 Jun 17, 2026
b8d7dcb
fix(thir): visit reborrow source expressions
kevin-valerio Jun 17, 2026
a487aec
Match all fields and removing `..`
kevin-valerio Jun 17, 2026
ef672ad
format reborrow visitor arm
kevin-valerio Jun 17, 2026
36f5b3f
Document transient connection errors from TcpListener::accept
valentynkit Jun 17, 2026
7786ffc
Bump thin-vec to 0.2.18 to address RUSTSEC-2026-0103
Turbo87 Jun 18, 2026
fee82a3
rustdoc-json-types: Replace bincode dev-dependency with postcard
Turbo87 Jun 18, 2026
34d3eed
Document the file-descriptor-limit error from TcpListener::accept
valentynkit Jun 18, 2026
1447519
Document the out-of-memory error from TcpListener::accept
valentynkit Jun 18, 2026
dbf6d75
`RegionValues`: disable unnecessary range check
amandasystems Jun 17, 2026
ebea09f
renovate: Skip dashboard approval for GitHub Actions updates
Turbo87 Jun 18, 2026
cfadf6e
renovate: Enable monthly lock file maintenance
Turbo87 Jun 18, 2026
4e0bcfc
renovate: Extend `config:recommended` preset
Turbo87 Jun 18, 2026
5db91c4
renovate: Enable config migration PRs
Turbo87 Jun 18, 2026
d9397d0
Rollup merge of #158026 - amandasystems:region-values-point-no-range-…
JonathanBrouwer Jun 18, 2026
b12c362
Rollup merge of #156795 - P8L1:fix-generic-reborrow-expr-use-visitor,…
JonathanBrouwer Jun 18, 2026
43b2a60
Rollup merge of #157694 - xmh0511:main, r=Darksonn
JonathanBrouwer Jun 18, 2026
3ecdd65
Rollup merge of #157935 - GuillaumeGomez:ConversionErrorKind-non-exha…
JonathanBrouwer Jun 18, 2026
338c8c7
Rollup merge of #158002 - bushrat011899:get_module_children_unwrap, r…
JonathanBrouwer Jun 18, 2026
9e0a2c1
Rollup merge of #158034 - kevin-valerio:fix/issue-158033-reborrow-sou…
JonathanBrouwer Jun 18, 2026
d3ab997
Rollup merge of #158072 - Turbo87:update-thin-vec, r=lqd
JonathanBrouwer Jun 18, 2026
e0b878a
Rollup merge of #158074 - valentynkt:docs/accept-transient-errors, r=…
JonathanBrouwer Jun 18, 2026
678c7f2
Rollup merge of #158077 - Turbo87:bincode-replacement, r=GuillaumeGomez
JonathanBrouwer Jun 18, 2026
364f0a5
Rollup merge of #158086 - Turbo87:renovate-config, r=marcoieni
JonathanBrouwer Jun 18, 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
15 changes: 13 additions & 2 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
// Open a PR to migrate the config when Renovate deprecates syntax
":configMigration",
// Refresh lock files on the first day of each month
// (still gated by dashboard approval for now)
":maintainLockFilesMonthly",
// Pin GitHub Actions to their commit SHA digests, resolving floating tags
// (e.g. `v4`) to the full SemVer version (e.g. `v4.1.2`)
"helpers:pinGitHubActionDigestsToSemver"
],
// Let Renovatebot keep an opened issue that tracks our dependencies
"dependencyDashboard": true,
// Require manual approval from the Dependency Dashboard before opening PRs
"dependencyDashboardApproval": true,
"packageRules": [
{
// No dashboard approval necessary for GitHub Actions updates
"matchManagers": ["github-actions"],
"dependencyDashboardApproval": false
}
],
// Don't manage dependencies inside subtrees. They are updated upstream and
// synced in. See `src/doc/rustc-dev-guide/src/external-repos.md` for the list.
"ignorePaths": [
Expand Down
39 changes: 36 additions & 3 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,15 @@ dependencies = [
"cc",
]

[[package]]
name = "cobs"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1"
dependencies = [
"thiserror 2.0.17",
]

[[package]]
name = "codespan-reporting"
version = "0.13.1"
Expand Down Expand Up @@ -1330,6 +1339,18 @@ dependencies = [
"stable_deref_trait",
]

[[package]]
name = "embedded-io"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced"

[[package]]
name = "embedded-io"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d"

[[package]]
name = "ena"
version = "0.14.3"
Expand Down Expand Up @@ -3055,6 +3076,18 @@ dependencies = [
"portable-atomic",
]

[[package]]
name = "postcard"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24"
dependencies = [
"cobs",
"embedded-io 0.4.0",
"embedded-io 0.6.1",
"serde",
]

[[package]]
name = "potential_utf"
version = "0.1.4"
Expand Down Expand Up @@ -4978,7 +5011,7 @@ dependencies = [
name = "rustdoc-json-types"
version = "0.1.0"
dependencies = [
"bincode",
"postcard",
"rkyv",
"rustc-hash 2.1.1",
"serde",
Expand Down Expand Up @@ -5554,9 +5587,9 @@ dependencies = [

[[package]]
name = "thin-vec"
version = "0.2.15"
version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da322882471314edc77fa5232c587bcb87c9df52bfd0d7d4826f8868ead61899"
checksum = "b0f7e269b48f0a7dd0146680fa24b50cc67fc0373f086a5b2f99bd084639b482"

[[package]]
name = "thiserror"
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ rustc_macros = { path = "../rustc_macros" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.15"
thin-vec = "0.2.18"
tracing = "0.1"
# tidy-alphabetical-end
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.15"
thin-vec = "0.2.18"
tracing = "0.1"
# tidy-alphabetical-end
2 changes: 1 addition & 1 deletion compiler/rustc_ast_passes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ rustc_macros = { path = "../rustc_macros" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
thin-vec = "0.2.15"
thin-vec = "0.2.18"
# tidy-alphabetical-end
2 changes: 1 addition & 1 deletion compiler/rustc_ast_pretty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ rustc_span = { path = "../rustc_span" }

[dev-dependencies]
# tidy-alphabetical-start
thin-vec = "0.2.15"
thin-vec = "0.2.18"
# tidy-alphabetical-end
2 changes: 1 addition & 1 deletion compiler/rustc_attr_parsing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ rustc_parse_format = { path = "../rustc_parse_format" }
rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
thin-vec = "0.2.15"
thin-vec = "0.2.18"
# tidy-alphabetical-end
42 changes: 20 additions & 22 deletions compiler/rustc_borrowck/src/region_infer/values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc_middle::bug;
use rustc_middle::mir::{BasicBlock, Location};
use rustc_middle::ty::{self, RegionVid};
use rustc_mir_dataflow::points::{DenseLocationMap, PointIndex};
use tracing::debug;
use tracing::{debug, instrument};

use crate::BorrowIndex;
use crate::polonius::LiveLoans;
Expand Down Expand Up @@ -116,37 +116,43 @@ impl LivenessValues {
/// Records `region` as being live at the given `location`.
pub(crate) fn add_location(&mut self, region: RegionVid, location: Location) {
let point = self.location_map.point_from_location(location);
// This is a debug assert despite being cheap because it drops
// the current `point_in_range()` uses to 0 when debugging is off.
debug_assert!(
self.location_map.point_in_range(point),
"Tried inserting region {region:?} whose location {location:?} does not belong to this body!"
);
debug!("LivenessValues::add_location(region={:?}, location={:?})", region, location);
match &mut self.live_regions {
LiveRegions::AtPoints(points) => {
points.insert(region, point);
}

LiveRegions::InBody(live_regions) if self.location_map.point_in_range(point) => {
LiveRegions::InBody(live_regions) => {
live_regions.insert(region);
}

LiveRegions::InBody(_) => (),
};
}

/// Records `region` as being live at all the given `points`.
pub(crate) fn add_points(&mut self, region: RegionVid, points: &IntervalSet<PointIndex>) {
debug_assert!(
points.iter().all(|point| self.location_map.point_in_range(point)),
"Tried inserting region {region:?} with some points not belonging to this body!"
);
debug!("LivenessValues::add_points(region={:?}, points={:?})", region, points);
match &mut self.live_regions {
LiveRegions::AtPoints(these_points) => {
these_points.union_row(region, points);
}
LiveRegions::InBody(live_regions)
if points.iter().any(|point| self.location_map.point_in_range(point)) =>
{
LiveRegions::InBody(live_regions) => {
live_regions.insert(region);
}
LiveRegions::InBody(_) => (),
};
}

/// Records `region` as being live at all the control-flow points.
#[instrument(skip(self))]
pub(crate) fn add_all_points(&mut self, region: RegionVid) {
match &mut self.live_regions {
LiveRegions::AtPoints(points) => points.insert_all_into_row(region),
Expand All @@ -172,10 +178,7 @@ impl LivenessValues {

/// Returns an iterator of all the points where `region` is live.
fn live_points(&self, region: RegionVid) -> impl Iterator<Item = PointIndex> {
self.point_liveness(region)
.into_iter()
.flat_map(|set| set.iter())
.take_while(|&p| self.location_map.point_in_range(p))
self.point_liveness(region).into_iter().flat_map(|set| set.iter())
}

/// For debugging purposes, returns a pretty-printed string of the points where the `region` is
Expand Down Expand Up @@ -343,11 +346,10 @@ impl<'tcx, N: Idx> RegionValues<'tcx, N> {

/// Returns the locations contained within a given region `r`.
pub(crate) fn locations_outlived_by(&self, r: N) -> impl Iterator<Item = Location> {
self.points.row(r).into_iter().flat_map(move |set| {
set.iter()
.take_while(move |&p| self.location_map.point_in_range(p))
.map(move |p| self.location_map.to_location(p))
})
self.points
.row(r)
.into_iter()
.flat_map(move |set| set.iter().map(move |p| self.location_map.to_location(p)))
}

/// Returns just the universal regions that are contained in a given region's value.
Expand Down Expand Up @@ -413,11 +415,7 @@ pub(crate) fn pretty_print_points(
points: impl IntoIterator<Item = PointIndex>,
) -> String {
pretty_print_region_elements(
points
.into_iter()
.take_while(|&p| location_map.point_in_range(p))
.map(|p| location_map.to_location(p))
.map(RegionElement::Location),
points.into_iter().map(|p| location_map.to_location(p)).map(RegionElement::Location),
)
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.15"
thin-vec = "0.2.18"
tracing = "0.1"
# tidy-alphabetical-end

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ smallvec = { version = "1.8.1", features = [
] }
stacker = "0.1.17"
tempfile = "3.2"
thin-vec = "0.2.15"
thin-vec = "0.2.18"
tracing = "0.1"
# tidy-alphabetical-end

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_expand/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" }
scoped-tls = "1.0"
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.15"
thin-vec = "0.2.18"
tracing = "0.1"
# tidy-alphabetical-end
2 changes: 1 addition & 1 deletion compiler/rustc_hir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ rustc_serialize = { path = "../rustc_serialize" }
rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.15"
thin-vec = "0.2.18"
tracing = "0.1"
# tidy-alphabetical-end
17 changes: 9 additions & 8 deletions compiler/rustc_hir_typeck/src/expr_use_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,8 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
let typeck_results = self.cx.typeck_results();
let adjustments = typeck_results.expr_adjustments(expr);
let mut place_with_id = self.cat_expr_unadjusted(expr)?;
for adjustment in adjustments {
for (adjustment_index, adjustment) in adjustments.iter().enumerate() {
let is_last_adjustment = adjustment_index + 1 == adjustments.len();
debug!("walk_adjustment expr={:?} adj={:?}", expr, adjustment);
match adjustment.kind {
adjustment::Adjust::NeverToAny | adjustment::Adjust::Pointer(_) => {
Expand All @@ -752,13 +753,13 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
self.walk_autoref(expr, &place_with_id, autoref);
}

adjustment::Adjust::GenericReborrow(_reborrow) => {
// To build an expression as a place expression, it needs to be a field
// projection or deref at the outmost layer. So it is field projection or deref
// on an adjusted value. But this means that adjustment is applied on a
// subexpression that is not the final operand/rvalue for function call or
// assignment. This is a contradiction.
unreachable!("Reborrow trait usage during adjustment walk");
adjustment::Adjust::GenericReborrow(mutability) if is_last_adjustment => {
let bk = ty::BorrowKind::from_mutbl(mutability);
self.delegate.borrow_mut().borrow(&place_with_id, place_with_id.hir_id, bk);
}

adjustment::Adjust::GenericReborrow(_) => {
span_bug!(expr.span, "generic reborrow adjustment must be terminal");
}
}
place_with_id = self.cat_expr_adjusted(expr, place_with_id, adjustment)?;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ rustc_middle = { path = "../rustc_middle" }
rustc_span = { path = "../rustc_span" }
rustc_type_ir = { path = "../rustc_type_ir" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.15"
thin-vec = "0.2.18"
tracing = "0.1"
# tidy-alphabetical-end
8 changes: 7 additions & 1 deletion compiler/rustc_metadata/src/rmeta/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1274,6 +1274,10 @@ impl CrateMetadata {
/// including both proper items and reexports.
/// Module here is understood in name resolution sense - it can be a `mod` item,
/// or a crate root, or an enum, or a trait.
///
/// # Panics
///
/// May panic if the provided `id` does not refer to a module.
fn get_module_children(&self, tcx: TyCtxt<'_>, id: DefIndex) -> impl Iterator<Item = ModChild> {
gen move {
if let Some(data) = &self.root.proc_macro_data {
Expand All @@ -1287,7 +1291,9 @@ impl CrateMetadata {
} else {
// Iterate over all children.
let non_reexports = self.root.tables.module_children_non_reexports.get(self, id);
for child_index in non_reexports.unwrap().decode((self, tcx)) {
let non_reexports =
non_reexports.expect("provided `DefIndex` must refer to a module-like item");
for child_index in non_reexports.decode((self, tcx)) {
yield self.get_mod_child(tcx, child_index);
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ rustc_target = { path = "../rustc_target" }
rustc_thread_pool = { path = "../rustc_thread_pool" }
rustc_type_ir = { path = "../rustc_type_ir" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
thin-vec = "0.2.15"
thin-vec = "0.2.18"
tracing = "0.1"
# tidy-alphabetical-end

Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_middle/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2161,6 +2161,15 @@ rustc_queries! {
desc { "fetching what a crate is named" }
separate_provide_extern
}

/// Iterates over all named children of the given module,
/// including both proper items and reexports.
/// Module here is understood in name resolution sense - it can be a `mod` item,
/// or a crate root, or an enum, or a trait.
///
/// # Panics
///
/// May panic if the provided `id` does not refer to a module.
query module_children(def_id: DefId) -> &'tcx [ModChild] {
desc { "collecting child items of module `{}`", tcx.def_path_str(def_id) }
separate_provide_extern
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_middle/src/thir/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ pub fn walk_expr<'thir, 'tcx: 'thir, V: Visitor<'thir, 'tcx>>(
}
ThreadLocalRef(_) => {}
Yield { value } => visitor.visit_expr(&visitor.thir()[value]),
Reborrow { .. } => {}
Reborrow { source, mutability: _, target: _ } => {
visitor.visit_expr(&visitor.thir()[source])
}
}
}

Expand Down
7 changes: 6 additions & 1 deletion compiler/rustc_mir_dataflow/src/points.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ impl DenseLocationMap {
for (bb, bb_data) in body.basic_blocks.iter_enumerated() {
basic_blocks.extend((0..=bb_data.statements.len()).map(|_| bb));
}

// Invariant: no block is preceded by more than all statements.
debug_assert!(*statements_before_block.iter().max().unwrap() < num_points);
Self { statements_before_block, basic_blocks, num_points }
}

Expand All @@ -42,10 +43,14 @@ impl DenseLocationMap {
}

/// Converts a `Location` into a `PointIndex`. O(1).
/// [[`Self::point_in_range()`]] guaranteed for the returned index.
#[inline]
pub fn point_from_location(&self, location: Location) -> PointIndex {
let Location { block, statement_index } = location;
let start_index = self.statements_before_block[block];
// Note the invariant in [`Self::new()`]; if the indexing
// operation above did not panic then this holds by construction.
debug_assert!(start_index < self.num_points);
PointIndex::new(start_index + statement_index)
}

Expand Down
Loading
Loading