Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2e46fb4
Merge commit 'ffb7eef504d4d9507583825e8e411d283c4e357e'
GuillaumeGomez Sep 24, 2026
176156b
Merge branch 'master' into sync_from_rust_2026_09_24
antoyo Sep 24, 2026
48cd117
Merge pull request #985 from rust-lang/sync_from_rust_2026_09_24
antoyo Sep 24, 2026
1ff212e
Support -Z merge-functions with gcc and add stack-protector asm tests
Sep 24, 2026
26c112b
address comments by bjorn3
Sep 24, 2026
bab2d83
compiler: remove rustc_hir attr re-exports
mejrs Sep 24, 2026
4b77474
Rollup merge of #163250 - mejrs:hir_imports3, r=JonathanBrouwer
JonathanBrouwer Sep 27, 2026
a048dfd
chore: use r-l/r zulip linkifier for r-l/r rustfmt backport nominations
jieyouxu Sep 29, 2026
e054cb5
Update gccjit.rs version
antoyo Sep 29, 2026
ef0c7b7
Merge pull request #986 from rust-lang/update-gccjit
antoyo Sep 29, 2026
768500b
Add support for span context to `derive(Diagnostic)`
estebank Sep 27, 2026
c5f17f6
Point at enclosing item(s) on unexpected item type
estebank Sep 27, 2026
1ab22ea
Show trait/impl for duplicate impl associated items
estebank Sep 27, 2026
be0d432
Point at trait/impl on associated item mismatch
estebank Sep 27, 2026
246eb14
On `impl` item signature mismatch, point at impl and trait
estebank Sep 27, 2026
9adacb1
Merge branch 'master' into sync-2026-09-29
GuillaumeGomez Sep 29, 2026
852ac9e
Update rust-toolchain version needed
GuillaumeGomez Sep 29, 2026
99055ee
Revert "Rollup merge of #120589 - devnexen:cpuaff_fbsd_upd, r=clarfon…
devnexen Sep 29, 2026
10448a3
Fix panic when casting from i128 to f16
antoyo Sep 29, 2026
b3cf6a5
Install rustfmt stdarch CI workflow
antoyo Sep 29, 2026
0317026
impl std::fs::{Home|Media}Dirs
CAD97 Aug 31, 2026
7d0907e
arch::breakpoint: update documentation
RalfJung Sep 29, 2026
8c858fb
Merge pull request #987 from GuillaumeGomez/sync
antoyo Sep 29, 2026
707f1c5
update breakpoint asm test
RalfJung Sep 29, 2026
71d1c02
Merge commit '8c858fb5fbb077eaa776302b9601cf084f12aa46' into HEAD
GuillaumeGomez Sep 29, 2026
4592a84
Rollup merge of #158936 - CAD97:dirs, r=aapoalas
jhpratt Sep 30, 2026
c7a9fa3
Rollup merge of #163414 - estebank:derive-diagnostic-context, r=petro…
jhpratt Sep 30, 2026
80acab4
Rollup merge of #163481 - jieyouxu:jieyouxu/rustfmt-backport-nom, r=y…
jhpratt Sep 30, 2026
b85fd68
Rollup merge of #163502 - RalfJung:breakpoint, r=tgross35
jhpratt Sep 30, 2026
f2d2a9d
Rollup merge of #163505 - GuillaumeGomez:sync-2026-09-29, r=antoyo
jhpratt Sep 30, 2026
675dee8
Rollup merge of #163498 - devnexen:revert_120589, r=clarfonthey
jhpratt Sep 30, 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
4 changes: 4 additions & 0 deletions compiler/rustc_codegen_gcc/.github/workflows/stdarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ jobs:
- name: Setup rust toolchain
run: rustup show

# The stdarch-gen-common tests run rustfmt.
- name: Install rustfmt
run: rustup component add rustfmt

- name: Setup rust cache
uses: Swatinem/rust-cache@v2

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_gcc/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ dependencies = [

[[package]]
name = "gccjit"
version = "6.1.0"
version = "7.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d85b5754389edaad832ba320709a25086b3081a8c6c0fab2322965e5fb512b3"
checksum = "dfdb84ba432f6679794790de652bfbed86201893a30c03dc669c2bfe7424f472"
dependencies = [
"gccjit_sys",
]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ default = ["master"]
[dependencies]
object = { version = "0.39.0", default-features = false, features = ["std", "read"] }
tempfile = "3.20"
gccjit = { version = "6.1.0", features = ["dlopen"] }
gccjit = { version = "7.0.0", features = ["dlopen"] }
#gccjit = { git = "https://github.com/rust-lang/gccjit.rs", branch = "error-dlopen", features = ["dlopen"] }

# Local copy.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2026-09-24"
channel = "nightly-2026-09-29"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
4 changes: 4 additions & 0 deletions compiler/rustc_codegen_gcc/src/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,10 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {

debug_assert!(value_type.dyncast_array().is_some());
let name_suffix = match self.type_kind(dest_typ) {
TypeKind::Half if dest_typ.is_compatible_with(self.type_f16()) => {
let value = self.int_to_float_cast(signed, value, self.float_type);
return self.context.new_cast(None, value, dest_typ);
}
// cSpell:disable
TypeKind::Float => "tisf",
TypeKind::Double => "tidf",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ impl CodegenBackend for GccCodegenBackend {
lto_supported: gccjit::is_lto_supported(),
});

gccjit::set_global_personality_function_name(b"rust_eh_personality\0");
gccjit::set_global_personality_function_name(c"rust_eh_personality");
}

#[cfg(not(feature = "master"))]
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_hir_analysis/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ pub(crate) struct AssocKindMismatch {
#[primary_span]
#[label("unexpected {$got}")]
pub span: Span,
#[context]
pub item_span: Span,
#[context]
pub enclosing_span: Option<Span>,
pub expected: &'static str,
pub got: &'static str,
#[label("expected a {$expected} because of this associated {$expected}")]
Expand Down
23 changes: 23 additions & 0 deletions compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,31 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
(ident.span, None, assoc_tag, assoc_item.tag())
};

let def_kind = tcx.def_kind(self.item_def_id());
let item_span = tcx.def_span(self.item_def_id()).shrink_to_lo();
let (item_span, enclosing_span) = match def_kind {
DefKind::AssocConst | DefKind::AssocFn | DefKind::AssocTy => (
item_span,
Some(tcx.def_span(tcx.parent(self.item_def_id().into())).shrink_to_lo()),
),
DefKind::OpaqueTy => {
let item_span = tcx.def_span(tcx.parent(self.item_def_id().into())).shrink_to_lo();
let enclosing_span =
if let DefKind::AssocConst | DefKind::AssocFn | DefKind::AssocTy =
tcx.def_kind(tcx.parent(self.item_def_id().into()))
{
Some(tcx.def_span(tcx.parent(self.item_def_id().into())).shrink_to_lo())
} else {
None
};
(item_span, enclosing_span)
}
_ => (item_span, None),
};
self.dcx().emit_err(diagnostics::AssocKindMismatch {
span,
item_span,
enclosing_span,
expected: assoc_tag_str(expected),
got: assoc_tag_str(got),
expected_because_label,
Expand Down
7 changes: 6 additions & 1 deletion compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,16 @@ impl DiagnosticDeriveVariantBuilder {
match (&attr.meta, name.as_str()) {
(Meta::Path(_), "primary_span") => {
report_error_if_not_applied_to_span(attr, &info)?;

return Ok(quote! {
diag.span(#binding);
});
}
(Meta::Path(_), "context") => {
report_error_if_not_applied_to_span(attr, &info)?;
return Ok(quote! {
diag.span_context(#binding);
});
}
(Meta::Path(_), "subdiagnostic") => {
return Ok(quote! { diag.subdiagnostic(#binding); });
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ decl_derive!(
// field attributes
primary_span,
label,
context,
subdiagnostic,
suggestion)] =>
#[doc = "See <https://rustc-dev-guide.rust-lang.org/diagnostics/diagnostic-structs.html#derivediagnostic>"]
Expand Down
26 changes: 18 additions & 8 deletions compiler/rustc_resolve/src/diagnostics/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
code,
trait_item_span,
trait_path,
trait_span,
impl_span,
} => self
.dcx()
.create_err(diagnostics::TraitImplMismatch {
Expand All @@ -1407,16 +1409,24 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
kind,
trait_path,
trait_item_span,
trait_span,
impl_span,
})
.with_code(code),
ResolutionError::TraitImplDuplicate { name, trait_item_span, old_span } => {
self.dcx().create_err(diagnostics::TraitImplDuplicate {
span,
name,
trait_item_span,
old_span,
})
}
ResolutionError::TraitImplDuplicate {
name,
trait_item_span,
old_span,
trait_span,
impl_span,
} => self.dcx().create_err(diagnostics::TraitImplDuplicate {
span,
name,
trait_item_span,
trait_span,
impl_span,
old_span,
}),
ResolutionError::InvalidAsmSym => {
self.dcx().create_err(diagnostics::InvalidAsmSym { span })
}
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_resolve/src/diagnostics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,10 @@ pub(crate) struct TraitImplDuplicate {
pub(crate) old_span: Span,
#[label("item in trait")]
pub(crate) trait_item_span: Span,
#[context]
pub(crate) trait_span: Span,
#[context]
pub(crate) impl_span: Span,
pub(crate) name: Ident,
}

Expand Down Expand Up @@ -1410,6 +1414,10 @@ pub(crate) struct TraitImplMismatch {
pub(crate) trait_path: String,
#[label("item in trait")]
pub(crate) trait_item_span: Span,
#[context]
pub(crate) trait_span: Span,
#[context]
pub(crate) impl_span: Span,
}

#[derive(Diagnostic)]
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_resolve/src/late.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3902,12 +3902,16 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {

match seen_trait_items.entry(id_in_trait) {
Entry::Occupied(entry) => {
let trait_span = decl.parent_module.unwrap().span.shrink_to_lo();
let impl_span = self.current_trait_ref.as_ref().unwrap().1.path.span;
self.report_error(
span,
ResolutionError::TraitImplDuplicate {
name: ident,
old_span: *entry.get(),
trait_item_span: decl.span,
trait_span,
impl_span,
},
);
return;
Expand Down Expand Up @@ -3940,6 +3944,8 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
}
};
let trait_path = path_names_to_string(path);
let trait_span = decl.parent_module.unwrap().span.shrink_to_lo();
let impl_span = self.current_trait_ref.as_ref().unwrap().1.path.span;
self.report_error(
span,
ResolutionError::TraitImplMismatch {
Expand All @@ -3948,6 +3954,8 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
code,
trait_path,
trait_item_span: decl.span,
trait_span,
impl_span,
},
);
}
Expand Down
10 changes: 9 additions & 1 deletion compiler/rustc_resolve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,17 @@ enum ResolutionError<'ra> {
trait_path: String,
trait_item_span: Span,
code: ErrCode,
trait_span: Span,
impl_span: Span,
},
/// Error E0201: multiple impl items for the same trait item.
TraitImplDuplicate { name: Ident, trait_item_span: Span, old_span: Span },
TraitImplDuplicate {
name: Ident,
trait_item_span: Span,
old_span: Span,
trait_span: Span,
impl_span: Span,
},
/// Inline asm `sym` operand must refer to a `fn` or `static`.
InvalidAsmSym,
/// `self` used instead of `Self` in a generic parameter
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_trait_selection/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,10 @@ pub(crate) struct TraitImplDiff {
pub found_short: String,
pub expected: String,
pub found: String,
#[context]
pub trait_span: Span,
#[context]
pub impl_span: Span,
}

#[derive(Diagnostic)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,21 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
) = error.clone()
&& let (SubregionOrigin::Subtype(sup_trace), SubregionOrigin::Subtype(sub_trace)) =
(&sup_origin, &sub_origin)
&& let &ObligationCauseCode::CompareImplItem { trait_item_def_id, .. } =
sub_trace.cause.code()
&& let &ObligationCauseCode::CompareImplItem {
trait_item_def_id, impl_item_def_id, ..
} = sub_trace.cause.code()
&& sub_trace.values == sup_trace.values
&& let ValuePairs::PolySigs(ExpectedFound { expected, found }) = sub_trace.values
{
// FIXME(compiler-errors): Don't like that this needs `Ty`s, but
// all of the region highlighting machinery only deals with those.
let guar = self.emit_err(var_origin.span(), expected, found, trait_item_def_id);
let guar = self.emit_err(
var_origin.span(),
expected,
found,
trait_item_def_id,
impl_item_def_id.into(),
);
return Some(guar);
}
None
Expand All @@ -54,6 +61,7 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
expected: ty::PolyFnSig<'tcx>,
found: ty::PolyFnSig<'tcx>,
trait_item_def_id: DefId,
impl_item_def_id: DefId,
) -> ErrorGuaranteed {
let trait_sp = self.tcx().def_span(trait_item_def_id);

Expand Down Expand Up @@ -135,6 +143,8 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
found,
expected_short,
found_short,
trait_span: self.tcx().def_span(self.tcx().parent(trait_item_def_id)).shrink_to_lo(),
impl_span: self.tcx().def_span(self.tcx().parent(impl_item_def_id)).shrink_to_lo(),
};

let mut diag = self.tcx().dcx().create_err(diag);
Expand Down
8 changes: 6 additions & 2 deletions library/core/src/arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ pub macro global_asm("assembly template", $(operands,)* $(options($(option),*))?
/// to a trapping instruction (e.g. an undefined instruction) instead, or to some other form of
/// target-specific abort that may or may not support convenient resumption.
///
/// The precise behavior and the precise instruction generated are not guaranteed, except that in
/// normal execution with no debug tooling involved this will not continue executing.
/// The precise behavior is not guaranteed, it depends on the architecture and operating system.
/// Not all architectures guarantee that a breakpoint instruction interrupts execution in the absence
/// of a debugger, and not all operating systems and execution environments guarantee that such an
/// interrupt aborts the current process.
///
/// The precise instruction is guaranteed only on the following targets:
/// - On x86 targets, this produces an `int3` instruction.
/// - On aarch64 targets, this produces a `brk #0xf000` instruction.
// When adding more items above, also add cases to the test in `tests/assembly-llvm/breakpoint.rs`.
// When stabilizing this, update the comment on `core::intrinsics::breakpoint`.
#[unstable(feature = "breakpoint", issue = "133724")]
#[inline(always)]
Expand Down
51 changes: 51 additions & 0 deletions library/std/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,57 @@ impl fmt::Debug for SplitPaths<'_> {
}
}

/// An iterator that splits an environment variable into paths according to
/// platform-specific conventions.
///
/// The iterator element type is <code>&[Path]</code>.
///
/// This structure is created by [`env::split_paths_ref()`]. See its
/// documentation for more.
///
/// [`env::split_paths_ref()`]: split_paths_ref
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[unstable(feature = "env_split_paths_ref", issue = "none")]
pub struct SplitPathsRef<'a> {
inner: paths_imp::SplitPathsRef<'a>,
}

/// Parses input according to platform conventions for the `PATH`
/// environment variable.
///
/// Unlike [`split_paths`], this function does not allocate and instead yields
/// [`Path`]s borrowed from `unparsed`. Returns `None` on platforms that may
/// require allocations to handle `PATH` splitting conventions.
///
/// # Platform-specific behavior
///
/// Returns `Some` on Unix platforms and `None` on all other platforms.
/// Note that this [may change in the future][changes].
///
/// [changes]: io#platform-specific-behavior
#[unstable(feature = "env_split_paths_ref", issue = "none")]
pub fn split_paths_ref<T: AsRef<OsStr> + ?Sized>(unparsed: &T) -> Option<SplitPathsRef<'_>> {
Some(SplitPathsRef { inner: paths_imp::split_paths_ref(unparsed.as_ref())? })
}

#[unstable(feature = "env_split_paths_ref", issue = "none")]
impl<'a> Iterator for SplitPathsRef<'a> {
type Item = &'a Path;
fn next(&mut self) -> Option<&'a Path> {
self.inner.next()
}
fn size_hint(&self) -> (usize, Option<usize>) {
self.inner.size_hint()
}
}

#[unstable(feature = "env_split_paths_ref", issue = "none")]
impl fmt::Debug for SplitPathsRef<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("SplitPathsRef").finish_non_exhaustive()
}
}

/// The error type for operations on the `PATH` variable. Possibly returned from
/// [`env::join_paths()`].
///
Expand Down
7 changes: 7 additions & 0 deletions library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ use crate::sys::{AsInner, AsInnerMut, FromInner, IntoInner, fs as fs_imp};
use crate::time::SystemTime;
use crate::{error, fmt};

pub(crate) mod dirs;

#[unstable(feature = "fs_home_dirs", issue = "162082")]
pub use self::dirs::HomeDirs;
#[unstable(feature = "fs_media_dirs", issue = "162083")]
pub use self::dirs::MediaDirs;

/// An object providing access to an open file on the filesystem.
///
/// An instance of a `File` can be read and/or written depending on what options
Expand Down
Loading
Loading