Skip to content

Commit e810181

Browse files
committed
Auto merge of #148276 - Zalathar:rollup-nlppif2, r=Zalathar
Rollup of 9 pull requests Successful merges: - #138217 (Turn `Cow::is_borrowed,is_owned` into associated functions.) - #147858 (Micro-optimization attempt in coroutine layout computation) - #147923 (Simplify rustc_public context handling) - #147935 (Add LLVM realtime sanitizer) - #148115 (rustdoc: Rename unstable option `--nocapture` to `--no-capture` in accordance with `libtest`) - #148137 (Couple of changes for Redox OS) - #148176 ([rustdoc] Include attribute and derive macros when filtering on "macros") - #148193 (Remove `QPath::LangItem`) - #148253 (Handle default features and -Ctarget-features in the dummy backend) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 292be5c + 6e480c9 commit e810181

File tree

148 files changed

+1084
-1031
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+1084
-1031
lines changed

compiler/rustc_ast_lowering/src/contract.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::sync::Arc;
2+
13
use thin_vec::thin_vec;
24

35
use crate::LoweringContext;
@@ -128,7 +130,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
128130
let req_span = self.mark_span_with_reason(
129131
rustc_span::DesugaringKind::Contract,
130132
lowered_req.span,
131-
None,
133+
Some(Arc::clone(&self.allow_contracts)),
132134
);
133135
let precond = self.expr_call_lang_item_fn_mut(
134136
req_span,
@@ -143,8 +145,11 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
143145
ens: &Box<rustc_ast::Expr>,
144146
) -> &'hir rustc_hir::Expr<'hir> {
145147
let ens_span = self.lower_span(ens.span);
146-
let ens_span =
147-
self.mark_span_with_reason(rustc_span::DesugaringKind::Contract, ens_span, None);
148+
let ens_span = self.mark_span_with_reason(
149+
rustc_span::DesugaringKind::Contract,
150+
ens_span,
151+
Some(Arc::clone(&self.allow_contracts)),
152+
);
148153
let lowered_ens = self.lower_expr_mut(&ens);
149154
self.expr_call_lang_item_fn(
150155
ens_span,

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
865865
};
866866

867867
let features = match await_kind {
868+
FutureKind::Future if is_async_gen => Some(Arc::clone(&self.allow_async_gen)),
868869
FutureKind::Future => None,
869870
FutureKind::AsyncIterator => Some(Arc::clone(&self.allow_for_await)),
870871
};
@@ -1479,7 +1480,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
14791480
fn lower_expr_range_closed(&mut self, span: Span, e1: &Expr, e2: &Expr) -> hir::ExprKind<'hir> {
14801481
let e1 = self.lower_expr_mut(e1);
14811482
let e2 = self.lower_expr_mut(e2);
1482-
let fn_path = hir::QPath::LangItem(hir::LangItem::RangeInclusiveNew, span);
1483+
let fn_path = self.make_lang_item_qpath(hir::LangItem::RangeInclusiveNew, span, None);
14831484
let fn_expr = self.arena.alloc(self.expr(span, hir::ExprKind::Path(fn_path)));
14841485
hir::ExprKind::Call(fn_expr, arena_vec![self; e1, e2])
14851486
}
@@ -1565,7 +1566,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
15651566
);
15661567

15671568
hir::ExprKind::Struct(
1568-
self.arena.alloc(hir::QPath::LangItem(lang_item, span)),
1569+
self.arena.alloc(self.make_lang_item_qpath(lang_item, span, None)),
15691570
fields,
15701571
hir::StructTailExpr::None,
15711572
)
@@ -1715,8 +1716,13 @@ impl<'hir> LoweringContext<'_, 'hir> {
17151716
// `yield $expr` is transformed into `task_context = yield async_gen_ready($expr)`.
17161717
// This ensures that we store our resumed `ResumeContext` correctly, and also that
17171718
// the apparent value of the `yield` expression is `()`.
1718-
let wrapped_yielded = self.expr_call_lang_item_fn(
1719+
let desugar_span = self.mark_span_with_reason(
1720+
DesugaringKind::Async,
17191721
span,
1722+
Some(Arc::clone(&self.allow_async_gen)),
1723+
);
1724+
let wrapped_yielded = self.expr_call_lang_item_fn(
1725+
desugar_span,
17201726
hir::LangItem::AsyncGenReady,
17211727
std::slice::from_ref(yielded),
17221728
);
@@ -1728,7 +1734,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
17281734
unreachable!("use of `await` outside of an async context.");
17291735
};
17301736
let task_context_ident = Ident::with_dummy_span(sym::_task_context);
1731-
let lhs = self.expr_ident(span, task_context_ident, task_context_hid);
1737+
let lhs = self.expr_ident(desugar_span, task_context_ident, task_context_hid);
17321738

17331739
hir::ExprKind::Assign(lhs, yield_expr, self.lower_span(span))
17341740
} else {
@@ -2161,7 +2167,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
21612167
lang_item: hir::LangItem,
21622168
fields: &'hir [hir::Expr<'hir>],
21632169
) -> hir::Expr<'hir> {
2164-
let path = self.arena.alloc(self.lang_item_path(span, lang_item));
2170+
let path = self.arena.alloc(self.make_lang_item_qpath(lang_item, span, None));
21652171
self.expr_enum_variant(span, path, fields)
21662172
}
21672173

@@ -2198,16 +2204,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
21982204
span: Span,
21992205
lang_item: hir::LangItem,
22002206
) -> hir::Expr<'hir> {
2201-
let path = self.lang_item_path(span, lang_item);
2202-
self.expr(span, hir::ExprKind::Path(path))
2203-
}
2204-
2205-
pub(super) fn lang_item_path(
2206-
&mut self,
2207-
span: Span,
2208-
lang_item: hir::LangItem,
2209-
) -> hir::QPath<'hir> {
2210-
hir::QPath::LangItem(lang_item, self.lower_span(span))
2207+
let qpath = self.make_lang_item_qpath(lang_item, self.lower_span(span), None);
2208+
self.expr(span, hir::ExprKind::Path(qpath))
22112209
}
22122210

22132211
/// `<LangItem>::name`

compiler/rustc_ast_lowering/src/format.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ fn make_format_spec<'hir>(
391391
let flags = ctx.expr_field(Ident::new(sym::flags, sp), ctx.arena.alloc(flags), sp);
392392
let precision = ctx.expr_field(Ident::new(sym::precision, sp), ctx.arena.alloc(precision), sp);
393393
let width = ctx.expr_field(Ident::new(sym::width, sp), ctx.arena.alloc(width), sp);
394-
let placeholder = ctx.arena.alloc(hir::QPath::LangItem(hir::LangItem::FormatPlaceholder, sp));
394+
let placeholder =
395+
ctx.arena.alloc(ctx.make_lang_item_qpath(hir::LangItem::FormatPlaceholder, sp, None));
395396
let fields = ctx.arena.alloc_from_iter([position, flags, precision, width]);
396397
ctx.expr(sp, hir::ExprKind::Struct(placeholder, fields, hir::StructTailExpr::None))
397398
}

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,11 @@ struct LoweringContext<'a, 'hir> {
138138
#[cfg(debug_assertions)]
139139
node_id_to_local_id: NodeMap<hir::ItemLocalId>,
140140

141+
allow_contracts: Arc<[Symbol]>,
141142
allow_try_trait: Arc<[Symbol]>,
142143
allow_gen_future: Arc<[Symbol]>,
143144
allow_pattern_type: Arc<[Symbol]>,
145+
allow_async_gen: Arc<[Symbol]>,
144146
allow_async_iterator: Arc<[Symbol]>,
145147
allow_for_await: Arc<[Symbol]>,
146148
allow_async_fn_traits: Arc<[Symbol]>,
@@ -183,15 +185,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
183185
current_item: None,
184186
impl_trait_defs: Vec::new(),
185187
impl_trait_bounds: Vec::new(),
188+
allow_contracts: [sym::contracts_internals].into(),
186189
allow_try_trait: [sym::try_trait_v2, sym::yeet_desugar_details].into(),
187190
allow_pattern_type: [sym::pattern_types, sym::pattern_type_range_trait].into(),
188191
allow_gen_future: if tcx.features().async_fn_track_caller() {
189192
[sym::gen_future, sym::closure_track_caller].into()
190193
} else {
191194
[sym::gen_future].into()
192195
},
193-
allow_for_await: [sym::async_iterator].into(),
196+
allow_for_await: [sym::async_gen_internals, sym::async_iterator].into(),
194197
allow_async_fn_traits: [sym::async_fn_traits].into(),
198+
allow_async_gen: [sym::async_gen_internals].into(),
195199
// FIXME(gen_blocks): how does `closure_track_caller`/`async_fn_track_caller`
196200
// interact with `gen`/`async gen` blocks
197201
allow_async_iterator: [sym::gen_future, sym::async_iterator].into(),
@@ -2531,8 +2535,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
25312535
lang_item: hir::LangItem,
25322536
fields: &'hir [hir::PatField<'hir>],
25332537
) -> &'hir hir::Pat<'hir> {
2534-
let qpath = hir::QPath::LangItem(lang_item, self.lower_span(span));
2535-
self.pat(span, hir::PatKind::Struct(qpath, fields, None))
2538+
let path = self.make_lang_item_qpath(lang_item, self.lower_span(span), None);
2539+
self.pat(span, hir::PatKind::Struct(path, fields, None))
25362540
}
25372541

25382542
fn pat_ident(&mut self, span: Span, ident: Ident) -> (&'hir hir::Pat<'hir>, HirId) {

compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use rustc_hir::attrs::{CoverageAttrKind, OptimizeAttr, SanitizerSet, UsedBy};
1+
use rustc_hir::attrs::{CoverageAttrKind, OptimizeAttr, RtsanSetting, SanitizerSet, UsedBy};
22
use rustc_session::parse::feature_err;
33

44
use super::prelude::*;
@@ -592,7 +592,8 @@ impl<S: Stage> SingleAttributeParser<S> for SanitizeParser {
592592
r#"memory = "on|off""#,
593593
r#"memtag = "on|off""#,
594594
r#"shadow_call_stack = "on|off""#,
595-
r#"thread = "on|off""#
595+
r#"thread = "on|off""#,
596+
r#"realtime = "nonblocking|blocking|caller""#,
596597
]);
597598

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

607608
let mut on_set = SanitizerSet::empty();
608609
let mut off_set = SanitizerSet::empty();
610+
let mut rtsan = None;
609611

610612
for item in list.mixed() {
611613
let Some(item) = item.meta_item() else {
@@ -654,6 +656,17 @@ impl<S: Stage> SingleAttributeParser<S> for SanitizeParser {
654656
Some(sym::shadow_call_stack) => apply(SanitizerSet::SHADOWCALLSTACK),
655657
Some(sym::thread) => apply(SanitizerSet::THREAD),
656658
Some(sym::hwaddress) => apply(SanitizerSet::HWADDRESS),
659+
Some(sym::realtime) => match value.value_as_str() {
660+
Some(sym::nonblocking) => rtsan = Some(RtsanSetting::Nonblocking),
661+
Some(sym::blocking) => rtsan = Some(RtsanSetting::Blocking),
662+
Some(sym::caller) => rtsan = Some(RtsanSetting::Caller),
663+
_ => {
664+
cx.expected_specific_argument_strings(
665+
value.value_span,
666+
&[sym::nonblocking, sym::blocking, sym::caller],
667+
);
668+
}
669+
},
657670
_ => {
658671
cx.expected_specific_argument_strings(
659672
item.path().span(),
@@ -666,13 +679,14 @@ impl<S: Stage> SingleAttributeParser<S> for SanitizeParser {
666679
sym::shadow_call_stack,
667680
sym::thread,
668681
sym::hwaddress,
682+
sym::realtime,
669683
],
670684
);
671685
continue;
672686
}
673687
}
674688
}
675689

676-
Some(AttributeKind::Sanitize { on_set, off_set, span: cx.attr_span })
690+
Some(AttributeKind::Sanitize { on_set, off_set, rtsan, span: cx.attr_span })
677691
}
678692
}

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
503503
}
504504
if let hir::Node::Expr(parent_expr) = parent
505505
&& let hir::ExprKind::Call(call_expr, _) = parent_expr.kind
506-
&& let hir::ExprKind::Path(hir::QPath::LangItem(LangItem::IntoIterIntoIter, _)) =
507-
call_expr.kind
506+
&& let hir::ExprKind::Path(qpath) = call_expr.kind
507+
&& tcx.qpath_is_lang_item(qpath, LangItem::IntoIterIntoIter)
508508
{
509509
// Do not suggest `.clone()` in a `for` loop, we already suggest borrowing.
510510
} else if let UseSpans::FnSelfUse { kind: CallKind::Normal { .. }, .. } = move_spans
@@ -2312,6 +2312,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
23122312
let typeck_results = tcx.typeck(self.mir_def_id());
23132313

23142314
struct ExprFinder<'hir> {
2315+
tcx: TyCtxt<'hir>,
23152316
issue_span: Span,
23162317
expr_span: Span,
23172318
body_expr: Option<&'hir hir::Expr<'hir>>,
@@ -2336,9 +2337,10 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
23362337
// };
23372338
// corresponding to the desugaring of a for loop `for <pat> in <head> { <body> }`.
23382339
if let hir::ExprKind::Call(path, [arg]) = ex.kind
2339-
&& let hir::ExprKind::Path(hir::QPath::LangItem(LangItem::IntoIterIntoIter, _)) =
2340-
path.kind
2340+
&& let hir::ExprKind::Path(qpath) = path.kind
2341+
&& self.tcx.qpath_is_lang_item(qpath, LangItem::IntoIterIntoIter)
23412342
&& arg.span.contains(self.issue_span)
2343+
&& ex.span.desugaring_kind() == Some(DesugaringKind::ForLoop)
23422344
{
23432345
// Find `IntoIterator::into_iter(<head>)`
23442346
self.head = Some(arg);
@@ -2355,10 +2357,10 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
23552357
..
23562358
}) = stmt.kind
23572359
&& let hir::ExprKind::Call(path, _args) = call.kind
2358-
&& let hir::ExprKind::Path(hir::QPath::LangItem(LangItem::IteratorNext, _)) =
2359-
path.kind
2360-
&& let hir::PatKind::Struct(path, [field, ..], _) = bind.pat.kind
2361-
&& let hir::QPath::LangItem(LangItem::OptionSome, pat_span) = path
2360+
&& let hir::ExprKind::Path(qpath) = path.kind
2361+
&& self.tcx.qpath_is_lang_item(qpath, LangItem::IteratorNext)
2362+
&& let hir::PatKind::Struct(qpath, [field, ..], _) = bind.pat.kind
2363+
&& self.tcx.qpath_is_lang_item(qpath, LangItem::OptionSome)
23622364
&& call.span.contains(self.issue_span)
23632365
{
23642366
// Find `<pat>` and the span for the whole `for` loop.
@@ -2370,7 +2372,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
23702372
self.loop_bind = Some(ident);
23712373
}
23722374
self.head_span = Some(*head_span);
2373-
self.pat_span = Some(pat_span);
2375+
self.pat_span = Some(bind.pat.span);
23742376
self.loop_span = Some(stmt.span);
23752377
}
23762378

@@ -2385,6 +2387,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
23852387
}
23862388
}
23872389
let mut finder = ExprFinder {
2390+
tcx,
23882391
expr_span: span,
23892392
issue_span,
23902393
loop_bind: None,

compiler/rustc_codegen_llvm/src/attributes.rs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//! Set and unset common attributes on LLVM values.
2-
use rustc_hir::attrs::{InlineAttr, InstructionSetAttr, OptimizeAttr};
2+
use rustc_hir::attrs::{InlineAttr, InstructionSetAttr, OptimizeAttr, RtsanSetting};
33
use rustc_hir::def_id::DefId;
44
use rustc_middle::middle::codegen_fn_attrs::{
5-
CodegenFnAttrFlags, CodegenFnAttrs, PatchableFunctionEntry,
5+
CodegenFnAttrFlags, CodegenFnAttrs, PatchableFunctionEntry, SanitizerFnAttrs,
66
};
77
use rustc_middle::ty::{self, TyCtxt};
88
use rustc_session::config::{BranchProtection, FunctionReturn, OptLevel, PAuthKey, PacRet};
@@ -98,10 +98,10 @@ fn patchable_function_entry_attrs<'ll>(
9898
pub(crate) fn sanitize_attrs<'ll, 'tcx>(
9999
cx: &SimpleCx<'ll>,
100100
tcx: TyCtxt<'tcx>,
101-
no_sanitize: SanitizerSet,
101+
sanitizer_fn_attr: SanitizerFnAttrs,
102102
) -> SmallVec<[&'ll Attribute; 4]> {
103103
let mut attrs = SmallVec::new();
104-
let enabled = tcx.sess.opts.unstable_opts.sanitizer - no_sanitize;
104+
let enabled = tcx.sess.opts.unstable_opts.sanitizer - sanitizer_fn_attr.disabled;
105105
if enabled.contains(SanitizerSet::ADDRESS) || enabled.contains(SanitizerSet::KERNELADDRESS) {
106106
attrs.push(llvm::AttributeKind::SanitizeAddress.create_attr(cx.llcx));
107107
}
@@ -131,6 +131,18 @@ pub(crate) fn sanitize_attrs<'ll, 'tcx>(
131131
if enabled.contains(SanitizerSet::SAFESTACK) {
132132
attrs.push(llvm::AttributeKind::SanitizeSafeStack.create_attr(cx.llcx));
133133
}
134+
if tcx.sess.opts.unstable_opts.sanitizer.contains(SanitizerSet::REALTIME) {
135+
match sanitizer_fn_attr.rtsan_setting {
136+
RtsanSetting::Nonblocking => {
137+
attrs.push(llvm::AttributeKind::SanitizeRealtimeNonblocking.create_attr(cx.llcx))
138+
}
139+
RtsanSetting::Blocking => {
140+
attrs.push(llvm::AttributeKind::SanitizeRealtimeBlocking.create_attr(cx.llcx))
141+
}
142+
// caller is the default, so no llvm attribute
143+
RtsanSetting::Caller => (),
144+
}
145+
}
134146
attrs
135147
}
136148

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

422434
// For non-naked functions, set branch protection attributes on aarch64.
423435
if let Some(BranchProtection { bti, pac_ret, gcs }) =

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ pub(crate) unsafe fn llvm_optimize(
630630
sanitize_memory: config.sanitizer.contains(SanitizerSet::MEMORY),
631631
sanitize_memory_recover: config.sanitizer_recover.contains(SanitizerSet::MEMORY),
632632
sanitize_memory_track_origins: config.sanitizer_memory_track_origins as c_int,
633+
sanitize_realtime: config.sanitizer.contains(SanitizerSet::REALTIME),
633634
sanitize_thread: config.sanitizer.contains(SanitizerSet::THREAD),
634635
sanitize_hwaddress: config.sanitizer.contains(SanitizerSet::HWADDRESS),
635636
sanitize_hwaddress_recover: config.sanitizer_recover.contains(SanitizerSet::HWADDRESS),

compiler/rustc_codegen_llvm/src/base.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rustc_codegen_ssa::traits::*;
2020
use rustc_data_structures::small_c_str::SmallCStr;
2121
use rustc_hir::attrs::Linkage;
2222
use rustc_middle::dep_graph;
23-
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
23+
use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrs, SanitizerFnAttrs};
2424
use rustc_middle::mir::mono::Visibility;
2525
use rustc_middle::ty::TyCtxt;
2626
use rustc_session::config::DebugInfo;
@@ -105,7 +105,7 @@ pub(crate) fn compile_codegen_unit(
105105
if let Some(entry) =
106106
maybe_create_entry_wrapper::<Builder<'_, '_, '_>>(&cx, cx.codegen_unit)
107107
{
108-
let attrs = attributes::sanitize_attrs(&cx, tcx, SanitizerSet::empty());
108+
let attrs = attributes::sanitize_attrs(&cx, tcx, SanitizerFnAttrs::default());
109109
attributes::apply_to_llfn(entry, llvm::AttributePlace::Function, &attrs);
110110
}
111111

@@ -191,10 +191,10 @@ pub(crate) fn visibility_to_llvm(linkage: Visibility) -> llvm::Visibility {
191191
}
192192

193193
pub(crate) fn set_variable_sanitizer_attrs(llval: &Value, attrs: &CodegenFnAttrs) {
194-
if attrs.no_sanitize.contains(SanitizerSet::ADDRESS) {
194+
if attrs.sanitizers.disabled.contains(SanitizerSet::ADDRESS) {
195195
unsafe { llvm::LLVMRustSetNoSanitizeAddress(llval) };
196196
}
197-
if attrs.no_sanitize.contains(SanitizerSet::HWADDRESS) {
197+
if attrs.sanitizers.disabled.contains(SanitizerSet::HWADDRESS) {
198198
unsafe { llvm::LLVMRustSetNoSanitizeHWAddress(llval) };
199199
}
200200
}

compiler/rustc_codegen_llvm/src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
18031803
&& is_indirect_call
18041804
{
18051805
if let Some(fn_attrs) = fn_attrs
1806-
&& fn_attrs.no_sanitize.contains(SanitizerSet::CFI)
1806+
&& fn_attrs.sanitizers.disabled.contains(SanitizerSet::CFI)
18071807
{
18081808
return;
18091809
}
@@ -1861,7 +1861,7 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
18611861
&& is_indirect_call
18621862
{
18631863
if let Some(fn_attrs) = fn_attrs
1864-
&& fn_attrs.no_sanitize.contains(SanitizerSet::KCFI)
1864+
&& fn_attrs.sanitizers.disabled.contains(SanitizerSet::KCFI)
18651865
{
18661866
return None;
18671867
}

0 commit comments

Comments
 (0)