Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b335056
Turn `Cow::is_borrowed,is_owned` into associated functions.
theemathas Mar 8, 2025
f0c98c2
Allocate vec capacity upfront in coroutine layout computation
yotamofek Oct 18, 2025
a67c615
Reduce rightward drift in `locals_live_across_suspend_points`
yotamofek Oct 18, 2025
11b82e1
rustdoc: Rename unstable option `--nocapture` to `--no-capture`
fmease Oct 25, 2025
857a187
rustdoc search: Include attribute and derive macros when filtering on…
GuillaumeGomez Oct 27, 2025
52c99e6
Add regression test for including derive macros in macro filtering
GuillaumeGomez Oct 27, 2025
6f3d0f7
Introduce qpath lang item utils
camsteffen Sep 1, 2025
7e51a76
Prefactor LangItem::QPath lowering functions
camsteffen Sep 1, 2025
e289f27
Remove QPath::LangItem from for loops
camsteffen Sep 1, 2025
eac2c25
Remove QPath::LangItem from format_args!
camsteffen Sep 1, 2025
9c98533
Remove QPath::LangItem from contracts
camsteffen Sep 1, 2025
7cbff63
Remove QPath::LangItem from ranges
camsteffen Aug 17, 2025
bd13c30
Remove QPath::LangItem from async
camsteffen Aug 17, 2025
a96e21b
Remove QPath::LangItem from try
camsteffen Sep 1, 2025
ead5e12
Remove QPath::LangItem
camsteffen Sep 1, 2025
bef018e
Mark yield spans with desugaring
camsteffen Sep 2, 2025
95732f4
Fix a bad hint
camsteffen Oct 27, 2025
a242c85
replace SanitizerSet in CodegenFnAttrs by new type
luca3s Jul 26, 2025
bd61985
Disable crt_static_allows_dylibs in redox targets
jackpot51 Oct 3, 2025
fa0f163
Add riscv64gc-unknown-redox
bjorn3 Oct 26, 2025
4d7c784
Handle default features and -Ctarget-features in the dummy backend
bjorn3 Oct 29, 2025
5dbccd2
add realtime sanitizer
luca3s May 23, 2025
06a8823
add warning for async
luca3s Aug 26, 2025
2e1fdb4
add docs
luca3s Jul 26, 2025
e0b8dd3
Simplify rustc_public context handling
celinval Oct 20, 2025
0a9570f
Rollup merge of #138217 - theemathas:cow_is_owned_borrowed_associated…
Zalathar Oct 30, 2025
dff167f
Rollup merge of #147858 - yotamofek:pr/mir/coroutine-layout-opt, r=cj…
Zalathar Oct 30, 2025
f825c95
Rollup merge of #147923 - celinval:rpub-remove-trait, r=oli-obk
Zalathar Oct 30, 2025
6f201c5
Rollup merge of #147935 - luca3s:add-rtsan, r=petrochenkov
Zalathar Oct 30, 2025
961f76f
Rollup merge of #148115 - fmease:rustdoc-no-capture, r=notriddle
Zalathar Oct 30, 2025
3056e47
Rollup merge of #148137 - bjorn3:redox_fixes, r=mati865
Zalathar Oct 30, 2025
8965a90
Rollup merge of #148176 - GuillaumeGomez:filter-macros, r=notriddle
Zalathar Oct 30, 2025
51df375
Rollup merge of #148193 - camsteffen:remove-qpath-langitem, r=cjgillot
Zalathar Oct 30, 2025
6e480c9
Rollup merge of #148253 - bjorn3:dummy_backend_target_features, r=Jon…
Zalathar Oct 30, 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
11 changes: 8 additions & 3 deletions compiler/rustc_ast_lowering/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::sync::Arc;

use thin_vec::thin_vec;

use crate::LoweringContext;
Expand Down Expand Up @@ -128,7 +130,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
let req_span = self.mark_span_with_reason(
rustc_span::DesugaringKind::Contract,
lowered_req.span,
None,
Some(Arc::clone(&self.allow_contracts)),
);
let precond = self.expr_call_lang_item_fn_mut(
req_span,
Expand All @@ -143,8 +145,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
ens: &Box<rustc_ast::Expr>,
) -> &'hir rustc_hir::Expr<'hir> {
let ens_span = self.lower_span(ens.span);
let ens_span =
self.mark_span_with_reason(rustc_span::DesugaringKind::Contract, ens_span, None);
let ens_span = self.mark_span_with_reason(
rustc_span::DesugaringKind::Contract,
ens_span,
Some(Arc::clone(&self.allow_contracts)),
);
let lowered_ens = self.lower_expr_mut(&ens);
self.expr_call_lang_item_fn(
ens_span,
Expand Down
28 changes: 13 additions & 15 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
};

let features = match await_kind {
FutureKind::Future if is_async_gen => Some(Arc::clone(&self.allow_async_gen)),
FutureKind::Future => None,
FutureKind::AsyncIterator => Some(Arc::clone(&self.allow_for_await)),
};
Expand Down Expand Up @@ -1479,7 +1480,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
fn lower_expr_range_closed(&mut self, span: Span, e1: &Expr, e2: &Expr) -> hir::ExprKind<'hir> {
let e1 = self.lower_expr_mut(e1);
let e2 = self.lower_expr_mut(e2);
let fn_path = hir::QPath::LangItem(hir::LangItem::RangeInclusiveNew, span);
let fn_path = self.make_lang_item_qpath(hir::LangItem::RangeInclusiveNew, span, None);
let fn_expr = self.arena.alloc(self.expr(span, hir::ExprKind::Path(fn_path)));
hir::ExprKind::Call(fn_expr, arena_vec![self; e1, e2])
}
Expand Down Expand Up @@ -1565,7 +1566,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
);

hir::ExprKind::Struct(
self.arena.alloc(hir::QPath::LangItem(lang_item, span)),
self.arena.alloc(self.make_lang_item_qpath(lang_item, span, None)),
fields,
hir::StructTailExpr::None,
)
Expand Down Expand Up @@ -1715,8 +1716,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
// `yield $expr` is transformed into `task_context = yield async_gen_ready($expr)`.
// This ensures that we store our resumed `ResumeContext` correctly, and also that
// the apparent value of the `yield` expression is `()`.
let wrapped_yielded = self.expr_call_lang_item_fn(
let desugar_span = self.mark_span_with_reason(
DesugaringKind::Async,
span,
Some(Arc::clone(&self.allow_async_gen)),
);
let wrapped_yielded = self.expr_call_lang_item_fn(
desugar_span,
hir::LangItem::AsyncGenReady,
std::slice::from_ref(yielded),
);
Expand All @@ -1728,7 +1734,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
unreachable!("use of `await` outside of an async context.");
};
let task_context_ident = Ident::with_dummy_span(sym::_task_context);
let lhs = self.expr_ident(span, task_context_ident, task_context_hid);
let lhs = self.expr_ident(desugar_span, task_context_ident, task_context_hid);

hir::ExprKind::Assign(lhs, yield_expr, self.lower_span(span))
} else {
Expand Down Expand Up @@ -2161,7 +2167,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
lang_item: hir::LangItem,
fields: &'hir [hir::Expr<'hir>],
) -> hir::Expr<'hir> {
let path = self.arena.alloc(self.lang_item_path(span, lang_item));
let path = self.arena.alloc(self.make_lang_item_qpath(lang_item, span, None));
self.expr_enum_variant(span, path, fields)
}

Expand Down Expand Up @@ -2198,16 +2204,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
span: Span,
lang_item: hir::LangItem,
) -> hir::Expr<'hir> {
let path = self.lang_item_path(span, lang_item);
self.expr(span, hir::ExprKind::Path(path))
}

pub(super) fn lang_item_path(
&mut self,
span: Span,
lang_item: hir::LangItem,
) -> hir::QPath<'hir> {
hir::QPath::LangItem(lang_item, self.lower_span(span))
let qpath = self.make_lang_item_qpath(lang_item, self.lower_span(span), None);
self.expr(span, hir::ExprKind::Path(qpath))
}

/// `<LangItem>::name`
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_ast_lowering/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,8 @@ fn make_format_spec<'hir>(
let flags = ctx.expr_field(Ident::new(sym::flags, sp), ctx.arena.alloc(flags), sp);
let precision = ctx.expr_field(Ident::new(sym::precision, sp), ctx.arena.alloc(precision), sp);
let width = ctx.expr_field(Ident::new(sym::width, sp), ctx.arena.alloc(width), sp);
let placeholder = ctx.arena.alloc(hir::QPath::LangItem(hir::LangItem::FormatPlaceholder, sp));
let placeholder =
ctx.arena.alloc(ctx.make_lang_item_qpath(hir::LangItem::FormatPlaceholder, sp, None));
let fields = ctx.arena.alloc_from_iter([position, flags, precision, width]);
ctx.expr(sp, hir::ExprKind::Struct(placeholder, fields, hir::StructTailExpr::None))
}
Expand Down
10 changes: 7 additions & 3 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ struct LoweringContext<'a, 'hir> {
#[cfg(debug_assertions)]
node_id_to_local_id: NodeMap<hir::ItemLocalId>,

allow_contracts: Arc<[Symbol]>,
allow_try_trait: Arc<[Symbol]>,
allow_gen_future: Arc<[Symbol]>,
allow_pattern_type: Arc<[Symbol]>,
allow_async_gen: Arc<[Symbol]>,
allow_async_iterator: Arc<[Symbol]>,
allow_for_await: Arc<[Symbol]>,
allow_async_fn_traits: Arc<[Symbol]>,
Expand Down Expand Up @@ -183,15 +185,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
current_item: None,
impl_trait_defs: Vec::new(),
impl_trait_bounds: Vec::new(),
allow_contracts: [sym::contracts_internals].into(),
allow_try_trait: [sym::try_trait_v2, sym::yeet_desugar_details].into(),
allow_pattern_type: [sym::pattern_types, sym::pattern_type_range_trait].into(),
allow_gen_future: if tcx.features().async_fn_track_caller() {
[sym::gen_future, sym::closure_track_caller].into()
} else {
[sym::gen_future].into()
},
allow_for_await: [sym::async_iterator].into(),
allow_for_await: [sym::async_gen_internals, sym::async_iterator].into(),
allow_async_fn_traits: [sym::async_fn_traits].into(),
allow_async_gen: [sym::async_gen_internals].into(),
// FIXME(gen_blocks): how does `closure_track_caller`/`async_fn_track_caller`
// interact with `gen`/`async gen` blocks
allow_async_iterator: [sym::gen_future, sym::async_iterator].into(),
Expand Down Expand Up @@ -2531,8 +2535,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
lang_item: hir::LangItem,
fields: &'hir [hir::PatField<'hir>],
) -> &'hir hir::Pat<'hir> {
let qpath = hir::QPath::LangItem(lang_item, self.lower_span(span));
self.pat(span, hir::PatKind::Struct(qpath, fields, None))
let path = self.make_lang_item_qpath(lang_item, self.lower_span(span), None);
self.pat(span, hir::PatKind::Struct(path, fields, None))
}

fn pat_ident(&mut self, span: Span, ident: Ident) -> (&'hir hir::Pat<'hir>, HirId) {
Expand Down
20 changes: 17 additions & 3 deletions compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use rustc_hir::attrs::{CoverageAttrKind, OptimizeAttr, SanitizerSet, UsedBy};
use rustc_hir::attrs::{CoverageAttrKind, OptimizeAttr, RtsanSetting, SanitizerSet, UsedBy};
use rustc_session::parse::feature_err;

use super::prelude::*;
Expand Down Expand Up @@ -592,7 +592,8 @@ impl<S: Stage> SingleAttributeParser<S> for SanitizeParser {
r#"memory = "on|off""#,
r#"memtag = "on|off""#,
r#"shadow_call_stack = "on|off""#,
r#"thread = "on|off""#
r#"thread = "on|off""#,
r#"realtime = "nonblocking|blocking|caller""#,
]);

const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepOutermost;
Expand All @@ -606,6 +607,7 @@ impl<S: Stage> SingleAttributeParser<S> for SanitizeParser {

let mut on_set = SanitizerSet::empty();
let mut off_set = SanitizerSet::empty();
let mut rtsan = None;

for item in list.mixed() {
let Some(item) = item.meta_item() else {
Expand Down Expand Up @@ -654,6 +656,17 @@ impl<S: Stage> SingleAttributeParser<S> for SanitizeParser {
Some(sym::shadow_call_stack) => apply(SanitizerSet::SHADOWCALLSTACK),
Some(sym::thread) => apply(SanitizerSet::THREAD),
Some(sym::hwaddress) => apply(SanitizerSet::HWADDRESS),
Some(sym::realtime) => match value.value_as_str() {
Some(sym::nonblocking) => rtsan = Some(RtsanSetting::Nonblocking),
Some(sym::blocking) => rtsan = Some(RtsanSetting::Blocking),
Some(sym::caller) => rtsan = Some(RtsanSetting::Caller),
_ => {
cx.expected_specific_argument_strings(
value.value_span,
&[sym::nonblocking, sym::blocking, sym::caller],
);
}
},
_ => {
cx.expected_specific_argument_strings(
item.path().span(),
Expand All @@ -666,13 +679,14 @@ impl<S: Stage> SingleAttributeParser<S> for SanitizeParser {
sym::shadow_call_stack,
sym::thread,
sym::hwaddress,
sym::realtime,
],
);
continue;
}
}
}

Some(AttributeKind::Sanitize { on_set, off_set, span: cx.attr_span })
Some(AttributeKind::Sanitize { on_set, off_set, rtsan, span: cx.attr_span })
}
}
21 changes: 12 additions & 9 deletions compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,8 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
}
if let hir::Node::Expr(parent_expr) = parent
&& let hir::ExprKind::Call(call_expr, _) = parent_expr.kind
&& let hir::ExprKind::Path(hir::QPath::LangItem(LangItem::IntoIterIntoIter, _)) =
call_expr.kind
&& let hir::ExprKind::Path(qpath) = call_expr.kind
&& tcx.qpath_is_lang_item(qpath, LangItem::IntoIterIntoIter)
{
// Do not suggest `.clone()` in a `for` loop, we already suggest borrowing.
} else if let UseSpans::FnSelfUse { kind: CallKind::Normal { .. }, .. } = move_spans
Expand Down Expand Up @@ -2312,6 +2312,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
let typeck_results = tcx.typeck(self.mir_def_id());

struct ExprFinder<'hir> {
tcx: TyCtxt<'hir>,
issue_span: Span,
expr_span: Span,
body_expr: Option<&'hir hir::Expr<'hir>>,
Expand All @@ -2336,9 +2337,10 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
// };
// corresponding to the desugaring of a for loop `for <pat> in <head> { <body> }`.
if let hir::ExprKind::Call(path, [arg]) = ex.kind
&& let hir::ExprKind::Path(hir::QPath::LangItem(LangItem::IntoIterIntoIter, _)) =
path.kind
&& let hir::ExprKind::Path(qpath) = path.kind
&& self.tcx.qpath_is_lang_item(qpath, LangItem::IntoIterIntoIter)
&& arg.span.contains(self.issue_span)
&& ex.span.desugaring_kind() == Some(DesugaringKind::ForLoop)
{
// Find `IntoIterator::into_iter(<head>)`
self.head = Some(arg);
Expand All @@ -2355,10 +2357,10 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
..
}) = stmt.kind
&& let hir::ExprKind::Call(path, _args) = call.kind
&& let hir::ExprKind::Path(hir::QPath::LangItem(LangItem::IteratorNext, _)) =
path.kind
&& let hir::PatKind::Struct(path, [field, ..], _) = bind.pat.kind
&& let hir::QPath::LangItem(LangItem::OptionSome, pat_span) = path
&& let hir::ExprKind::Path(qpath) = path.kind
&& self.tcx.qpath_is_lang_item(qpath, LangItem::IteratorNext)
&& let hir::PatKind::Struct(qpath, [field, ..], _) = bind.pat.kind
&& self.tcx.qpath_is_lang_item(qpath, LangItem::OptionSome)
&& call.span.contains(self.issue_span)
{
// Find `<pat>` and the span for the whole `for` loop.
Expand All @@ -2370,7 +2372,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
self.loop_bind = Some(ident);
}
self.head_span = Some(*head_span);
self.pat_span = Some(pat_span);
self.pat_span = Some(bind.pat.span);
self.loop_span = Some(stmt.span);
}

Expand All @@ -2385,6 +2387,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
}
}
let mut finder = ExprFinder {
tcx,
expr_span: span,
issue_span,
loop_bind: None,
Expand Down
22 changes: 17 additions & 5 deletions compiler/rustc_codegen_llvm/src/attributes.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Set and unset common attributes on LLVM values.
use rustc_hir::attrs::{InlineAttr, InstructionSetAttr, OptimizeAttr};
use rustc_hir::attrs::{InlineAttr, InstructionSetAttr, OptimizeAttr, RtsanSetting};
use rustc_hir::def_id::DefId;
use rustc_middle::middle::codegen_fn_attrs::{
CodegenFnAttrFlags, CodegenFnAttrs, PatchableFunctionEntry,
CodegenFnAttrFlags, CodegenFnAttrs, PatchableFunctionEntry, SanitizerFnAttrs,
};
use rustc_middle::ty::{self, TyCtxt};
use rustc_session::config::{BranchProtection, FunctionReturn, OptLevel, PAuthKey, PacRet};
Expand Down Expand Up @@ -98,10 +98,10 @@ fn patchable_function_entry_attrs<'ll>(
pub(crate) fn sanitize_attrs<'ll, 'tcx>(
cx: &SimpleCx<'ll>,
tcx: TyCtxt<'tcx>,
no_sanitize: SanitizerSet,
sanitizer_fn_attr: SanitizerFnAttrs,
) -> SmallVec<[&'ll Attribute; 4]> {
let mut attrs = SmallVec::new();
let enabled = tcx.sess.opts.unstable_opts.sanitizer - no_sanitize;
let enabled = tcx.sess.opts.unstable_opts.sanitizer - sanitizer_fn_attr.disabled;
if enabled.contains(SanitizerSet::ADDRESS) || enabled.contains(SanitizerSet::KERNELADDRESS) {
attrs.push(llvm::AttributeKind::SanitizeAddress.create_attr(cx.llcx));
}
Expand Down Expand Up @@ -131,6 +131,18 @@ pub(crate) fn sanitize_attrs<'ll, 'tcx>(
if enabled.contains(SanitizerSet::SAFESTACK) {
attrs.push(llvm::AttributeKind::SanitizeSafeStack.create_attr(cx.llcx));
}
if tcx.sess.opts.unstable_opts.sanitizer.contains(SanitizerSet::REALTIME) {
match sanitizer_fn_attr.rtsan_setting {
RtsanSetting::Nonblocking => {
attrs.push(llvm::AttributeKind::SanitizeRealtimeNonblocking.create_attr(cx.llcx))
}
RtsanSetting::Blocking => {
attrs.push(llvm::AttributeKind::SanitizeRealtimeBlocking.create_attr(cx.llcx))
}
// caller is the default, so no llvm attribute
RtsanSetting::Caller => (),
}
}
attrs
}

Expand Down Expand Up @@ -417,7 +429,7 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
// not used.
} else {
// Do not set sanitizer attributes for naked functions.
to_add.extend(sanitize_attrs(cx, tcx, codegen_fn_attrs.no_sanitize));
to_add.extend(sanitize_attrs(cx, tcx, codegen_fn_attrs.sanitizers));

// For non-naked functions, set branch protection attributes on aarch64.
if let Some(BranchProtection { bti, pac_ret, gcs }) =
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ pub(crate) unsafe fn llvm_optimize(
sanitize_memory: config.sanitizer.contains(SanitizerSet::MEMORY),
sanitize_memory_recover: config.sanitizer_recover.contains(SanitizerSet::MEMORY),
sanitize_memory_track_origins: config.sanitizer_memory_track_origins as c_int,
sanitize_realtime: config.sanitizer.contains(SanitizerSet::REALTIME),
sanitize_thread: config.sanitizer.contains(SanitizerSet::THREAD),
sanitize_hwaddress: config.sanitizer.contains(SanitizerSet::HWADDRESS),
sanitize_hwaddress_recover: config.sanitizer_recover.contains(SanitizerSet::HWADDRESS),
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_llvm/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use rustc_codegen_ssa::traits::*;
use rustc_data_structures::small_c_str::SmallCStr;
use rustc_hir::attrs::Linkage;
use rustc_middle::dep_graph;
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrs, SanitizerFnAttrs};
use rustc_middle::mir::mono::Visibility;
use rustc_middle::ty::TyCtxt;
use rustc_session::config::DebugInfo;
Expand Down Expand Up @@ -105,7 +105,7 @@ pub(crate) fn compile_codegen_unit(
if let Some(entry) =
maybe_create_entry_wrapper::<Builder<'_, '_, '_>>(&cx, cx.codegen_unit)
{
let attrs = attributes::sanitize_attrs(&cx, tcx, SanitizerSet::empty());
let attrs = attributes::sanitize_attrs(&cx, tcx, SanitizerFnAttrs::default());
attributes::apply_to_llfn(entry, llvm::AttributePlace::Function, &attrs);
}

Expand Down Expand Up @@ -191,10 +191,10 @@ pub(crate) fn visibility_to_llvm(linkage: Visibility) -> llvm::Visibility {
}

pub(crate) fn set_variable_sanitizer_attrs(llval: &Value, attrs: &CodegenFnAttrs) {
if attrs.no_sanitize.contains(SanitizerSet::ADDRESS) {
if attrs.sanitizers.disabled.contains(SanitizerSet::ADDRESS) {
unsafe { llvm::LLVMRustSetNoSanitizeAddress(llval) };
}
if attrs.no_sanitize.contains(SanitizerSet::HWADDRESS) {
if attrs.sanitizers.disabled.contains(SanitizerSet::HWADDRESS) {
unsafe { llvm::LLVMRustSetNoSanitizeHWAddress(llval) };
}
}
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,7 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
&& is_indirect_call
{
if let Some(fn_attrs) = fn_attrs
&& fn_attrs.no_sanitize.contains(SanitizerSet::CFI)
&& fn_attrs.sanitizers.disabled.contains(SanitizerSet::CFI)
{
return;
}
Expand Down Expand Up @@ -1861,7 +1861,7 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
&& is_indirect_call
{
if let Some(fn_attrs) = fn_attrs
&& fn_attrs.no_sanitize.contains(SanitizerSet::KCFI)
&& fn_attrs.sanitizers.disabled.contains(SanitizerSet::KCFI)
{
return None;
}
Expand Down
Loading
Loading