Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
f3afa22
fix nested dead code lint
dronavallipranav Aug 12, 2026
d1d3354
update docs to be more precise
Narfinger Aug 26, 2026
490ef1b
Remove has_default field of Target::GenericParam
mejrs Sep 11, 2026
bf68dfa
Flatten `Target::GenericParam`
mejrs Sep 11, 2026
69901a4
Tidy footnote in `platform-support.md`
beetrees Sep 11, 2026
2324b37
sparc: pass ZST arguments
folkertdev Aug 2, 2026
a44d3ad
sparc: pass and return `f128` indirectly and return aggregates indire…
folkertdev Aug 2, 2026
e8534c6
add sparc c-zst revision
folkertdev Aug 9, 2026
167c7bd
Add Natvis visualiser and debuginfo tests for `f128`
beetrees Aug 25, 2026
8c7d8ed
docs(num): add documentation for `NonZero::from_str`
sorairolake Sep 15, 2026
7e6b378
style(num): unhide imported items
sorairolake Sep 16, 2026
752e7c0
bootstrap: link Enzyme and the offload runtimes with the in-tree lld …
ZuseZ4 Sep 15, 2026
8730acb
Move more `rustdoc-html` tests in the right location
GuillaumeGomez Sep 17, 2026
cba3954
fix and clean up variance recording in liveness
lqd Sep 17, 2026
8a699c7
simplify `make_all_regions_live`
lqd Sep 17, 2026
942dcc9
add quick links
lqd Sep 17, 2026
ada6d89
more visual improvements
lqd Sep 17, 2026
7acb332
Add missing avx512vl intrinsics for f32->u32 conversions
Shnatsel Jul 26, 2026
1828711
Add manual exception for the intrinsics forgotten in the intel intrin…
Shnatsel Aug 23, 2026
f3f6cfd
Use the proper tracking issue
Shnatsel Aug 23, 2026
5cf706f
cargo fmt
Shnatsel Aug 23, 2026
2ccfcf8
Prepare for merging from rust-lang/rust
invalid-email-address Aug 24, 2026
964fc0a
loongarch: Add portable intrinsics::simd implementations for VAVG/VAV…
tangaac Jul 22, 2026
d580d01
Prepare for merging from rust-lang/rust
invalid-email-address Sep 7, 2026
20e2422
Run rustfmt
adamgemmell Sep 7, 2026
5761e97
Update vzipq arm instruction assertions
adamgemmell Sep 8, 2026
91a8a01
Revert "Use SIMD intrinsics for vector shifts"
RalfJung Sep 5, 2026
20a1f52
de-constify methods that depended on the vector shift ones
RalfJung Sep 5, 2026
beac67d
fmt
RalfJung Sep 5, 2026
599c44e
Run cargo fmt on JOSH syncs
adamgemmell Sep 8, 2026
d37122d
Fix "explicit `package.readme` can be inferred"
adamgemmell Sep 9, 2026
f74d2ed
Fix "`package.homepage` is redundant with `package.repository`"
adamgemmell Sep 9, 2026
43ba682
Fix "unused dependency"
adamgemmell Sep 9, 2026
7b339bc
improve x86 simd bitshift tests
folkertdev Sep 16, 2026
aa8beb9
miri: revert removing _mm{,256}_{sllv,srlv,srav}_epi{32,64}
RalfJung Sep 17, 2026
2605c8d
Use niche length type for strlen to guarantee isize::MAX bound
clarfonthey Sep 17, 2026
b5df62e
Update unicode_data to Unicode version 18.0.0
Kmeakin Sep 17, 2026
bc03591
Add mentions to sync back `RELEASES.md` to the `main` branch
Urgau Sep 3, 2026
71b0bc9
Rollup merge of #160401 - folkertdev:sparc-abi-fixes, r=beetrees
JonathanBrouwer Sep 18, 2026
f91d088
Rollup merge of #161777 - beetrees:f128-debuginfo, r=Walnut356
JonathanBrouwer Sep 18, 2026
15532f1
Rollup merge of #162740 - folkertdev:compiler-builtins-sync-2026-10-1…
JonathanBrouwer Sep 18, 2026
bc95e1e
Rollup merge of #162824 - ZuseZ4:use-lld-more, r=Kobzol
JonathanBrouwer Sep 18, 2026
1fa08ef
Rollup merge of #161005 - dronavallipranav:fix-nested-dead-code-expec…
JonathanBrouwer Sep 18, 2026
924cfa6
Rollup merge of #161803 - Narfinger:update-docs, r=clarfonthey
JonathanBrouwer Sep 18, 2026
0ed8d0a
Rollup merge of #162256 - Urgau:releases-md-sync-main, r=theemathas
JonathanBrouwer Sep 18, 2026
a3744d5
Rollup merge of #162661 - mejrs:genericparam, r=JonathanBrouwer
JonathanBrouwer Sep 18, 2026
ba19d35
Rollup merge of #162666 - beetrees:tidy-platform-support-footnotes, r…
JonathanBrouwer Sep 18, 2026
5dae34e
Rollup merge of #162803 - sorairolake:nonzero-from-str-docs, r=clarfo…
JonathanBrouwer Sep 18, 2026
41d2807
Rollup merge of #162906 - GuillaumeGomez:move-rustdoc-html-tests, r=U…
JonathanBrouwer Sep 18, 2026
e1346f7
Rollup merge of #162922 - lqd:assorted-delights, r=jackh726
JonathanBrouwer Sep 18, 2026
fa507c7
Rollup merge of #162929 - Kmeakin:km/unicode-18, r=clarfonthey
JonathanBrouwer Sep 18, 2026
332cb2a
Rollup merge of #162930 - clarfonthey:strlen-is-bounded, r=joshtriplett
JonathanBrouwer Sep 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
31 changes: 12 additions & 19 deletions compiler/rustc_attr_ir/src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ pub use rustc_ast::visit::AssocCtxt;
use rustc_ast::{AssocItemKind, ForeignItemKind, ast};
use rustc_macros::StableHash;

#[derive(Copy, Clone, PartialEq, Debug, Eq, StableHash)]
pub enum GenericParamKind {
Type,
Lifetime,
Const,
}

#[derive(Copy, Clone, PartialEq, Debug, Eq, StableHash)]
pub enum MethodKind {
/// Method in a `trait Trait` block
Expand Down Expand Up @@ -55,7 +48,9 @@ pub enum Target {
ForeignFn,
ForeignStatic,
ForeignTy,
GenericParam { kind: GenericParamKind, has_default: bool },
LifetimeParam,
TypeParam,
ConstParam,
MacroDef,
Param,
PatField,
Expand Down Expand Up @@ -106,7 +101,9 @@ impl Target {
| Target::ForeignFn
| Target::ForeignStatic
| Target::ForeignTy
| Target::GenericParam { .. }
| Target::TypeParam
| Target::LifetimeParam
| Target::ConstParam
| Target::MacroDef
| Target::Param
| Target::PatField
Expand Down Expand Up @@ -222,11 +219,9 @@ impl Target {
Target::ForeignFn => "foreign function",
Target::ForeignStatic => "foreign static item",
Target::ForeignTy => "foreign type",
Target::GenericParam { kind, .. } => match kind {
GenericParamKind::Type => "type parameter",
GenericParamKind::Lifetime => "lifetime parameter",
GenericParamKind::Const => "const parameter",
},
Target::TypeParam => "type parameter",
Target::LifetimeParam => "lifetime parameter",
Target::ConstParam => "const parameter",
Target::MacroDef => "macro def",
Target::Param => "function param",
Target::PatField => "pattern field",
Expand Down Expand Up @@ -277,11 +272,9 @@ impl Target {
Target::ForeignFn => "foreign functions",
Target::ForeignStatic => "foreign statics",
Target::ForeignTy => "foreign types",
Target::GenericParam { kind, has_default: _ } => match kind {
GenericParamKind::Type => "type parameters",
GenericParamKind::Lifetime => "lifetime parameters",
GenericParamKind::Const => "const parameters",
},
Target::TypeParam => "type parameters",
Target::LifetimeParam => "lifetime parameters",
Target::ConstParam => "const parameters",
Target::MacroDef => "macro defs",
Target::Param => "function params",
Target::PatField => "pattern fields",
Expand Down
7 changes: 2 additions & 5 deletions compiler/rustc_attr_parsing/src/attributes/rustc_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::path::PathBuf;

use rustc_ast::{LitIntType, LitKind, MetaItemLit};
use rustc_attr_ir::lang_items::LangItem;
use rustc_attr_ir::target::GenericParamKind;
use rustc_attr_ir::{
BorrowckGraphvizFormatKind, CguFields, CguKind, RustcCleanAttribute, RustcCleanQueries,
RustcMirKind,
Expand Down Expand Up @@ -109,10 +108,8 @@ pub(crate) struct RustcPanicsWhenZeroParser;

impl NoArgsAttributeParser for RustcPanicsWhenZeroParser {
const PATH: &[Symbol] = &[sym::rustc_panics_when_zero];
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[
Allow(Target::GenericParam { kind: GenericParamKind::Const, has_default: true }),
Allow(Target::GenericParam { kind: GenericParamKind::Const, has_default: false }),
]);
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowList(&[Allow(Target::ConstParam)]);
const STABILITY: AttributeStability = unstable!(rustc_attrs);

const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcPanicsWhenZero;
Expand Down
9 changes: 2 additions & 7 deletions compiler/rustc_attr_parsing/src/attributes/semantics.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
use rustc_attr_ir::target::GenericParamKind;
use rustc_feature::AttributeStability;

use super::prelude::*;

pub(crate) struct MayDangleParser;
impl NoArgsAttributeParser for MayDangleParser {
const PATH: &[Symbol] = &[sym::may_dangle];
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[
Allow(Target::GenericParam { kind: GenericParamKind::Type, has_default: false }),
Allow(Target::GenericParam { kind: GenericParamKind::Type, has_default: true }),
Allow(Target::GenericParam { kind: GenericParamKind::Lifetime, has_default: false }),
Allow(Target::GenericParam { kind: GenericParamKind::Lifetime, has_default: true }),
]);
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowList(&[Allow(Target::TypeParam), Allow(Target::LifetimeParam)]);
const STABILITY: AttributeStability = unstable!(dropck_eyepatch);
const CREATE: fn(span: Span) -> AttributeKind = AttributeKind::MayDangle;
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_attr_parsing/src/attributes/stability.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::num::NonZero;

use rustc_attr_ir::target::{AssocCtxt, GenericParamKind, MethodKind, Target};
use rustc_attr_ir::target::{AssocCtxt, MethodKind, Target};
use rustc_attr_ir::{
DefaultBodyStability, PartialConstStability, Stability, StabilityLevel, StableSince,
UnstableReason, UnstableRemovedFeature, VERSION_PLACEHOLDER,
Expand Down Expand Up @@ -40,7 +40,7 @@ const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[
Allow(Target::TyAlias),
Allow(Target::Variant),
Allow(Target::Field),
Allow(Target::GenericParam { kind: GenericParamKind::Type, has_default: true }),
Allow(Target::TypeParam),
Allow(Target::Static),
Allow(Target::ForeignFn),
Allow(Target::ForeignStatic),
Expand Down
27 changes: 3 additions & 24 deletions compiler/rustc_attr_parsing/src/target_checking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,30 +532,9 @@ pub(crate) const ALL_TARGETS: &[Policy] = {
Allow(Target::Crate),
Allow(Target::Delegation { mac: false }),
Allow(Target::Delegation { mac: true }),
Allow(Target::GenericParam {
kind: rustc_attr_ir::target::GenericParamKind::Const,
has_default: false,
}),
Allow(Target::GenericParam {
kind: rustc_attr_ir::target::GenericParamKind::Const,
has_default: true,
}),
Allow(Target::GenericParam {
kind: rustc_attr_ir::target::GenericParamKind::Lifetime,
has_default: false,
}),
Allow(Target::GenericParam {
kind: rustc_attr_ir::target::GenericParamKind::Lifetime,
has_default: true,
}),
Allow(Target::GenericParam {
kind: rustc_attr_ir::target::GenericParamKind::Type,
has_default: false,
}),
Allow(Target::GenericParam {
kind: rustc_attr_ir::target::GenericParamKind::Type,
has_default: true,
}),
Allow(Target::ConstParam),
Allow(Target::LifetimeParam),
Allow(Target::TypeParam),
Allow(Target::Loop),
Allow(Target::ForLoop),
Allow(Target::While),
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_borrowck/src/polonius/dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,13 +543,15 @@ fn emit_loan_reachability(
// It's useful to know whether the region we're reaching is live at this point.
let node_liveness =
if liveness.is_live_at(node.region, location) { "live" } else { "not live" };
writeln!(out, "<span class='trace-suffix'>")?;
writeln!(
out,
"/ at <code>{:?}</code>: <code>'{}</code> is {}",
location,
node.region.index(),
node_liveness,
)?;
writeln!(out, "</span>")?;
writeln!(out, "</li>")?;
}
writeln!(out, "</ul>")?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<head>
<title>Polonius MIR dump</title>
<style>
.hidden {
display: none;
pre {
margin-top: 0;
white-space: pre-wrap;
}

.section + .section {
Expand All @@ -13,8 +14,8 @@
padding-top: 10px;
}

.traces .section-header {
margin-bottom: 10px;
.section-header {
margin-bottom: 6px;
}

.trace + .trace {
Expand All @@ -25,43 +26,63 @@
margin: 5px 0px;
padding-left: 15px;
}

.trace-suffix {
opacity: 0.8;
margin-left: 10px;
}

.hidden {
display: none;
}
</style>
</head>

<body>

<!-- The NLL + Polonius MIR -->
<!-- Links to the other sections -->
<div class="section">
<div class="section-header">Quick links</div>
<a href="#mir">Polonius MIR</a>
<a href="#polonius-region-graph">Polonius constraint graph</a>
<a href="#loan-traces">Loan traces</a>
<a href="#cfg-graph">Control-flow graph</a>
<a href="#nll-region-graph">NLL region graph</a>
<a href="#nll-scc-graph">NLL SCC graph</a>
</div>

<!-- The NLL + Polonius MIR -->
<div class="section" id="mir">
<div class="section-header">Raw MIR dump</div>
<pre><code>$SECTION_MIR</code></pre>
</div>

<!-- Mermaid visualization of the polonius constraint graph -->
<div class="section">
<div class="section" id="polonius-region-graph">
<div class="section-header">Polonius constraint graph</div>
<pre class='mermaid'>$SECTION_POLONIUS_CONSTRAINTS</pre>
</div>

<!-- The reachability of loans while traversing the polonius constraint graph -->
<div class="section traces">
<div class="section traces" id="loan-traces">
<div class="section-header">Loan Traces</div>
$SECTION_POLONIUS_REACHABILITY
</div>

<!-- Mermaid visualization of the CFG -->
<div class="section">
<div class="section" id="cfg-graph">
<div class="section-header">Control-flow graph</div>
<pre class='mermaid'>$SECTION_CFG</pre>
</div>

<!-- Mermaid visualization of the NLL region graph -->
<div class="section">
<div class="section" id="nll-region-graph">
<div class="section-header">NLL regions</div>
<pre class='mermaid'>$SECTION_NLL_CONSTRAINTS</pre>
</div>

<!-- Mermaid visualization of the NLL SCC graph -->
<div class="section">
<div class="section" id="nll-scc-graph">
<div class="section-header">NLL SCCs</div>
<pre class='mermaid'>$SECTION_NLL_SCCS</pre>
</div>
Expand Down
38 changes: 20 additions & 18 deletions compiler/rustc_borrowck/src/type_check/liveness/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc_infer::infer::canonical::QueryRegionConstraints;
use rustc_infer::traits::TraitErrors;
use rustc_middle::mir::{BasicBlock, Body, ConstraintCategory, Local, Location};
use rustc_middle::traits::query::DropckOutlivesResult;
use rustc_middle::ty::{GenericArg, Ty, TypeVisitable, TypeVisitableExt};
use rustc_middle::ty::{Ty, TyCtxt, TypeVisitable, TypeVisitableExt};
use rustc_mir_dataflow::impls::MaybeInitializedPlaces;
use rustc_mir_dataflow::move_paths::{HasMoveData, MoveData, MovePathIndex};
use rustc_mir_dataflow::points::{DenseLocationMap, PointIndex};
Expand Down Expand Up @@ -553,8 +553,17 @@ impl<'tcx> LivenessContext<'_, '_, 'tcx> {
/// points `live_at`.
fn add_use_live_facts_for(&mut self, value: Ty<'tcx>, live_at: &IntervalSet<PointIndex>) {
debug!("add_use_live_facts_for(value={:?})", value);
Self::record_region_variance(self.typeck, value.into());
Self::make_all_regions_live(self.location_map, self.typeck, value.into(), live_at);
Self::make_all_regions_live(self.location_map, self.typeck, value, live_at);

// When using `-Zpolonius=next`, we also record the variance of regions in this live type.
if let Some(polonius_context) = self.typeck.polonius_context.as_mut() {
record_live_region_variance(
self.typeck.infcx.tcx,
&mut polonius_context.live_region_variances,
self.typeck.universal_regions,
value,
);
}
}

/// Some variable with type `live_ty` is "drop live" at `location`
Expand Down Expand Up @@ -595,9 +604,6 @@ impl<'tcx> LivenessContext<'_, '_, 'tcx> {
}
}

// Since the entire dropped local is live, record the variance of its regions.
Self::record_region_variance(self.typeck, dropped_ty.into());

// All things in the `outlives` array may be touched by
// the destructor and must be live at this point.
for &kind in &drop_data.dropck_result.kinds {
Expand All @@ -610,27 +616,24 @@ impl<'tcx> LivenessContext<'_, '_, 'tcx> {
self.typeck.polonius_facts,
);
}
}

/// `live_kind` is the type of a (use- or drop-) live local.
/// Record the variance of any region(s) appearing in it for Polonius. Does
/// nothing if Polonius is not active.
fn record_region_variance(typeck: &mut TypeChecker<'_, 'tcx>, live_kind: GenericArg<'tcx>) {
// When using `-Zpolonius=next`, we record the variance of each live region.
if let Some(polonius_context) = typeck.polonius_context.as_mut() {
// For polonius: since the local is drop live, record the variance of the regions in its
// type, not the ones in the type's live components seen in the dropck results above. See
// issue #160670.
if let Some(polonius_context) = self.typeck.polonius_context.as_mut() {
record_live_region_variance(
typeck.infcx.tcx,
self.typeck.infcx.tcx,
&mut polonius_context.live_region_variances,
typeck.universal_regions,
live_kind,
self.typeck.universal_regions,
dropped_ty,
);
}
}

fn make_all_regions_live(
location_map: &DenseLocationMap,
typeck: &mut TypeChecker<'_, 'tcx>,
value: GenericArg<'tcx>,
value: impl TypeVisitable<TyCtxt<'tcx>>,
live_at: &IntervalSet<PointIndex>,
) {
debug!("make_all_regions_live(value={:?})", value);
Expand All @@ -647,7 +650,6 @@ impl<'tcx> LivenessContext<'_, '_, 'tcx> {
typeck.constraints.liveness_constraints.add_points(live_region_vid, live_at);
},
});
Self::record_region_variance(typeck, value);
}
}

Expand Down
Loading
Loading