1
Fork 0

Rollup merge of #137333 - compiler-errors:edition-2024-fresh, r=Nadrieril

Use `edition = "2024"` in the compiler (redux)

Most of this is binding mode changes, which I fixed by running `x.py fix`.

Also adds some miscellaneous `unsafe` blocks for new unsafe standard library functions (the setenv ones), and a missing `unsafe extern` block in some enzyme codegen code, and fixes some precise capturing lifetime changes (but only when they led to errors).

cc ``@ehuss`` ``@traviscross``
This commit is contained in:
Matthias Krüger 2025-02-22 11:36:43 +01:00 committed by GitHub
commit 37e0d138cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
149 changed files with 259 additions and 280 deletions

View file

@ -106,7 +106,7 @@ fn anon_const_type_of<'tcx>(icx: &ItemCtxt<'tcx>, def_id: LocalDefId) -> Ty<'tcx
}
}
}
Node::Variant(Variant { disr_expr: Some(ref e), .. }) if e.hir_id == hir_id => {
Node::Variant(Variant { disr_expr: Some(e), .. }) if e.hir_id == hir_id => {
tcx.adt_def(tcx.hir_get_parent_item(hir_id)).repr().discr_type().to_ty(tcx)
}
// Sort of affects the type system, but only for the purpose of diagnostics

View file

@ -1226,11 +1226,10 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
adt_def.variants().iter().find(|s| s.name == variant_name)
{
let mut suggestion = vec![(assoc_ident.span, variant_name.to_string())];
if let hir::Node::Stmt(hir::Stmt {
kind: hir::StmtKind::Semi(ref expr),
..
if let hir::Node::Stmt(&hir::Stmt {
kind: hir::StmtKind::Semi(expr), ..
})
| hir::Node::Expr(ref expr) = tcx.parent_hir_node(hir_ref_id)
| hir::Node::Expr(expr) = tcx.parent_hir_node(hir_ref_id)
&& let hir::ExprKind::Struct(..) = expr.kind
{
match variant.ctor {