Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
0dc233f
point to Compiler team docs on Forge
tshepang Sep 6, 2025
1806a82
remove confusing parts of sentence
tshepang Sep 8, 2025
755db7f
sembr
tshepang Sep 8, 2025
cb0e26f
fix markup
tshepang Sep 8, 2025
94da520
readability
tshepang Sep 8, 2025
8c324de
Merge pull request #2585 from rust-lang/tshepang/sembr
tshepang Sep 8, 2025
a5575f8
Fix broken Microsoft URL missing slash
ali90h Sep 8, 2025
808595e
Merge pull request #2586 from ali90h/fix-microsoft-link-broken-url
Noratrieb Sep 8, 2025
096ae06
glossary: add entry for rustbuild
lolbinarycat Jul 22, 2025
196b49a
glossary(rustbuild): reword according to code review
lolbinarycat Sep 10, 2025
82ff002
Add missing documentation for running tests with GCC backend
GuillaumeGomez Sep 10, 2025
76c4d68
Merge pull request #2516 from lolbinarycat/patch-4
tshepang Sep 10, 2025
d8f0842
docs: typetree in autodiff
KMJ-007 May 13, 2025
ff59107
Merge pull request #2385 from KMJ-007/master
ZuseZ4 Sep 11, 2025
d588c11
Restructure the docs
Kobzol Sep 11, 2025
7a4b728
Rename "crashes tests" to "crash tests"
fmease Sep 12, 2025
ddfd47a
Merge pull request #2588 from fmease/to-crash-tests
fmease Sep 12, 2025
ee63b07
Merge pull request #2584 from rust-lang/tshepang-patch-5
Noratrieb Sep 12, 2025
7b0b0bb
Clarify that backtick escaping doesn't work for `@bors try jobs`
Kobzol Sep 15, 2025
001f8e3
Update src/tests/ci.md
Kobzol Sep 15, 2025
3a14fb7
Merge pull request #2589 from Kobzol/ci-bors-backticks
Kobzol Sep 15, 2025
ee496f2
a valid state is achieved by passing the test suite
tshepang Sep 17, 2025
6f813e8
Adds AArch64 GCS support
CrooseGit Sep 1, 2025
cea82e3
Merge pull request #2591 from rust-lang/tshepang-patch-5
Noratrieb Sep 17, 2025
b17213a
about-this-guide.md: improve a bit
tshepang Sep 17, 2025
66a84ef
Merge pull request #2592 from rust-lang/tshepang-patch-5
tshepang Sep 17, 2025
9819cea
Merge pull request #2587 from GuillaumeGomez/gcc-backend-missing-docs
GuillaumeGomez Sep 18, 2025
72b0291
Merge pull request #2580 from rust-lang/tshepang-patch-2
jieyouxu Sep 19, 2025
d887c57
Correct a misspelling of RUSTC_LOG
cammeresi Sep 21, 2025
a11333a
Merge pull request #2594 from cammeresi/spelling-20250921
tshepang Sep 21, 2025
5658b39
Prepare for merging from rust-lang/rust
invalid-email-address Sep 22, 2025
c3d3074
Merge ref '9f32ccf35fb8' from rust-lang/rust
invalid-email-address Sep 22, 2025
06819d9
Extends branch protection tests to include GCS
CrooseGit Sep 2, 2025
391a2ea
Merge pull request #2595 from rust-lang/rustc-pull
tshepang Sep 22, 2025
62b2bd5
reduce overlong lines
tshepang Sep 22, 2025
45f891d
Merge pull request #2596 from rust-lang/tshepang/sembr
tshepang Sep 22, 2025
1e2594f
various improvements resulting from reading Testing with CI
tshepang Sep 22, 2025
70f3768
Merge pull request #2593 from rust-lang/tshepang/testing-with-ci
tshepang Sep 22, 2025
5e7d346
Update books
rustbot Sep 22, 2025
2d18c88
Fix a crash/mislex when more than one frontmatter closing possibility…
Teapot4195 Sep 22, 2025
819f8b0
Mutex/RwLock/ReentrantLock::data_ptr to be const fn
peter-lyons-kehl Sep 22, 2025
82c4018
fix ICE in rustdoc::invalid_html_tags
lolbinarycat Sep 22, 2025
60f6012
add regression test for issue 146537
cyrgani Sep 22, 2025
bc7986e
Add attributes for #[global_allocator] functions
nikic Sep 18, 2025
08020de
Changes some aarch64 CIs g++ install & ubuntu ver.
CrooseGit Sep 10, 2025
d338aca
unstably constify float mul_add methods
Qelxiros Sep 18, 2025
60b3563
revert change removing `has_infer` check. Commit conservatively patch…
tnuha Sep 23, 2025
e8a8e06
Make missed precondition-free float intrinsics safe
clarfonthey Sep 23, 2025
aa53782
core: simplify `CStr::default()`
joboet Sep 23, 2025
c9dc0e3
temporary-lifetime-extension-tuple-ctor.rs: make usable on all editions
tshepang Sep 24, 2025
d3d8a40
f16_f128: enable some more tests in Miri
RalfJung Sep 18, 2025
b3d6a2d
Rollup merge of #146338 - CrooseGit:dev/reucru01/AArch64-enable-GCS, …
Zalathar Sep 24, 2025
a27d317
Rollup merge of #146735 - Qelxiros:const_mul_add, r=tgross35,RalfJung
Zalathar Sep 24, 2025
274f736
Rollup merge of #146737 - RalfJung:f16-f128-miri, r=tgross35
Zalathar Sep 24, 2025
309de31
Rollup merge of #146766 - nikic:global-alloc-attr, r=nnethercote
Zalathar Sep 24, 2025
fb3c1e6
Rollup merge of #146857 - tnuha:revert_self_has_no_region_infer, r=lcnr
Zalathar Sep 24, 2025
6ea9efb
Rollup merge of #146896 - tshepang:rdg-sync, r=tshepang
Zalathar Sep 24, 2025
ddde836
Rollup merge of #146897 - lolbinarycat:rustdoc-invalid_html_tags-ice-…
Zalathar Sep 24, 2025
1d05e22
Rollup merge of #146898 - rustbot:docs-update, r=ehuss
Zalathar Sep 24, 2025
f1a6cdc
Rollup merge of #146899 - Teapot4195:issue-146847-fix, r=nnethercote
Zalathar Sep 24, 2025
5cf4a57
Rollup merge of #146904 - peter-lyons-kehl:140368_data_ptr_const_fn, …
Zalathar Sep 24, 2025
7cf72a1
Rollup merge of #146907 - cyrgani:146537-test, r=nnethercote
Zalathar Sep 24, 2025
d42825a
Rollup merge of #146915 - clarfonthey:safe-intrinsics-2, r=RalfJung
Zalathar Sep 24, 2025
d94d4be
Rollup merge of #146950 - joboet:cstr_default, r=tgross35
Zalathar Sep 24, 2025
271f986
Rollup merge of #146959 - tshepang:patch-2, r=nnethercote
Zalathar Sep 24, 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
16 changes: 13 additions & 3 deletions compiler/rustc_builtin_macros/src/global_allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl AllocFnFactory<'_, '_> {
body,
define_opaque: None,
}));
let item = self.cx.item(self.span, self.attrs(), kind);
let item = self.cx.item(self.span, self.attrs(method), kind);
self.cx.stmt_item(self.ty_span, item)
}

Expand All @@ -100,8 +100,18 @@ impl AllocFnFactory<'_, '_> {
self.cx.expr_call(self.ty_span, method, args)
}

fn attrs(&self) -> AttrVec {
thin_vec![self.cx.attr_word(sym::rustc_std_internal_symbol, self.span)]
fn attrs(&self, method: &AllocatorMethod) -> AttrVec {
let alloc_attr = match method.name {
sym::alloc => sym::rustc_allocator,
sym::dealloc => sym::rustc_deallocator,
sym::realloc => sym::rustc_reallocator,
sym::alloc_zeroed => sym::rustc_allocator_zeroed,
_ => unreachable!("Unknown allocator method!"),
};
thin_vec![
self.cx.attr_word(sym::rustc_std_internal_symbol, self.span),
self.cx.attr_word(alloc_attr, self.span)
]
}

fn arg_ty(&self, input: &AllocatorMethodInput, args: &mut ThinVec<Param>) -> Box<Expr> {
Expand Down
5 changes: 4 additions & 1 deletion compiler/rustc_codegen_llvm/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,16 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
to_add.extend(sanitize_attrs(cx, codegen_fn_attrs.no_sanitize));

// For non-naked functions, set branch protection attributes on aarch64.
if let Some(BranchProtection { bti, pac_ret }) =
if let Some(BranchProtection { bti, pac_ret, gcs }) =
cx.sess().opts.unstable_opts.branch_protection
{
assert!(cx.sess().target.arch == "aarch64");
if bti {
to_add.push(llvm::CreateAttrString(cx.llcx, "branch-target-enforcement"));
}
if gcs {
to_add.push(llvm::CreateAttrString(cx.llcx, "guarded-control-stack"));
}
if let Some(PacRet { leaf, pc, key }) = pac_ret {
if pc {
to_add.push(llvm::CreateAttrString(cx.llcx, "branch-protection-pauth-lr"));
Expand Down
9 changes: 8 additions & 1 deletion compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ pub(crate) unsafe fn create_module<'ll>(
);
}

if let Some(BranchProtection { bti, pac_ret }) = sess.opts.unstable_opts.branch_protection {
if let Some(BranchProtection { bti, pac_ret, gcs }) = sess.opts.unstable_opts.branch_protection
{
if sess.target.arch == "aarch64" {
llvm::add_module_flag_u32(
llmod,
Expand Down Expand Up @@ -403,6 +404,12 @@ pub(crate) unsafe fn create_module<'ll>(
"sign-return-address-with-bkey",
u32::from(pac_opts.key == PAuthKey::B),
);
llvm::add_module_flag_u32(
llmod,
llvm::ModuleFlagMergeBehavior::Min,
"guarded-control-stack",
gcs.into(),
);
} else {
bug!(
"branch-protection used on non-AArch64 target; \
Expand Down
46 changes: 46 additions & 0 deletions compiler/rustc_const_eval/src/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,14 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
dest,
rustc_apfloat::Round::NearestTiesToEven,
)?,
sym::fmaf16 => self.fma_intrinsic::<Half>(args, dest)?,
sym::fmaf32 => self.fma_intrinsic::<Single>(args, dest)?,
sym::fmaf64 => self.fma_intrinsic::<Double>(args, dest)?,
sym::fmaf128 => self.fma_intrinsic::<Quad>(args, dest)?,
sym::fmuladdf16 => self.float_muladd_intrinsic::<Half>(args, dest)?,
sym::fmuladdf32 => self.float_muladd_intrinsic::<Single>(args, dest)?,
sym::fmuladdf64 => self.float_muladd_intrinsic::<Double>(args, dest)?,
sym::fmuladdf128 => self.float_muladd_intrinsic::<Quad>(args, dest)?,

// Unsupported intrinsic: skip the return_to_block below.
_ => return interp_ok(false),
Expand Down Expand Up @@ -1035,4 +1043,42 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
self.write_scalar(res, dest)?;
interp_ok(())
}

fn fma_intrinsic<F>(
&mut self,
args: &[OpTy<'tcx, M::Provenance>],
dest: &PlaceTy<'tcx, M::Provenance>,
) -> InterpResult<'tcx, ()>
where
F: rustc_apfloat::Float + rustc_apfloat::FloatConvert<F> + Into<Scalar<M::Provenance>>,
{
let a: F = self.read_scalar(&args[0])?.to_float()?;
let b: F = self.read_scalar(&args[1])?.to_float()?;
let c: F = self.read_scalar(&args[2])?.to_float()?;

let res = a.mul_add(b, c).value;
let res = self.adjust_nan(res, &[a, b, c]);
self.write_scalar(res, dest)?;
interp_ok(())
}

fn float_muladd_intrinsic<F>(
&mut self,
args: &[OpTy<'tcx, M::Provenance>],
dest: &PlaceTy<'tcx, M::Provenance>,
) -> InterpResult<'tcx, ()>
where
F: rustc_apfloat::Float + rustc_apfloat::FloatConvert<F> + Into<Scalar<M::Provenance>>,
{
let a: F = self.read_scalar(&args[0])?.to_float()?;
let b: F = self.read_scalar(&args[1])?.to_float()?;
let c: F = self.read_scalar(&args[2])?.to_float()?;

let fuse = M::float_fuse_mul_add(self);

let res = if fuse { a.mul_add(b, c).value } else { ((a * b).value + c).value };
let res = self.adjust_nan(res, &[a, b, c]);
self.write_scalar(res, dest)?;
interp_ok(())
}
}
8 changes: 8 additions & 0 deletions compiler/rustc_const_eval/src/interpret/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ pub trait Machine<'tcx>: Sized {
a
}

/// Determines whether the `fmuladd` intrinsics fuse the multiply-add or use separate operations.
fn float_fuse_mul_add(_ecx: &mut InterpCx<'tcx, Self>) -> bool;

/// Called before a basic block terminator is executed.
#[inline]
fn before_terminator(_ecx: &mut InterpCx<'tcx, Self>) -> InterpResult<'tcx> {
Expand Down Expand Up @@ -672,6 +675,11 @@ pub macro compile_time_machine(<$tcx: lifetime>) {
match fn_val {}
}

#[inline(always)]
fn float_fuse_mul_add(_ecx: &mut InterpCx<$tcx, Self>) -> bool {
true
}

#[inline(always)]
fn ub_checks(_ecx: &InterpCx<$tcx, Self>) -> InterpResult<$tcx, bool> {
// We can't look at `tcx.sess` here as that can differ across crates, which can lead to
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_hir_analysis/src/check/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
| sym::contract_check_ensures
| sym::contract_check_requires
| sym::contract_checks
| sym::copysignf16
| sym::copysignf32
| sym::copysignf64
| sym::copysignf128
| sym::cosf16
| sym::cosf32
| sym::cosf64
Expand All @@ -106,6 +110,10 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
| sym::expf32
| sym::expf64
| sym::expf128
| sym::fabsf16
| sym::fabsf32
| sym::fabsf64
| sym::fabsf128
| sym::fadd_algebraic
| sym::fdiv_algebraic
| sym::floorf16
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_interface/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,8 @@ fn test_unstable_options_tracking_hash() {
branch_protection,
Some(BranchProtection {
bti: true,
pac_ret: Some(PacRet { leaf: true, pc: true, key: PAuthKey::B })
pac_ret: Some(PacRet { leaf: true, pc: true, key: PAuthKey::B }),
gcs: true,
})
);
tracked!(codegen_backend, Some("abc".to_string()));
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_lexer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,14 +599,16 @@ impl Cursor<'_> {
if potential_closing.is_none() {
// a less fortunate recovery if all else fails which finds any dashes preceded by whitespace
// on a standalone line. Might be wrong.
let mut base_index = 0;
while let Some(closing) = rest.find("---") {
let preceding_chars_start = rest[..closing].rfind("\n").map_or(0, |i| i + 1);
if rest[preceding_chars_start..closing].chars().all(is_horizontal_whitespace) {
// candidate found
potential_closing = Some(closing);
potential_closing = Some(closing + base_index);
break;
} else {
rest = &rest[closing + 3..];
base_index += closing + 3;
}
}
}
Expand Down
11 changes: 10 additions & 1 deletion compiler/rustc_middle/src/ty/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,6 @@ impl<'tcx> Ty<'tcx> {
/// 2229 drop reorder migration analysis.
#[inline]
pub fn has_significant_drop(self, tcx: TyCtxt<'tcx>, typing_env: ty::TypingEnv<'tcx>) -> bool {
assert!(!self.has_non_region_infer());
// Avoid querying in simple cases.
match needs_drop_components(tcx, self) {
Err(AlwaysRequiresDrop) => true,
Expand All @@ -1381,6 +1380,16 @@ impl<'tcx> Ty<'tcx> {
_ => self,
};

// FIXME
// We should be canonicalizing, or else moving this to a method of inference
// context, or *something* like that,
// but for now just avoid passing inference variables
// to queries that can't cope with them.
// Instead, conservatively return "true" (may change drop order).
if query_ty.has_infer() {
return true;
}

// This doesn't depend on regions, so try to minimize distinct
// query keys used.
let erased = tcx.normalize_erasing_regions(typing_env, query_ty);
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1621,6 +1621,7 @@ pub struct PacRet {
pub struct BranchProtection {
pub bti: bool,
pub pac_ret: Option<PacRet>,
pub gcs: bool,
}

pub(crate) const fn default_lib_output() -> CrateType {
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ mod desc {
pub(crate) const parse_polonius: &str = "either no value or `legacy` (the default), or `next`";
pub(crate) const parse_stack_protector: &str =
"one of (`none` (default), `basic`, `strong`, or `all`)";
pub(crate) const parse_branch_protection: &str = "a `,` separated combination of `bti`, `pac-ret`, followed by a combination of `pc`, `b-key`, or `leaf`";
pub(crate) const parse_branch_protection: &str = "a `,` separated combination of `bti`, `gcs`, `pac-ret`, (optionally with `pc`, `b-key`, `leaf` if `pac-ret` is set)";
pub(crate) const parse_proc_macro_execution_strategy: &str =
"one of supported execution strategies (`same-thread`, or `cross-thread`)";
pub(crate) const parse_remap_path_scope: &str =
Expand Down Expand Up @@ -1905,6 +1905,7 @@ pub mod parse {
Some(pac) => pac.pc = true,
_ => return false,
},
"gcs" => slot.gcs = true,
_ => return false,
};
}
Expand Down
4 changes: 1 addition & 3 deletions library/core/src/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,7 @@ impl fmt::Debug for CStr {
impl Default for &CStr {
#[inline]
fn default() -> Self {
const SLICE: &[c_char] = &[0];
// SAFETY: `SLICE` is indeed pointing to a valid nul-terminated string.
unsafe { CStr::from_ptr(SLICE.as_ptr()) }
c""
}
}

Expand Down
Loading
Loading