Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
9d4130b
Use `rustc-josh-sync` merge commit message for pull PR description
Kobzol Sep 23, 2025
ae45de9
Merge pull request #4602 from rust-lang/ci-msg
RalfJung Sep 23, 2025
1ec0988
Expand GenMC mode:
Patrick-6 Sep 7, 2025
64bfe7c
genmc doc edits
RalfJung Sep 24, 2025
0c73cb8
Merge pull request #4591 from Patrick-6/miri-genmc-assume
RalfJung Sep 24, 2025
7dfc6b2
Prepare for merging from rust-lang/rust
Sep 26, 2025
4aacd30
Merge ref 'b733736ea2fe' from rust-lang/rust
Sep 26, 2025
7095a86
Merge pull request #4604 from rust-lang/rustup-2025-09-26
oli-obk Sep 26, 2025
aa6332e
silence unused import error
RalfJung Sep 27, 2025
5011630
Merge pull request #4605 from RalfJung/used
RalfJung Sep 27, 2025
9e984cd
alloc_addresses: track more explicitly whether we are in charge of ge…
RalfJung Sep 27, 2025
93114f7
Merge pull request #4606 from RalfJung/alloc_addrs
RalfJung Sep 27, 2025
5debc43
Prepare for merging from rust-lang/rust
Sep 28, 2025
9762c43
Merge ref '848e6746fe03' from rust-lang/rust
Sep 28, 2025
264162e
Merge pull request #4607 from rust-lang/rustup-2025-09-28
oli-obk Sep 28, 2025
2d038a0
Prepare for merging from rust-lang/rust
Sep 29, 2025
14d02ab
Merge ref 'f957826bff7a' from rust-lang/rust
Sep 29, 2025
6347eaf
Merge pull request #4608 from rust-lang/rustup-2025-09-29
RalfJung Sep 29, 2025
8b38760
Implement Pointer conversions to and from GenMC. Limitation: Borrow t…
Patrick-6 Mar 14, 2025
739d858
Merge pull request #4603 from Patrick-6/miri-genmc-provenance
RalfJung Sep 29, 2025
cfefa9b
genmc: bail out for non-64bit-little-endian targets
RalfJung Sep 29, 2025
bbe778e
Merge pull request #4609 from RalfJung/genmc-targets
RalfJung Sep 29, 2025
8b51a63
Prepare for merging from rust-lang/rust
Sep 30, 2025
73562f0
Merge ref '29b7717de23f' from rust-lang/rust
Sep 30, 2025
fb75fbb
Merge pull request #4610 from rust-lang/rustup-2025-09-30
oli-obk Sep 30, 2025
574ff89
Implement support for temporal mixing of atomic/non-atomic accesses i…
Patrick-6 Mar 14, 2025
1c16821
Merge pull request #4611 from Patrick-6/miri-genmc-temporal-mixing
RalfJung Oct 1, 2025
38d129e
rustup
RalfJung Oct 2, 2025
a5d1629
make cur_span and current_span harder to mix up
RalfJung Oct 2, 2025
d3bb22f
Merge pull request #4613 from RalfJung/rustup
RalfJung Oct 2, 2025
8583e15
Prepare for merging from rust-lang/rust
Oct 3, 2025
6beb612
Merge ref '3b8665c5ab3a' from rust-lang/rust
Oct 3, 2025
179da5d
Merge pull request #4615 from rust-lang/rustup-2025-10-03
oli-obk Oct 3, 2025
19331da
Add test sugg-swap-equality-in-macro
xizheyin Aug 7, 2025
94d6601
Suppress suggest swapping the equality in extern macro
xizheyin Aug 7, 2025
f28b8d4
deduplicate warnings globally
RalfJung Oct 5, 2025
de97b43
Merge pull request #4617 from RalfJung/warn-dedup
RalfJung Oct 5, 2025
4203fe8
Implement std::sync::Mutex interception in GenMC mode.
Patrick-6 Sep 12, 2025
91a9b1f
Merge pull request #4614 from Patrick-6/miri-genmc-mutex
RalfJung Oct 7, 2025
27afeb0
feat: add support for libc::memset
vishruth-thimmaiah Oct 7, 2025
5446a0a
Prepare for merging from rust-lang/rust
Oct 8, 2025
f59d761
Merge ref '4fd31815524b' from rust-lang/rust
Oct 8, 2025
14212c5
Merge pull request #4619 from rust-lang/rustup-2025-10-08
RalfJung Oct 8, 2025
8066cbc
readme: document how to directly invoke the driver
RalfJung Oct 8, 2025
444eb4c
assert that non-extended temporaries have scopes
dianne Oct 8, 2025
513c9b7
Add debugging instrumentation.
cjgillot Oct 9, 2025
1ad657e
Simplify TransformVisitor.
cjgillot Oct 9, 2025
6d800ae
Renumber locals after state transform.
cjgillot Oct 9, 2025
afea346
feat: add failing test for zero-sized memset
vishruth-thimmaiah Oct 10, 2025
328fec4
Merge pull request #4618 from vishruth-thimmaiah/add_memset
RalfJung Oct 10, 2025
f3c08df
Merge pull request #4620 from RalfJung/miri-driver
RalfJung Oct 10, 2025
61594ca
remove a bunch of unnecessary 'pub' from tests
RalfJung Oct 12, 2025
46c5f0c
Merge pull request #4623 from RalfJung/nopub
RalfJung Oct 12, 2025
1e382a1
move EnvFilter into its own layer
dingxiangfei2009 Oct 12, 2025
09ef5eb
reduce calls to attr.span() in old doc attr parsing
jdonszelmann Oct 12, 2025
18a468e
native-lib args: also reject wide pointers
RalfJung Oct 13, 2025
77208bc
Merge pull request #4626 from RalfJung/native-call-args
RalfJung Oct 13, 2025
1ef8863
Prepare for merging from rust-lang/rust
RalfJung Oct 13, 2025
6645d63
Merge ref '36e4f5d1fe1d' from rust-lang/rust
RalfJung Oct 13, 2025
aec62f8
fmt
RalfJung Oct 13, 2025
0c2e30b
avoid blanket allow(unused)
RalfJung Oct 13, 2025
15716a3
Merge pull request #4627 from RalfJung/rustup
RalfJung Oct 13, 2025
30bedc7
in opaque type handling lift region vars to static if they outlive pl…
BoxyUwU Oct 10, 2025
8521985
Rollup merge of #144266 - xizheyin:139050, r=nnethercote
matthiaskrgr Oct 13, 2025
2a10082
Rollup merge of #147471 - dianne:assert-temporary-scope, r=nnethercote
matthiaskrgr Oct 13, 2025
6dd08cb
Rollup merge of #147533 - cjgillot:coro-late-renumber, r=davidtwco
matthiaskrgr Oct 13, 2025
7d0a0a3
Rollup merge of #147566 - BoxyUwU:opaque_types_placeholder_outlives, …
matthiaskrgr Oct 13, 2025
806da59
Rollup merge of #147613 - dingxiangfei2009:investigate-log, r=jdonsze…
matthiaskrgr Oct 13, 2025
81dd408
Rollup merge of #147615 - jdonszelmann:span-calls-doc-attr, r=Jonatha…
matthiaskrgr Oct 13, 2025
8d2b142
Rollup merge of #147636 - RalfJung:miri, r=RalfJung
matthiaskrgr Oct 13, 2025
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
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/handle_placeholders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ pub(crate) fn compute_sccs_applying_placeholder_outlives_constraints<'tcx>(
}
}

fn rewrite_placeholder_outlives<'tcx>(
pub(crate) fn rewrite_placeholder_outlives<'tcx>(
sccs: &Sccs<RegionVid, ConstraintSccIndex>,
annotations: &SccAnnotations<'_, '_, RegionTracker>,
fr_static: RegionVid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub(super) fn apply_member_constraints<'tcx>(
debug!(?member_constraints);
for scc_a in rcx.constraint_sccs.all_sccs() {
debug!(?scc_a);
// Start by adding the region values required by outlives constraints. This
// Start by adding the region values required by outlives constraints. This
// matches how we compute the final region values in `fn compute_regions`.
//
// We need to do this here to get a lower bound when applying member constraints.
Expand All @@ -64,6 +64,7 @@ fn apply_member_constraint<'tcx>(
// If the member region lives in a higher universe, we currently choose
// the most conservative option by leaving it unchanged.
if !rcx.max_placeholder_universe_reached(member).is_root() {
debug!("member region reached non root universe, bailing");
return;
}

Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_borrowck/src/region_infer/opaque_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ fn collect_defining_uses<'tcx>(
}
} else {
errors.push(DeferredOpaqueTypeError::InvalidOpaqueTypeArgs(err));
debug!(
"collect_defining_uses: InvalidOpaqueTypeArgs for {:?} := {:?}",
non_nll_opaque_type_key, hidden_type
);
}
continue;
}
Expand All @@ -276,6 +280,7 @@ fn collect_defining_uses<'tcx>(
defining_uses
}

#[instrument(level = "debug", skip(rcx, hidden_types, defining_uses, errors))]
fn compute_definition_site_hidden_types_from_defining_uses<'tcx>(
rcx: &RegionCtxt<'_, 'tcx>,
hidden_types: &mut DefinitionSiteHiddenTypes<'tcx>,
Expand All @@ -287,13 +292,15 @@ fn compute_definition_site_hidden_types_from_defining_uses<'tcx>(
let mut decls_modulo_regions: FxIndexMap<OpaqueTypeKey<'tcx>, (OpaqueTypeKey<'tcx>, Span)> =
FxIndexMap::default();
for &DefiningUse { opaque_type_key, ref arg_regions, hidden_type } in defining_uses {
debug!(?opaque_type_key, ?arg_regions, ?hidden_type);
// After applying member constraints, we now map all regions in the hidden type
// to the `arg_regions` of this defining use. In case a region in the hidden type
// ended up not being equal to any such region, we error.
let hidden_type =
match hidden_type.try_fold_with(&mut ToArgRegionsFolder::new(rcx, arg_regions)) {
Ok(hidden_type) => hidden_type,
Err(r) => {
debug!("UnexpectedHiddenRegion: {:?}", r);
errors.push(DeferredOpaqueTypeError::UnexpectedHiddenRegion {
hidden_type,
opaque_type_key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ use crate::constraints::ConstraintSccIndex;
use crate::handle_placeholders::{SccAnnotations, region_definitions};
use crate::region_infer::reverse_sccs::ReverseSccGraph;
use crate::region_infer::values::RegionValues;
use crate::region_infer::{ConstraintSccs, RegionDefinition, RegionTracker, Representative};
use crate::region_infer::{
ConstraintSccs, OutlivesConstraintSet, RegionDefinition, RegionTracker, Representative,
};
use crate::type_check::MirTypeckRegionConstraints;
use crate::type_check::free_region_relations::UniversalRegionRelations;
use crate::universal_regions::UniversalRegions;
Expand Down Expand Up @@ -39,16 +41,36 @@ impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
location_map: Rc<DenseLocationMap>,
constraints: &MirTypeckRegionConstraints<'tcx>,
) -> RegionCtxt<'a, 'tcx> {
let mut outlives_constraints = constraints.outlives_constraints.clone();
let universal_regions = &universal_region_relations.universal_regions;
let (definitions, _has_placeholders) = region_definitions(infcx, universal_regions);

let compute_sccs =
|outlives_constraints: &OutlivesConstraintSet<'tcx>,
annotations: &mut SccAnnotations<'_, 'tcx, RegionTracker>| {
ConstraintSccs::new_with_annotation(
&outlives_constraints
.graph(definitions.len())
.region_graph(outlives_constraints, universal_regions.fr_static),
annotations,
)
};

let mut scc_annotations = SccAnnotations::init(&definitions);
let constraint_sccs = ConstraintSccs::new_with_annotation(
&constraints
.outlives_constraints
.graph(definitions.len())
.region_graph(&constraints.outlives_constraints, universal_regions.fr_static),
&mut scc_annotations,
let mut constraint_sccs = compute_sccs(&outlives_constraints, &mut scc_annotations);

let added_constraints = crate::handle_placeholders::rewrite_placeholder_outlives(
&constraint_sccs,
&scc_annotations,
universal_regions.fr_static,
&mut outlives_constraints,
);

if added_constraints {
scc_annotations = SccAnnotations::init(&definitions);
constraint_sccs = compute_sccs(&outlives_constraints, &mut scc_annotations);
}

let scc_annotations = scc_annotations.scc_to_annotation;

// Unlike the `RegionInferenceContext`, we only care about free regions
Expand Down
11 changes: 6 additions & 5 deletions compiler/rustc_hir_analysis/src/check/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,8 @@ fn resolve_local<'tcx>(
// Iterate up to the enclosing destruction scope to find the same scope that will also
// be used for the result of the block itself.
if let Some(inner_scope) = visitor.cx.var_parent {
(visitor.cx.var_parent, _) = visitor.scope_tree.default_temporary_scope(inner_scope)
visitor.cx.var_parent =
Some(visitor.scope_tree.default_temporary_scope(inner_scope).0)
}
// Don't lifetime-extend child `super let`s or block tail expressions' temporaries in
// the initializer when this `super let` is not itself extended by a parent `let`
Expand Down Expand Up @@ -752,10 +753,10 @@ impl<'tcx> Visitor<'tcx> for ScopeResolutionVisitor<'tcx> {
// The body of the every fn is a root scope.
resolve_expr(this, body.value, true);
} else {
// Only functions have an outer terminating (drop) scope, while
// temporaries in constant initializers may be 'static, but only
// according to rvalue lifetime semantics, using the same
// syntactical rules used for let initializers.
// All bodies have an outer temporary drop scope, but temporaries
// and `super let` bindings in constant initializers may be extended
// to have 'static lifetimes, using the same syntactical rules used
// for `let` initializers.
//
// e.g., in `let x = &f();`, the temporary holding the result from
// the `f()` call lives for the entirety of the surrounding block.
Expand Down
6 changes: 5 additions & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3636,7 +3636,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
.must_apply_modulo_regions()
{
let sm = self.tcx.sess.source_map();
if let Ok(rhs_snippet) = sm.span_to_snippet(rhs_expr.span)
// If the span of rhs_expr or lhs_expr is in an external macro,
// we just suppress the suggestion. See issue #139050
if !rhs_expr.span.in_external_macro(sm)
&& !lhs_expr.span.in_external_macro(sm)
&& let Ok(rhs_snippet) = sm.span_to_snippet(rhs_expr.span)
&& let Ok(lhs_snippet) = sm.span_to_snippet(lhs_expr.span)
{
err.note(format!("`{rhs_ty}` implements `PartialEq<{lhs_ty}>`"));
Expand Down
9 changes: 5 additions & 4 deletions compiler/rustc_log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ use std::io::{self, IsTerminal};

use tracing::dispatcher::SetGlobalDefaultError;
use tracing::{Event, Subscriber};
use tracing_subscriber::Registry;
use tracing_subscriber::filter::{Directive, EnvFilter, LevelFilter};
use tracing_subscriber::fmt::FmtContext;
use tracing_subscriber::fmt::format::{self, FormatEvent, FormatFields};
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::{Layer, Registry};

/// The values of all the environment variables that matter for configuring a logger.
/// Errors are explicitly preserved so that we can share error handling.
Expand Down Expand Up @@ -152,18 +152,19 @@ where
}
}

let subscriber = build_subscriber().with(layer.with_filter(filter));
let subscriber = build_subscriber();
// NOTE: It is important to make sure that the filter is applied on the last layer
match cfg.backtrace {
Ok(backtrace_target) => {
let fmt_layer = tracing_subscriber::fmt::layer()
.with_writer(io::stderr)
.without_time()
.event_format(BacktraceFormatter { backtrace_target });
let subscriber = subscriber.with(fmt_layer);
let subscriber = subscriber.with(layer).with(fmt_layer).with(filter);
tracing::subscriber::set_global_default(subscriber)?;
}
Err(_) => {
tracing::subscriber::set_global_default(subscriber)?;
tracing::subscriber::set_global_default(subscriber.with(layer).with(filter))?;
}
};

Expand Down
13 changes: 6 additions & 7 deletions compiler/rustc_middle/src/middle/region.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use rustc_macros::{HashStable, TyDecodable, TyEncodable};
use rustc_span::{DUMMY_SP, Span};
use tracing::debug;

use crate::ty::TyCtxt;
use crate::ty::{self, TyCtxt};

/// Represents a statically-describable scope that can be used to
/// bound the lifetime/region for values.
Expand Down Expand Up @@ -302,20 +302,20 @@ impl ScopeTree {

/// Returns the scope of non-lifetime-extended temporaries within a given scope, as well as
/// whether we've recorded a potential backwards-incompatible change to lint on.
/// Returns `None` when no enclosing temporary scope is found, such as for static items.
pub fn default_temporary_scope(&self, inner: Scope) -> (Option<Scope>, Option<Scope>) {
/// Panics if no enclosing temporary scope is found.
pub fn default_temporary_scope(&self, inner: Scope) -> (Scope, Option<Scope>) {
let mut id = inner;
let mut backwards_incompatible = None;

while let Some(&p) = self.parent_map.get(&id) {
match p.data {
ScopeData::Destruction => {
debug!("temporary_scope({inner:?}) = {id:?} [enclosing]");
return (Some(id), backwards_incompatible);
return (id, backwards_incompatible);
}
ScopeData::IfThenRescope | ScopeData::MatchGuard => {
debug!("temporary_scope({inner:?}) = {p:?} [enclosing]");
return (Some(p), backwards_incompatible);
return (p, backwards_incompatible);
}
ScopeData::Node
| ScopeData::CallSite
Expand All @@ -335,7 +335,6 @@ impl ScopeTree {
}
}

debug!("temporary_scope({inner:?}) = None");
(None, backwards_incompatible)
span_bug!(ty::tls::with(|tcx| inner.span(tcx, self)), "no enclosing temporary scope")
}
}
10 changes: 4 additions & 6 deletions compiler/rustc_middle/src/ty/rvalue_scopes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ impl RvalueScopes {
return (s, None);
}

// Otherwise, locate the innermost terminating scope
// if there's one. Static items, for instance, won't
// have an enclosing scope, hence no scope will be
// returned.
region_scope_tree
.default_temporary_scope(Scope { local_id: expr_id, data: ScopeData::Node })
// Otherwise, locate the innermost terminating scope.
let (scope, backward_incompatible) = region_scope_tree
.default_temporary_scope(Scope { local_id: expr_id, data: ScopeData::Node });
(Some(scope), backward_incompatible)
}

/// Make an association between a sub-expression and an extended lifetime
Expand Down
Loading
Loading