Skip to content

Commit e61dd43

Browse files
committed
Auto merge of #143074 - compiler-errors:rollup-cv64hdh, r=compiler-errors
Rollup of 18 pull requests Successful merges: - #137843 (make RefCell unstably const) - #140942 (const-eval: allow constants to refer to mutable/external memory, but reject such constants as patterns) - #142549 (small iter.intersperse.fold() optimization) - #142637 (Remove some glob imports from the type system) - #142647 ([perf] Compute hard errors without diagnostics in impl_intersection_has_impossible_obligation) - #142700 (Remove incorrect comments in `Weak`) - #142927 (Add note to `find_const_ty_from_env`) - #142967 (Fix RwLock::try_write documentation for WouldBlock condition) - #142986 (Port `#[export_name]` to the new attribute parsing infrastructure) - #143001 (Rename run always ) - #143010 (Update `browser-ui-test` version to `0.20.7`) - #143015 (Add `sym::macro_pin` diagnostic item for `core::pin::pin!()`) - #143033 (Expand const-stabilized API links in relnotes) - #143041 (Remove cache for citool) - #143056 (Move an ACE test out of the GCI directory) - #143059 (Fix 1.88 relnotes) - #143067 (Tracking issue number for `iter_macro`) - #143073 (Fix some fixmes that were waiting for let chains) Failed merges: - #143020 (codegen_fn_attrs: make comment more precise) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 513999b + cb0b621 commit e61dd43

File tree

158 files changed

+1240
-907
lines changed

Some content is hidden

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

158 files changed

+1240
-907
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ name: CI
1111
on:
1212
push:
1313
branches:
14-
# CI on master only serves for caching citool builds for the `calculate_matrix` job.
15-
# In order to use GHA cache on PR CI (and auto/try) jobs, we need to write to it
16-
# from the default branch.
17-
- master
1814
- auto
1915
- try
2016
- try-perf
@@ -57,13 +53,6 @@ jobs:
5753
steps:
5854
- name: Checkout the source code
5955
uses: actions/checkout@v4
60-
# Cache citool to make its build faster, as it's in the critical path.
61-
# The rust-cache doesn't bleed into the main `job`, so it should not affect any other
62-
# Rust compilation.
63-
- name: Cache citool
64-
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
65-
with:
66-
workspaces: src/ci/citool
6756
- name: Test citool
6857
# Only test citool on the auto branch, to reduce latency of the calculate matrix job
6958
# on PR/try builds.

RELEASES.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,35 @@ Stabilized APIs
5454
---------------
5555

5656
- [`Cell::update`](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#method.update)
57-
- [`impl Default for *const T`](https://doc.rust-lang.org/nightly/std/primitive.pointer.html#impl-Default-for-*const+T)
58-
- [`impl Default for *mut T`](https://doc.rust-lang.org/nightly/std/primitive.pointer.html#impl-Default-for-*mut+T)
57+
- [`impl Default for *const T`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#impl-Default-for-*const+T)
58+
- [`impl Default for *mut T`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#impl-Default-for-*mut+T)
5959
- [`HashMap::extract_if`](https://doc.rust-lang.org/stable/std/collections/struct.HashMap.html#method.extract_if)
6060
- [`HashSet::extract_if`](https://doc.rust-lang.org/stable/std/collections/struct.HashSet.html#method.extract_if)
61+
- [`hint::select_unpredictable`](https://doc.rust-lang.org/stable/std/hint/fn.select_unpredictable.html)
6162
- [`proc_macro::Span::line`](https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.line)
6263
- [`proc_macro::Span::column`](https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.column)
6364
- [`proc_macro::Span::start`](https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.start)
6465
- [`proc_macro::Span::end`](https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.end)
6566
- [`proc_macro::Span::file`](https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.file)
6667
- [`proc_macro::Span::local_file`](https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.local_file)
68+
- [`<[T]>::as_chunks`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_chunks)
69+
- [`<[T]>::as_chunks_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_chunks_mut)
70+
- [`<[T]>::as_chunks_unchecked`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_chunks_unchecked)
71+
- [`<[T]>::as_chunks_unchecked_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_chunks_unchecked_mut)
72+
- [`<[T]>::as_rchunks`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_rchunks)
73+
- [`<[T]>::as_rchunks_mut`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.as_rchunks_mut)
74+
- [`mod ffi::c_str`](https://doc.rust-lang.org/stable/std/ffi/c_str/index.html)
6775

6876
These previously stable APIs are now stable in const contexts:
6977

7078
- [`NonNull<T>::replace`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.replace)
7179
- [`<*mut T>::replace`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.replace)
72-
- [`std::ptr::swap_nonoverlapping`](https://github.com/rust-lang/rust/pull/137280)
73-
- [`Cell::{replace, get, get_mut, from_mut, as_slice_of_cells}`](https://github.com/rust-lang/rust/pull/137928)
80+
- [`std::ptr::swap_nonoverlapping`](https://doc.rust-lang.org/stable/std/ptr/fn.swap_nonoverlapping.html)
81+
- [`Cell::replace`](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#method.replace)
82+
- [`Cell::get`](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#method.get)
83+
- [`Cell::get_mut`](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#method.get_mut)
84+
- [`Cell::from_mut`](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#method.from_mut)
85+
- [`Cell::as_slice_of_cells`](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#method.as_slice_of_cells)
7486

7587

7688
<a id="1.88.0-Cargo"></a>

compiler/rustc_attr_data_structures/src/attributes.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,14 @@ pub enum AttributeKind {
231231
/// Represents [`#[doc]`](https://doc.rust-lang.org/stable/rustdoc/write-documentation/the-doc-attribute.html).
232232
DocComment { style: AttrStyle, kind: CommentKind, span: Span, comment: Symbol },
233233

234+
/// Represents [`#[export_name]`](https://doc.rust-lang.org/reference/abi.html#the-export_name-attribute).
235+
ExportName {
236+
/// The name to export this item with.
237+
/// It may not contain \0 bytes as it will be converted to a null-terminated string.
238+
name: Symbol,
239+
span: Span,
240+
},
241+
234242
/// Represents `#[inline]` and `#[rustc_force_inline]`.
235243
Inline(InlineAttr, Span),
236244

compiler/rustc_attr_data_structures/src/encode_cross_crate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ impl AttributeKind {
2222
ConstStabilityIndirect => No,
2323
Deprecation { .. } => Yes,
2424
DocComment { .. } => Yes,
25+
ExportName { .. } => Yes,
2526
Inline(..) => No,
2627
MacroTransparency(..) => Yes,
2728
Repr(..) => No,

compiler/rustc_attr_parsing/messages.ftl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,12 @@ attr_parsing_naked_functions_incompatible_attribute =
9393
attribute incompatible with `#[unsafe(naked)]`
9494
.label = the `{$attr}` attribute is incompatible with `#[unsafe(naked)]`
9595
.naked_attribute = function marked with `#[unsafe(naked)]` here
96+
9697
attr_parsing_non_ident_feature =
9798
'feature' is not an identifier
9899
100+
attr_parsing_null_on_export = `export_name` may not contain null characters
101+
99102
attr_parsing_repr_ident =
100103
meta item in `repr` must be an identifier
101104

compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc_span::{Span, Symbol, sym};
66
use super::{AcceptMapping, AttributeOrder, AttributeParser, OnDuplicate, SingleAttributeParser};
77
use crate::context::{AcceptContext, FinalizeContext, Stage};
88
use crate::parser::ArgParser;
9-
use crate::session_diagnostics::NakedFunctionIncompatibleAttribute;
9+
use crate::session_diagnostics::{NakedFunctionIncompatibleAttribute, NullOnExport};
1010

1111
pub(crate) struct OptimizeParser;
1212

@@ -59,6 +59,33 @@ impl<S: Stage> SingleAttributeParser<S> for ColdParser {
5959
}
6060
}
6161

62+
pub(crate) struct ExportNameParser;
63+
64+
impl<S: Stage> SingleAttributeParser<S> for ExportNameParser {
65+
const PATH: &[rustc_span::Symbol] = &[sym::export_name];
66+
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepFirst;
67+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::WarnButFutureError;
68+
const TEMPLATE: AttributeTemplate = template!(NameValueStr: "name");
69+
70+
fn convert(cx: &mut AcceptContext<'_, '_, S>, args: &ArgParser<'_>) -> Option<AttributeKind> {
71+
let Some(nv) = args.name_value() else {
72+
cx.expected_name_value(cx.attr_span, None);
73+
return None;
74+
};
75+
let Some(name) = nv.value_as_str() else {
76+
cx.expected_string_literal(nv.value_span, Some(nv.value_as_lit()));
77+
return None;
78+
};
79+
if name.as_str().contains('\0') {
80+
// `#[export_name = ...]` will be converted to a null-terminated string,
81+
// so it may not contain any null characters.
82+
cx.emit_err(NullOnExport { span: cx.attr_span });
83+
return None;
84+
}
85+
Some(AttributeKind::ExportName { name, span: cx.attr_span })
86+
}
87+
}
88+
6289
#[derive(Default)]
6390
pub(crate) struct NakedParser {
6491
span: Option<Span>,

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span, Symbol, sym};
1616

1717
use crate::attributes::allow_unstable::{AllowConstFnUnstableParser, AllowInternalUnstableParser};
1818
use crate::attributes::codegen_attrs::{
19-
ColdParser, NakedParser, NoMangleParser, OptimizeParser, TrackCallerParser,
19+
ColdParser, ExportNameParser, NakedParser, NoMangleParser, OptimizeParser, TrackCallerParser,
2020
};
2121
use crate::attributes::confusables::ConfusablesParser;
2222
use crate::attributes::deprecation::DeprecationParser;
@@ -117,6 +117,7 @@ attribute_parsers!(
117117
Single<ConstContinueParser>,
118118
Single<ConstStabilityIndirectParser>,
119119
Single<DeprecationParser>,
120+
Single<ExportNameParser>,
120121
Single<InlineParser>,
121122
Single<LoopMatchParser>,
122123
Single<MayDangleParser>,

compiler/rustc_attr_parsing/src/session_diagnostics.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,13 @@ pub(crate) struct MustUseIllFormedAttributeInput {
445445
pub suggestions: DiagArgValue,
446446
}
447447

448+
#[derive(Diagnostic)]
449+
#[diag(attr_parsing_null_on_export, code = E0648)]
450+
pub(crate) struct NullOnExport {
451+
#[primary_span]
452+
pub span: Span,
453+
}
454+
448455
#[derive(Diagnostic)]
449456
#[diag(attr_parsing_stability_outside_std, code = E0734)]
450457
pub(crate) struct StabilityOutsideStd {

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_hir::def::Res::Def;
1010
use rustc_hir::def_id::DefId;
1111
use rustc_hir::intravisit::VisitorExt;
1212
use rustc_hir::{PolyTraitRef, TyKind, WhereBoundPredicate};
13-
use rustc_infer::infer::{NllRegionVariableOrigin, RelateParamBound};
13+
use rustc_infer::infer::{NllRegionVariableOrigin, SubregionOrigin};
1414
use rustc_middle::bug;
1515
use rustc_middle::hir::place::PlaceBase;
1616
use rustc_middle::mir::{AnnotationSource, ConstraintCategory, ReturnConstraint};
@@ -329,7 +329,8 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
329329
self.infcx.tcx,
330330
type_test.generic_kind.to_ty(self.infcx.tcx),
331331
);
332-
let origin = RelateParamBound(type_test_span, generic_ty, None);
332+
let origin =
333+
SubregionOrigin::RelateParamBound(type_test_span, generic_ty, None);
333334
self.buffer_error(self.infcx.err_ctxt().construct_generic_bound_failure(
334335
self.body.source.def_id().expect_local(),
335336
type_test_span,

compiler/rustc_borrowck/src/type_check/constraint_conversion.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_infer::infer::canonical::QueryRegionConstraints;
33
use rustc_infer::infer::outlives::env::RegionBoundPairs;
44
use rustc_infer::infer::outlives::obligations::{TypeOutlives, TypeOutlivesDelegate};
55
use rustc_infer::infer::region_constraints::{GenericKind, VerifyBound};
6-
use rustc_infer::infer::{self, InferCtxt, SubregionOrigin};
6+
use rustc_infer::infer::{InferCtxt, SubregionOrigin};
77
use rustc_infer::traits::query::type_op::DeeplyNormalize;
88
use rustc_middle::bug;
99
use rustc_middle::ty::{
@@ -172,7 +172,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
172172
ty::Region::new_var(tcx, universal_regions.implicit_region_bound());
173173
// we don't actually use this for anything, but
174174
// the `TypeOutlives` code needs an origin.
175-
let origin = infer::RelateParamBound(self.span, t1, None);
175+
let origin = SubregionOrigin::RelateParamBound(self.span, t1, None);
176176
TypeOutlives::new(
177177
&mut *self,
178178
tcx,

compiler/rustc_borrowck/src/type_check/input_output.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
6666
Ty::new_tup(self.tcx(), user_provided_sig.inputs()),
6767
args.tupled_upvars_ty(),
6868
args.coroutine_captures_by_ref_ty(),
69-
self.infcx
70-
.next_region_var(RegionVariableOrigin::MiscVariable(self.body.span), || {
71-
RegionCtxt::Unknown
72-
}),
69+
self.infcx.next_region_var(RegionVariableOrigin::Misc(self.body.span), || {
70+
RegionCtxt::Unknown
71+
}),
7372
);
7473

7574
let next_ty_var = || self.infcx.next_ty_var(self.body.span);

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_infer::infer::canonical::QueryRegionConstraints;
1616
use rustc_infer::infer::outlives::env::RegionBoundPairs;
1717
use rustc_infer::infer::region_constraints::RegionConstraintData;
1818
use rustc_infer::infer::{
19-
BoundRegion, BoundRegionConversionTime, InferCtxt, NllRegionVariableOrigin,
19+
BoundRegionConversionTime, InferCtxt, NllRegionVariableOrigin, RegionVariableOrigin,
2020
};
2121
use rustc_infer::traits::PredicateObligations;
2222
use rustc_middle::mir::visit::{NonMutatingUseContext, PlaceContext, Visitor};
@@ -794,7 +794,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
794794
};
795795

796796
self.infcx.next_region_var(
797-
BoundRegion(
797+
RegionVariableOrigin::BoundRegion(
798798
term.source_info.span,
799799
br.kind,
800800
BoundRegionConversionTime::FnCall,

compiler/rustc_codegen_ssa/messages.ftl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,6 @@ codegen_ssa_missing_features = add the missing features in a `target_feature` at
205205
codegen_ssa_missing_query_depgraph =
206206
found CGU-reuse attribute but `-Zquery-dep-graph` was not specified
207207
208-
codegen_ssa_mixed_export_name_and_no_mangle = `{$no_mangle_attr}` attribute may not be used in combination with `#[export_name]`
209-
.label = `{$no_mangle_attr}` is ignored
210-
.note = `#[export_name]` takes precedence
211-
.suggestion = remove the `{$no_mangle_attr}` attribute
212-
213208
codegen_ssa_msvc_missing_linker = the msvc targets depend on the msvc linker but `link.exe` was not found
214209
215210
codegen_ssa_multiple_external_func_decl = multiple declarations of external function `{$function}` from library `{$library_name}` have different calling conventions
@@ -230,8 +225,6 @@ codegen_ssa_no_natvis_directory = error enumerating natvis directory: {$error}
230225
231226
codegen_ssa_no_saved_object_file = cached cgu {$cgu_name} should have an object file, but doesn't
232227
233-
codegen_ssa_null_on_export = `export_name` may not contain null characters
234-
235228
codegen_ssa_out_of_range_integer = integer value out of range
236229
.label = value must be between `0` and `255`
237230

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use rustc_attr_data_structures::{
99
use rustc_hir::def::DefKind;
1010
use rustc_hir::def_id::{DefId, LOCAL_CRATE, LocalDefId};
1111
use rustc_hir::weak_lang_items::WEAK_LANG_ITEMS;
12-
use rustc_hir::{self as hir, HirId, LangItem, lang_items};
12+
use rustc_hir::{self as hir, LangItem, lang_items};
1313
use rustc_middle::middle::codegen_fn_attrs::{
1414
CodegenFnAttrFlags, CodegenFnAttrs, PatchableFunctionEntry,
1515
};
@@ -87,7 +87,6 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
8787

8888
let mut link_ordinal_span = None;
8989
let mut no_sanitize_span = None;
90-
let mut mixed_export_name_no_mangle_lint_state = MixedExportNameAndNoMangleState::default();
9190

9291
for attr in attrs.iter() {
9392
// In some cases, attribute are only valid on functions, but it's the `check_attr`
@@ -119,16 +118,14 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
119118
.max();
120119
}
121120
AttributeKind::Cold(_) => codegen_fn_attrs.flags |= CodegenFnAttrFlags::COLD,
121+
AttributeKind::ExportName { name, .. } => {
122+
codegen_fn_attrs.export_name = Some(*name);
123+
}
122124
AttributeKind::Naked(_) => codegen_fn_attrs.flags |= CodegenFnAttrFlags::NAKED,
123125
AttributeKind::Align { align, .. } => codegen_fn_attrs.alignment = Some(*align),
124126
AttributeKind::NoMangle(attr_span) => {
125127
if tcx.opt_item_name(did.to_def_id()).is_some() {
126128
codegen_fn_attrs.flags |= CodegenFnAttrFlags::NO_MANGLE;
127-
mixed_export_name_no_mangle_lint_state.track_no_mangle(
128-
*attr_span,
129-
tcx.local_def_id_to_hir_id(did),
130-
attr,
131-
);
132129
} else {
133130
tcx.dcx().emit_err(NoMangleNameless {
134131
span: *attr_span,
@@ -223,17 +220,6 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
223220
}
224221
}
225222
sym::thread_local => codegen_fn_attrs.flags |= CodegenFnAttrFlags::THREAD_LOCAL,
226-
sym::export_name => {
227-
if let Some(s) = attr.value_str() {
228-
if s.as_str().contains('\0') {
229-
// `#[export_name = ...]` will be converted to a null-terminated string,
230-
// so it may not contain any null characters.
231-
tcx.dcx().emit_err(errors::NullOnExport { span: attr.span() });
232-
}
233-
codegen_fn_attrs.export_name = Some(s);
234-
mixed_export_name_no_mangle_lint_state.track_export_name(attr.span());
235-
}
236-
}
237223
sym::target_feature => {
238224
let Some(sig) = tcx.hir_node_by_def_id(did).fn_sig() else {
239225
tcx.dcx().span_delayed_bug(attr.span(), "target_feature applied to non-fn");
@@ -444,8 +430,6 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
444430
}
445431
}
446432

447-
mixed_export_name_no_mangle_lint_state.lint_if_mixed(tcx);
448-
449433
// Apply the minimum function alignment here, so that individual backends don't have to.
450434
codegen_fn_attrs.alignment =
451435
Ord::max(codegen_fn_attrs.alignment, tcx.sess.opts.unstable_opts.min_function_alignment);
@@ -672,49 +656,6 @@ fn check_link_name_xor_ordinal(
672656
}
673657
}
674658

675-
#[derive(Default)]
676-
struct MixedExportNameAndNoMangleState<'a> {
677-
export_name: Option<Span>,
678-
hir_id: Option<HirId>,
679-
no_mangle: Option<Span>,
680-
no_mangle_attr: Option<&'a hir::Attribute>,
681-
}
682-
683-
impl<'a> MixedExportNameAndNoMangleState<'a> {
684-
fn track_export_name(&mut self, span: Span) {
685-
self.export_name = Some(span);
686-
}
687-
688-
fn track_no_mangle(&mut self, span: Span, hir_id: HirId, attr_name: &'a hir::Attribute) {
689-
self.no_mangle = Some(span);
690-
self.hir_id = Some(hir_id);
691-
self.no_mangle_attr = Some(attr_name);
692-
}
693-
694-
/// Emit diagnostics if the lint condition is met.
695-
fn lint_if_mixed(self, tcx: TyCtxt<'_>) {
696-
if let Self {
697-
export_name: Some(export_name),
698-
no_mangle: Some(no_mangle),
699-
hir_id: Some(hir_id),
700-
no_mangle_attr: Some(_),
701-
} = self
702-
{
703-
tcx.emit_node_span_lint(
704-
lint::builtin::UNUSED_ATTRIBUTES,
705-
hir_id,
706-
no_mangle,
707-
errors::MixedExportNameAndNoMangle {
708-
no_mangle,
709-
no_mangle_attr: "#[unsafe(no_mangle)]".to_string(),
710-
export_name,
711-
removal_span: no_mangle,
712-
},
713-
);
714-
}
715-
}
716-
}
717-
718659
/// We now check the #\[rustc_autodiff\] attributes which we generated from the #[autodiff(...)]
719660
/// macros. There are two forms. The pure one without args to mark primal functions (the functions
720661
/// being differentiated). The other form is #[rustc_autodiff(Mode, ActivityList)] on top of the

0 commit comments

Comments
 (0)