Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
03265b4
Update CURRENT_RUSTC_VERSION post-bump
Mark-Simulacrum Sep 14, 2025
9c650ea
Set channel to beta
Mark-Simulacrum Sep 14, 2025
8499d50
Only run Cranelift dist test on nightly
Kobzol Sep 15, 2025
1bffa23
Auto merge of #146545 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
bors Sep 15, 2025
6347e7f
Revert "compiler: Add Windows resources to rustc-main and rustc_driver"
lambdageek Sep 17, 2025
b34cfaf
Auto merge of #146687 - lambdageek:revert-rc-for-beta, r=jieyouxu
bors Sep 19, 2025
af93ed5
Bump to released stable compiler on beta branch
Mark-Simulacrum Sep 20, 2025
bb624dc
Auto merge of #146815 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
bors Sep 20, 2025
186d91d
Revert "Auto merge of #144086 - clubby789:alloc-zeroed, r=nikic"
nikic Sep 25, 2025
f1fbf1f
add positive and negative tests for temporary scope shortening FCW
dianne Sep 20, 2025
aa7859c
Auto merge of #147030 - nikic:revert-alloc-zeroed, r=wesleywiser
bors Sep 27, 2025
b664386
yeet fastpath
lcnr Sep 23, 2025
dad01bc
remove test for no_core
lcnr Sep 23, 2025
34182f6
add test
lcnr Sep 24, 2025
6271db5
Fix infinite recursion in Path::eq with String
el-ev Sep 24, 2025
61380c4
Update cargo submodule from branch `rust-1.91.0`
cuviper Oct 5, 2025
d427837
Add failing regression test for #[link="dl"]
JonathanBrouwer Oct 2, 2025
0d2b92c
Make `#[link="dl"]` a warning rather than an error
JonathanBrouwer Oct 2, 2025
21cd82a
Auto merge of #147284 - cuviper:beta-next, r=cuviper
bors Oct 8, 2025
91163a9
Don't normalize higher-ranked assumptions if they're not used
compiler-errors Oct 3, 2025
15843ff
Fix target list of `link_section`
JonathanBrouwer Oct 6, 2025
555abc1
Add regression test for `link_section` targets
JonathanBrouwer Oct 7, 2025
3222bef
bootstrap: add `Builder::rustc_cmd` that includes the lib path
cuviper Oct 6, 2025
73481bf
[beta-1.91] Update cargo submodule
weihanglo Oct 10, 2025
3f2437c
Update LLVM to 21.1.2
dianqk Sep 23, 2025
5bef436
Remove the temporary directory when a check ends
dianqk Oct 10, 2025
cbf84ed
Auto merge of #147571 - cuviper:beta-next, r=cuviper
bors Oct 11, 2025
d69b1bb
Auto merge of #147569 - weihanglo:update-beta-cargo, r=weihanglo
bors Oct 14, 2025
6c2246d
warn on future errors from temporary lifetimes shortening in Rust 1.92
dianne Sep 20, 2025
9f7ad5e
add a test for shortening `super let` binding lifetimes
dianne Sep 29, 2025
164620f
warn on shortening `super let` binding lifetimes
dianne Sep 29, 2025
df8b2e4
Auto merge of #147056 - dianne:fcw-super-let-init-borrow-shortening, …
bors Oct 15, 2025
6b4f96d
Change int-to-ptr transmute lowering back to inttoptr
saethlin Oct 9, 2025
00c0648
in opaque type handling lift region vars to static if they outlive pl…
BoxyUwU Oct 10, 2025
5b36a0a
Add miscompiled test cases
dianqk Oct 12, 2025
408e09e
GVN: Invalidate derefs at loop headers
dianqk Oct 12, 2025
1f25197
Auto merge of #147791 - cuviper:beta-next, r=cuviper
bors Oct 17, 2025
a2df84a
fix(len_zero): don't eagerly call `GenericArgs::type_at` (#15660)
y21 Sep 11, 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
9 changes: 0 additions & 9 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3275,7 +3275,6 @@ dependencies = [
"rustc_driver_impl",
"rustc_public",
"rustc_public_bridge",
"rustc_windows_rc",
"tikv-jemalloc-sys",
]

Expand Down Expand Up @@ -3651,7 +3650,6 @@ name = "rustc_driver"
version = "0.0.0"
dependencies = [
"rustc_driver_impl",
"rustc_windows_rc",
]

[[package]]
Expand Down Expand Up @@ -4748,13 +4746,6 @@ dependencies = [
"semver",
]

[[package]]
name = "rustc_windows_rc"
version = "0.0.0"
dependencies = [
"cc",
]

[[package]]
name = "rustdoc"
version = "0.0.0"
Expand Down
5 changes: 0 additions & 5 deletions compiler/rustc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,3 @@ llvm = ['rustc_driver_impl/llvm']
max_level_info = ['rustc_driver_impl/max_level_info']
rustc_randomized_layouts = ['rustc_driver_impl/rustc_randomized_layouts']
# tidy-alphabetical-end

[build-dependencies]
# tidy-alphabetical-start
rustc_windows_rc = { path = "../rustc_windows_rc" }
# tidy-alphabetical-end
16 changes: 1 addition & 15 deletions compiler/rustc/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use std::{env, path};

use rustc_windows_rc::{VersionInfoFileType, compile_windows_resource_file};
use std::env;

fn main() {
let target_os = env::var("CARGO_CFG_TARGET_OS");
Expand All @@ -15,18 +13,6 @@ fn main() {

// Add a manifest file to rustc.exe.
fn set_windows_exe_options() {
set_windows_resource();
set_windows_manifest();
}

fn set_windows_resource() {
let stem = path::PathBuf::from("rustc_main_resource");
let file_description = "rustc";
let res_file = compile_windows_resource_file(&stem, file_description, VersionInfoFileType::App);
println!("cargo:rustc-link-arg={}", res_file.display());
}

fn set_windows_manifest() {
static WINDOWS_MANIFEST_FILE: &str = "Windows Manifest.xml";

let mut manifest = env::current_dir().unwrap();
Expand Down
39 changes: 28 additions & 11 deletions compiler/rustc_attr_parsing/src/attributes/link_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,22 @@ impl<S: Stage> CombineAttributeParser<S> for LinkParser {
cx: &'c mut AcceptContext<'_, '_, S>,
args: &'c ArgParser<'_>,
) -> impl IntoIterator<Item = Self::Item> + 'c {
let mut result = None;
let Some(items) = args.list() else {
cx.expected_list(cx.attr_span);
return result;
let items = match args {
ArgParser::List(list) => list,
// This is an edgecase added because making this a hard error would break too many crates
// Specifically `#[link = "dl"]` is accepted with a FCW
// For more information, see https://github.com/rust-lang/rust/pull/143193
ArgParser::NameValue(nv) if nv.value_as_str().is_some_and(|v| v == sym::dl) => {
let suggestions = <Self as CombineAttributeParser<S>>::TEMPLATE
.suggestions(cx.attr_style, "link");
let span = cx.attr_span;
cx.emit_lint(AttributeLintKind::IllFormedAttributeInput { suggestions }, span);
return None;
}
_ => {
cx.expected_list(cx.attr_span);
return None;
}
};

let sess = cx.sess();
Expand Down Expand Up @@ -113,7 +125,7 @@ impl<S: Stage> CombineAttributeParser<S> for LinkParser {
}
};
if !cont {
return result;
return None;
}
}

Expand Down Expand Up @@ -202,7 +214,7 @@ impl<S: Stage> CombineAttributeParser<S> for LinkParser {
}
let Some((name, name_span)) = name else {
cx.emit_err(LinkRequiresName { span: cx.attr_span });
return result;
return None;
};

// Do this outside of the loop so that `import_name_type` can be specified before `kind`.
Expand All @@ -218,15 +230,14 @@ impl<S: Stage> CombineAttributeParser<S> for LinkParser {
cx.emit_err(RawDylibNoNul { span: name_span });
}

result = Some(LinkEntry {
Some(LinkEntry {
span: cx.attr_span,
kind: kind.unwrap_or(NativeLibKind::Unspecified),
name,
cfg,
verbatim,
import_name_type,
});
result
})
}
}

Expand Down Expand Up @@ -455,8 +466,14 @@ impl<S: Stage> SingleAttributeParser<S> for LinkSectionParser {
const PATH: &[Symbol] = &[sym::link_section];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepInnermost;
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
const ALLOWED_TARGETS: AllowedTargets =
AllowedTargets::AllowListWarnRest(&[Allow(Target::Static), Allow(Target::Fn)]);
const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowListWarnRest(&[
Allow(Target::Static),
Allow(Target::Fn),
Allow(Target::Method(MethodKind::Inherent)),
Allow(Target::Method(MethodKind::Trait { body: false })),
Allow(Target::Method(MethodKind::Trait { body: true })),
Allow(Target::Method(MethodKind::TraitImpl)),
]);
const TEMPLATE: AttributeTemplate = template!(
NameValueStr: "name",
"https://doc.rust-lang.org/reference/abi.html#the-link_section-attribute"
Expand Down
29 changes: 29 additions & 0 deletions compiler/rustc_borrowck/src/diagnostics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use rustc_middle::ty::print::Print;
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_middle::{bug, span_bug};
use rustc_mir_dataflow::move_paths::{InitLocation, LookupResult, MoveOutIndex};
use rustc_session::lint::builtin::MACRO_EXTENDED_TEMPORARY_SCOPES;
use rustc_span::def_id::LocalDefId;
use rustc_span::source_map::Spanned;
use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span, Symbol, sym};
Expand Down Expand Up @@ -1580,4 +1581,32 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
pub(crate) fn local_excluded_from_unused_mut_lint(&self, index: Local) -> bool {
self.local_name(index).is_none_or(|name| name.as_str().starts_with('_'))
}

/// Report a temporary whose scope will shorten in Rust 1.92 due to #145838.
pub(crate) fn lint_macro_extended_temporary_scope(
&self,
future_drop: Location,
borrow: &BorrowData<'tcx>,
) {
let tcx = self.infcx.tcx;
let temp_decl = &self.body.local_decls[borrow.borrowed_place.local];
let temp_span = temp_decl.source_info.span;
let lint_root = self.body.source_scopes[temp_decl.source_info.scope]
.local_data
.as_ref()
.unwrap_crate_local()
.lint_root;

let mut labels = MultiSpan::from_span(temp_span);
labels.push_span_label(temp_span, "this expression creates a temporary value...");
labels.push_span_label(
self.body.source_info(future_drop).span,
"...which will be dropped at the end of this block in Rust 1.92",
);

tcx.node_span_lint(MACRO_EXTENDED_TEMPORARY_SCOPES, lint_root, labels, |diag| {
diag.primary_message("temporary lifetime will be shortened in Rust 1.92");
diag.note("consider using a `let` binding to create a longer lived value");
});
}
}
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 @@ -348,7 +348,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
43 changes: 26 additions & 17 deletions compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,8 @@ impl<'a, 'tcx> ResultsVisitor<'tcx, Borrowck<'a, 'tcx>> for MirBorrowckCtxt<'a,
| StatementKind::ConstEvalCounter
| StatementKind::StorageLive(..) => {}
// This does not affect borrowck
StatementKind::BackwardIncompatibleDropHint { place, reason: BackwardIncompatibleDropReason::Edition2024 } => {
self.check_backward_incompatible_drop(location, **place, state);
StatementKind::BackwardIncompatibleDropHint { place, reason } => {
self.check_backward_incompatible_drop(location, **place, state, *reason);
}
StatementKind::StorageDead(local) => {
self.access_place(
Expand Down Expand Up @@ -1386,6 +1386,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
location: Location,
place: Place<'tcx>,
state: &BorrowckDomain,
reason: BackwardIncompatibleDropReason,
) {
let tcx = self.infcx.tcx;
// If this type does not need `Drop`, then treat it like a `StorageDead`.
Expand All @@ -1412,21 +1413,29 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
if matches!(borrow.kind, BorrowKind::Fake(_)) {
return ControlFlow::Continue(());
}
let borrowed = this.retrieve_borrow_spans(borrow).var_or_use_path_span();
let explain = this.explain_why_borrow_contains_point(
location,
borrow,
Some((WriteKind::StorageDeadOrDrop, place)),
);
this.infcx.tcx.node_span_lint(
TAIL_EXPR_DROP_ORDER,
CRATE_HIR_ID,
borrowed,
|diag| {
session_diagnostics::TailExprDropOrder { borrowed }.decorate_lint(diag);
explain.add_explanation_to_diagnostic(&this, diag, "", None, None);
},
);
match reason {
BackwardIncompatibleDropReason::Edition2024 => {
let borrowed = this.retrieve_borrow_spans(borrow).var_or_use_path_span();
let explain = this.explain_why_borrow_contains_point(
location,
borrow,
Some((WriteKind::StorageDeadOrDrop, place)),
);
this.infcx.tcx.node_span_lint(
TAIL_EXPR_DROP_ORDER,
CRATE_HIR_ID,
borrowed,
|diag| {
session_diagnostics::TailExprDropOrder { borrowed }
.decorate_lint(diag);
explain.add_explanation_to_diagnostic(&this, diag, "", None, None);
},
);
}
BackwardIncompatibleDropReason::MacroExtendedScope => {
this.lint_macro_extended_temporary_scope(location, borrow);
}
}
// We may stop at the first case
ControlFlow::Break(())
},
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 @@ -254,6 +254,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 @@ -277,6 +281,7 @@ fn collect_defining_uses<'tcx>(
defining_uses
}

#[instrument(level = "debug", skip(rcx, concrete_opaque_types, defining_uses, errors))]
fn compute_concrete_types_from_defining_uses<'tcx>(
rcx: &RegionCtxt<'_, 'tcx>,
concrete_opaque_types: &mut ConcreteOpaqueTypes<'tcx>,
Expand All @@ -288,13 +293,15 @@ fn compute_concrete_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
10 changes: 0 additions & 10 deletions compiler/rustc_codegen_llvm/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,16 +435,6 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
|| codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::ALLOCATOR_ZEROED)
{
to_add.push(create_alloc_family_attr(cx.llcx));
if let Some(zv) =
cx.tcx.get_attr(instance.def_id(), rustc_span::sym::rustc_allocator_zeroed_variant)
&& let Some(name) = zv.value_str()
{
to_add.push(llvm::CreateAttrStringValue(
cx.llcx,
"alloc-variant-zeroed",
&mangle_internal_symbol(cx.tcx, name.as_str()),
));
}
// apply to argument place instead of function
let alloc_align = AttributeKind::AllocAlign.create_attr(cx.llcx);
attributes::apply_to_llfn(llfn, AttributePlace::Argument(1), &[alloc_align]);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ar_archive_writer = "0.5"
bitflags = "2.4.1"
bstr = "1.11.3"
# `cc` updates often break things, so we pin it here. Cargo enforces "max 1 semver-compat version
# per crate", so if you change this, you need to also change it in `rustc_llvm` and `rustc_windows_rc`.
# per crate", so if you change this, you need to also change it in `rustc_llvm`.
cc = "=1.2.16"
itertools = "0.12"
pathdiff = "0.2.0"
Expand Down
Loading
Loading