Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b9a8c80
Add regression test for impossible dyn Sized predicate
qaijuang May 15, 2026
2df8f1f
Consider structurally impossible Sized predicates
qaijuang May 15, 2026
f86ad47
isolate regression test
qaijuang Jun 9, 2026
fcb4680
split out suggestion generation for type hints into a separate function
WaffleLapkin Jun 26, 2026
7517333
merge `SourceKindSubdiag` and `SourceKindMultiSuggestion`
WaffleLapkin Jul 3, 2026
299a71d
resolve: fix effective visibilities for items in ambiguous glob sets
calvinrp Jul 9, 2026
8fb83ab
place FnDef behind a binder, instantiate w/ Dummy
Jun 17, 2026
159b9a0
Fix stale test comment: the dead_code half is pinned by the sibling -…
calvinrp Jul 10, 2026
b994cba
doc: clarify attr parser APIs
kn1g78 Jul 11, 2026
e9273fc
Support `#[track_caller]` on EII declarations
cezarbbb Jun 29, 2026
b9b9d41
Update compiler to rustc-demangle 1.2.8
teor2345 Jul 13, 2026
f802a87
Update library to rustc-demangle 1.2.8
teor2345 Jul 13, 2026
82f4112
Update tools to rustc-demangle 1.2.8
teor2345 Jul 13, 2026
834dc80
Pointer authentication config and user facing options
jchlanda May 7, 2026
54069f8
Extend version support with C++ specifics
jchlanda May 20, 2026
c57d0b6
Document -Zpointer-authentication option
jchlanda May 21, 2026
7e15238
Convert `-Zpointer-authentication` to target modifier
jchlanda Jul 3, 2026
2e978ac
don't allow todo!() macro in tidy
jdonszelmann Jun 10, 2026
91311ae
Fixup all current uses of `todo!()` in the compiler
jdonszelmann Jun 10, 2026
d8eb2f5
Fixup all current uses of `todo!()` in std
jdonszelmann Jun 10, 2026
44fc3c6
Fixup all current uses of `todo!()` in rustdoc
jdonszelmann Jun 10, 2026
e8ead57
implement tidy ignores for a single line
jdonszelmann Jun 12, 2026
f4a50a6
show line numbers for unnecessary ignores
jdonszelmann Jun 29, 2026
0e47821
Better way to check bad directives
jdonszelmann Jun 30, 2026
d27b4d6
fix match_ignore check
jdonszelmann Jun 30, 2026
8581e88
make odd_backticks apply to the next blockcomment instead of just line
jdonszelmann Jun 30, 2026
e0f9f8c
introduce a test entrypoint marker for tools
jdonszelmann Jun 18, 2026
25745ee
fix all tidy annotations
jdonszelmann Jun 30, 2026
bdc1397
bless tests
jdonszelmann Jul 2, 2026
4a92ee0
add `NamedDirective` to keep track of error messages per-directive
jdonszelmann Jul 7, 2026
8c0439d
add tidy self tests for style
jdonszelmann Jul 7, 2026
0b76cd3
add ignore-tidy-all
jdonszelmann Jul 7, 2026
6f522b4
fix alphabetical
jdonszelmann Jul 7, 2026
ea03e5c
some more review feedback (don't want to squash, history is messed up…
jdonszelmann Jul 7, 2026
01f0ad1
add regression test for impossible dyn Sized predicate
TaKO8Ki Jul 13, 2026
bd4d8f6
simplify ast validation struct visiting
oli-obk May 13, 2026
5d41744
consider structurally impossible Sized predicates in MIR
TaKO8Ki Jul 13, 2026
d873077
add test
jdonszelmann Jul 6, 2026
843639b
bless existing tests
jdonszelmann Jul 6, 2026
74208da
Combine `sourceKindSubdiag::Generic*` into one variant
WaffleLapkin Jul 4, 2026
50d233d
need type info: only allow 0-1 subdiagnostic
WaffleLapkin Jul 4, 2026
979a7e4
move `TypeErrCtxt::suggesion` to `InferSourceKind`
WaffleLapkin Jul 4, 2026
4706067
decouple `InferSourceKind::suggesion` from `TypeErrCtxt`
WaffleLapkin Jul 4, 2026
9192337
semicolon_in_expressions_from_macros: Lint on non-local macros too
joshtriplett Jul 13, 2026
a991824
remove `#![allow(incomplete_features)]`
TaKO8Ki Jul 13, 2026
03afa49
Use shorter borrows for `FnKind`
oli-obk Apr 21, 2026
b5f1c7a
Rollup merge of #159039 - calvinrp:fix/effective-vis-glob-ambiguity, …
JonathanBrouwer Jul 13, 2026
b361539
Rollup merge of #157706 - jdonszelmann:deny-todo, r=wafflelapkin
JonathanBrouwer Jul 13, 2026
b7e7720
Rollup merge of #156712 - jchlanda:jakub/pac_config, r=davidtwco
JonathanBrouwer Jul 13, 2026
898ef43
Rollup merge of #158535 - cezarbbb:eii-track-caller, r=bjorn3
JonathanBrouwer Jul 13, 2026
473126f
Rollup merge of #158632 - addiesh:superfisher, r=oli-obk
JonathanBrouwer Jul 13, 2026
905030f
Rollup merge of #159002 - WaffleLapkin:need_type_info_refactors, r=lcnr
JonathanBrouwer Jul 13, 2026
f927deb
Rollup merge of #159202 - teor2345:bump-rustc-demangle, r=Mark-Simula…
JonathanBrouwer Jul 13, 2026
83f0458
Rollup merge of #159216 - TaKO8Ki:delegation-probe-self-ty, r=petroch…
JonathanBrouwer Jul 13, 2026
ac0f988
Rollup merge of #159222 - joshtriplett:main, r=petrochenkov
JonathanBrouwer Jul 13, 2026
9922fcd
Rollup merge of #156609 - qaijuang:mir-opt-impossible-sized-predicate…
JonathanBrouwer Jul 13, 2026
56ddc65
Rollup merge of #158854 - jdonszelmann:test-entrypoint, r=jonathanbro…
JonathanBrouwer Jul 13, 2026
a6aae66
Rollup merge of #158998 - oli-obk:mut_ast_valid, r=petrochenkov
JonathanBrouwer Jul 13, 2026
f1c2d4b
Rollup merge of #159123 - kn1g78:doc/attr-parser-api, r=mejrs
JonathanBrouwer Jul 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3570,9 +3570,9 @@ dependencies = [

[[package]]
name = "rustc-demangle"
version = "0.1.27"
version = "0.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d"
checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb"

[[package]]
name = "rustc-hash"
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ macro_rules! common_visitor_and_walkers {
Closure(&'a $($mut)? ClosureBinder, &'a $($mut)? Option<CoroutineKind>, &'a $($mut)? Box<FnDecl>, &'a $($mut)? Box<Expr>),
}

impl<'a> FnKind<'a> {
impl<'a> FnKind<'_> {
pub fn header(&'a $($mut)? self) -> Option<&'a $($mut)? FnHeader> {
match *self {
FnKind::Fn(_, _, Fn { sig, .. }) => Some(&$($mut)? sig.header),
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_ast_lowering/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ pub(crate) struct MatchArmWithNoBody {
pub span: Span,
#[suggestion(
"add a body after the pattern",
// ignore-tidy-todo
code = " => todo!(),",
applicability = "has-placeholders"
)]
Expand Down
22 changes: 4 additions & 18 deletions compiler/rustc_ast_passes/src/ast_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,7 @@ impl Visitor<'_> for AstValidator<'_> {
}
visit::walk_item(self, item)
}
ItemKind::Struct(ident, generics, vdata) => {
ItemKind::Struct(.., vdata) => {
self.with_tilde_const(Some(TildeConstReason::Struct { span: item.span }), |this| {
// Scalable vectors can only be tuple structs
let scalable_vector_attr =
Expand All @@ -1536,29 +1536,15 @@ impl Visitor<'_> for AstValidator<'_> {
}
}

match vdata {
VariantData::Struct { fields, .. } => {
this.visit_attrs_vis_ident(&item.attrs, &item.vis, ident);
this.visit_generics(generics);
walk_list!(this, visit_field_def, fields);
}
_ => visit::walk_item(this, item),
}
visit::walk_item(this, item);
})
}
ItemKind::Union(ident, generics, vdata) => {
ItemKind::Union(.., vdata) => {
if vdata.fields().is_empty() {
self.dcx().emit_err(diagnostics::FieldlessUnion { span: item.span });
}
self.with_tilde_const(Some(TildeConstReason::Union { span: item.span }), |this| {
match vdata {
VariantData::Struct { fields, .. } => {
this.visit_attrs_vis_ident(&item.attrs, &item.vis, ident);
this.visit_generics(generics);
walk_list!(this, visit_field_def, fields);
}
_ => visit::walk_item(this, item),
}
visit::walk_item(this, item)
});
}
ItemKind::Const(ConstItem { defaultness, ident, rhs_kind, .. }) => {
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_ast_passes/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ pub(crate) struct MatchArmWithNoBody {
// resulting code to be correct.
#[suggestion(
"add a body after the pattern",
// ignore-tidy-todo
code = " => {{ todo!() }}",
applicability = "has-placeholders",
style = "verbose"
Expand Down
11 changes: 11 additions & 0 deletions compiler/rustc_attr_parsing/src/attributes/test_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,14 @@ impl SingleAttributeParser for RustcTestMarkerParser {
Some(AttributeKind::RustcTestMarker(value_str))
}
}

pub(crate) struct RustcTestEntrypointMarkerParser;

impl NoArgsAttributeParser for RustcTestEntrypointMarkerParser {
const PATH: &[Symbol] = &[sym::rustc_test_entrypoint_marker];
const ALLOWED_TARGETS: AllowedTargets<'_> =
AllowedTargets::AllowList(&[Allow(Target::Fn), Allow(Target::Closure)]);
const ON_DUPLICATE: OnDuplicate = OnDuplicate::Warn;
const STABILITY: AttributeStability = unstable!(rustc_attrs);
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::RustcTestEntrypointMarker;
}
1 change: 1 addition & 0 deletions compiler/rustc_attr_parsing/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ attribute_parsers!(
Single<WithoutArgs<RustcSpecializationTraitParser>>,
Single<WithoutArgs<RustcStdInternalSymbolParser>>,
Single<WithoutArgs<RustcStrictCoherenceParser>>,
Single<WithoutArgs<RustcTestEntrypointMarkerParser>>,
Single<WithoutArgs<RustcTrivialFieldReadsParser>>,
Single<WithoutArgs<RustcUnsafeSpecializationMarkerParser>>,
Single<WithoutArgs<SplatParser>>,
Expand Down
6 changes: 4 additions & 2 deletions compiler/rustc_attr_parsing/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,13 @@ impl MetaItemOrLitParser {
}
}

// FIXME(scrabsha): once #155696 is merged, update this and mention the higher-level APIs.
/// Utility that deconstructs a MetaItem into usable parts.
///
/// MetaItems are syntactically extremely flexible, but specific attributes want to parse
/// them in custom, more restricted ways. This can be done using this struct.
/// them in custom, more restricted ways. For common argument shapes, prefer the higher-level
/// [`AcceptContext::expect_list`](crate::context::AcceptContext::expect_list) and
/// [`AcceptContext::expect_single`](crate::context::AcceptContext::expect_single) helpers.
/// Use this struct when parsing a custom restricted syntax.
///
/// MetaItems consist of some path, and some args. The args could be empty. In other words:
///
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ignore-tidy-filelength
// ignore-tidy-file-filelength

use std::iter;
use std::ops::ControlFlow;
Expand Down Expand Up @@ -681,7 +681,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
hir::ExprKind::Call(callee, _)
if let &ty::FnDef(_, args) = typeck.node_type(callee.hir_id).kind() =>
{
args
args.no_bound_vars().unwrap()
}
_ => return None,
};
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_borrowck/src/diagnostics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,8 @@ impl<'tcx> BorrowedContentSource<'tcx> {
ty::FnDef(def_id, args) => {
let trait_id = tcx.trait_of_assoc(def_id)?;

let args = args.no_bound_vars().unwrap();

if tcx.is_lang_item(trait_id, LangItem::Deref)
|| tcx.is_lang_item(trait_id, LangItem::DerefMut)
{
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/diagnostics/move_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
hir::ExprKind::Call(callee, _) => {
let ty = typeck_result.node_type_opt(callee.hir_id)?;
let ty::FnDef(fn_def_id, args) = *ty.kind() else { return None };
tcx.predicates_of(fn_def_id).instantiate(tcx, args)
tcx.predicates_of(fn_def_id).instantiate(tcx, args.no_bound_vars().unwrap())
}
hir::ExprKind::MethodCall(..) => {
let (_, method) = typeck_result.type_dependent_def(parent.hir_id)?;
Expand Down
10 changes: 8 additions & 2 deletions compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,13 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
typeck_results.node_type_opt(expr.hir_id).as_ref().map(|ty| ty.kind())
{
let arg_pos = args.iter().position(|arg| arg.hir_id == closure_id)?;
Some((*def_id, expr.span, arg_pos, arg_pos, generic_args))
Some((
*def_id,
expr.span,
arg_pos,
arg_pos,
generic_args.no_bound_vars().unwrap(),
))
} else {
None
}
Expand Down Expand Up @@ -1914,7 +1920,7 @@ fn suggest_ampmut<'tcx>(
let trait_ref = ty::TraitRef::from_assoc(
tcx,
tcx.require_lang_item(hir::LangItem::IndexMut, rhs_span),
method_args,
method_args.no_bound_vars().unwrap(),
);
// The type only implements `Index` but not `IndexMut`, we must not suggest `&mut`.
if !infcx
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/diagnostics/region_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
tcx,
self.infcx.typing_env(self.infcx.param_env),
fn_did,
self.infcx.resolve_vars_if_possible(args),
self.infcx.resolve_vars_if_possible(args.no_bound_vars().unwrap()),
) else {
return;
};
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/places_conflict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ fn place_projection_conflict<'tcx>(
),

(ProjectionElem::UnwrapUnsafeBinder(_), _) => {
todo!()
unimplemented!()
}
}
}
1 change: 1 addition & 0 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
}

if let ty::FnDef(def_id, args) = *constant.const_.ty().kind() {
let args = args.no_bound_vars().unwrap();
let instantiated_predicates = tcx.predicates_of(def_id).instantiate(tcx, args);
self.normalize_and_prove_instantiated_predicates(
def_id,
Expand Down
6 changes: 4 additions & 2 deletions compiler/rustc_borrowck/src/universal_regions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ impl<'tcx> UniversalRegions<'tcx> {
});
}
DefiningTy::CoroutineClosure(..) => {
todo!()
unimplemented!()
}
DefiningTy::Coroutine(def_id, args) => {
let v = with_no_trimmed_paths!(
Expand Down Expand Up @@ -603,7 +603,9 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
ty::CoroutineClosure(def_id, args) => {
DefiningTy::CoroutineClosure(def_id, args)
}
ty::FnDef(def_id, args) => DefiningTy::FnDef(def_id, args),
ty::FnDef(def_id, args) => {
DefiningTy::FnDef(def_id, args.no_bound_vars().unwrap())
}
_ => span_bug!(
tcx.def_span(self.mir_def),
"expected defining type for `{:?}`: `{:?}`",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_builtin_macros/src/autodiff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ mod llvm_enzyme {
.iter()
.map(|arg| match arg.pat.kind {
PatKind::Ident(_, ident, _) => ecx.expr_path(ecx.path_ident(span, ident)),
_ => todo!(),
_ => unimplemented!(),
})
.collect::<ThinVec<_>>(),
);
Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_builtin_macros/src/eii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ fn split_attrs(
foreign_item_attributes.push(attr.clone());
macro_attributes.push(attr);
}
// `#[track_caller]` goes on the foreign item only: it's the symbol callers link
// against, so it must carry the flag for call sites to pass the caller location.
// Implementations derive it during codegen (see `EiiImpls` in `codegen_attrs.rs`),
// so it must not be routed onto the default impl here.
Some(sym::track_caller) => {
foreign_item_attributes.push(attr);
}
// Doc attributes should be forwarded to the macro and the foreign item, since those are
// the two items you interact with as a user.
// FIXME: idk yet how EIIs show up in docs, might want to customize
Expand Down
9 changes: 9 additions & 0 deletions compiler/rustc_builtin_macros/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ use crate::util::{check_builtin_macro_attribute, warn_on_duplicate_attribute};
///
/// We mark item with an inert attribute "rustc_test_marker" which the test generation
/// logic will pick up on.
///
/// The test function also gains a `#[rustc_test_entrypoint_marker]` attribute for tools to pick up
/// on. This behavior is *unstable*.
pub(crate) fn expand_test_case(
ecx: &mut ExtCtxt<'_>,
attr_sp: Span,
Expand Down Expand Up @@ -377,6 +380,12 @@ pub(crate) fn expand_test_or_bench(
let test_extern =
cx.item(sp, ast::AttrVec::new(), ast::ItemKind::ExternCrate(None, test_ident));

let item = {
let mut item = item;
item.attrs.push(cx.attr_word(sym::rustc_test_entrypoint_marker, attr_sp));
item
};

debug!("synthetic test item:\n{}\n", pprust::item_to_string(&test_const));

if is_stmt {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
fx.tcx,
ty::TypingEnv::fully_monomorphized(),
def_id,
fn_args,
fn_args.no_bound_vars().unwrap(),
source_info.span,
);

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
fx.tcx,
ty::TypingEnv::fully_monomorphized(),
def_id,
args,
args.no_bound_vars().unwrap(),
)
.unwrap(),
);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_cranelift/src/inline_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub(crate) fn codegen_inline_asm_terminator<'tcx>(
fx.tcx,
ty::TypingEnv::fully_monomorphized(),
def_id,
args,
args.no_bound_vars().unwrap(),
)
.unwrap();
let symbol = fx.tcx.symbol_name(instance);
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_gcc/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ use gccjit::{LValue, RValue, ToRValue, Type};
use rustc_abi::Primitive::Pointer;
use rustc_abi::{self as abi, HasDataLayout};
use rustc_codegen_ssa::traits::{
BaseTypeCodegenMethods, ConstCodegenMethods, MiscCodegenMethods, PacMetadata,
StaticCodegenMethods,
BaseTypeCodegenMethods, ConstCodegenMethods, MiscCodegenMethods, StaticCodegenMethods,
};
use rustc_middle::mir::Mutability;
use rustc_middle::mir::interpret::{GlobalAlloc, PointerArithmetic, Scalar};
use rustc_middle::ty::layout::LayoutOf;
use rustc_session::PointerAuthSchema;

use crate::consts::const_alloc_to_gcc;
use crate::context::{CodegenCx, new_array_type};
Expand Down Expand Up @@ -247,7 +247,7 @@ impl<'gcc, 'tcx> ConstCodegenMethods for CodegenCx<'gcc, 'tcx> {
cv: Scalar,
layout: abi::Scalar,
ty: Type<'gcc>,
_pac: Option<PacMetadata>,
_schema: Option<&PointerAuthSchema>,
) -> RValue<'gcc> {
let bitsize = if layout.is_bool() { 1 } else { layout.size(self).bits() };
match cv {
Expand Down
12 changes: 7 additions & 5 deletions compiler/rustc_codegen_gcc/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ use gccjit::{Block, CType, Context, Function, FunctionType, LValue, Location, RV
use rustc_abi::{Align, HasDataLayout, PointeeInfo, Size, TargetDataLayout, VariantIdx};
use rustc_codegen_ssa::base::wants_msvc_seh;
use rustc_codegen_ssa::errors as ssa_errors;
use rustc_codegen_ssa::traits::{
BackendTypes, BaseTypeCodegenMethods, MiscCodegenMethods, PacMetadata,
};
use rustc_codegen_ssa::traits::{BackendTypes, BaseTypeCodegenMethods, MiscCodegenMethods};
use rustc_data_structures::base_n::{ALPHANUMERIC_ONLY, ToBaseN};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_middle::mir::interpret::Allocation;
Expand All @@ -18,9 +16,9 @@ use rustc_middle::ty::layout::{
LayoutOfHelpers,
};
use rustc_middle::ty::{self, ExistentialTraitRef, Instance, Ty, TyCtxt};
use rustc_session::Session;
#[cfg(feature = "master")]
use rustc_session::config::DebugInfo;
use rustc_session::{PointerAuthSchema, Session};
use rustc_span::{DUMMY_SP, Span, Symbol, respan};
use rustc_target::spec::{HasTargetSpec, HasX86AbiOpt, Target, TlsModel, X86Abi};

Expand Down Expand Up @@ -400,7 +398,11 @@ impl<'gcc, 'tcx> MiscCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
get_fn(self, instance)
}

fn get_fn_addr(&self, instance: Instance<'tcx>, _pac: Option<PacMetadata>) -> RValue<'gcc> {
fn get_fn_addr(
&self,
instance: Instance<'tcx>,
_pointer_auth_schema: Option<&PointerAuthSchema>,
) -> RValue<'gcc> {
let func_name = self.tcx.symbol_name(instance).name;

let func = if let Some(variable) = self.get_declared_value(func_name) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ libc = "0.2"
libloading = { version = "0.9.0" }
measureme = "12.0.1"
object = { version = "0.37.0", default-features = false, features = ["std", "read"] }
rustc-demangle = "0.1.21"
rustc-demangle = "0.1.28"
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" }
rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
Expand Down
10 changes: 4 additions & 6 deletions compiler/rustc_codegen_llvm/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ use rustc_session::config::{
};
use rustc_span::sym;
use rustc_symbol_mangling::mangle_internal_symbol;
use rustc_target::spec::{
Arch, FramePointer, LlvmAbi, SanitizerSet, StackProbeType, StackProtector,
};
use rustc_target::spec::{Arch, FramePointer, SanitizerSet, StackProbeType, StackProtector};
use smallvec::SmallVec;

use crate::common::pauth_fn_attrs;
use crate::context::SimpleCx;
use crate::errors::{PackedStackBackchainNeedsSoftfloat, SanitizerMemtagRequiresMte};
use crate::llvm::AttributePlace::Function;
Expand Down Expand Up @@ -668,8 +665,9 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
}
}

if sess.target.llvm_abiname == LlvmAbi::Pauthtest {
for &ptrauth_attr in pauth_fn_attrs() {
if sess.pointer_authentication() {
let cfg = sess.pointer_auth_config.as_ref().unwrap();
for ptrauth_attr in cfg.fn_attrs() {
to_add.push(llvm::CreateAttrString(cx.llcx, ptrauth_attr));
}
}
Expand Down
Loading
Loading