charon_lib/ast/from_rustc.rs
1// This file is automatically generated by `cargo run --bin generate-asts`.
2// Do not edit it by hand.
3
4#![allow(
5 clippy::doc_lazy_continuation,
6 clippy::enum_variant_names,
7 clippy::large_enum_variant
8)]
9
10use crate::ast::meta::Span;
11use derive_generic_visitor::{Drive, DriveMut};
12use serde::{Deserialize, Serialize};
13use ustr::Ustr;
14
15#[derive(Debug, Clone, Copy, PartialEq, Eq)]
16pub struct FromRustcError;
17
18/// Represents parsed *built-in* inert attributes.
19///
20/// ## Overview
21/// These attributes are markers that guide the compilation process and are never expanded into other code.
22/// They persist throughout the compilation phases, from AST to HIR and beyond.
23///
24/// ## Attribute Processing
25/// While attributes are initially parsed by [`rustc_parse`] into [`ast::Attribute`], they still contain raw token streams
26/// because different attributes have different internal structures. This enum represents the final,
27/// fully parsed form of these attributes, where each variant contains all the information and
28/// structure relevant for the specific attribute.
29///
30/// Some attributes can be applied multiple times to the same item, and they are "collapsed" into a single
31/// semantic attribute. For example:
32/// ```rust
33/// #[repr(C)]
34/// #[repr(packed)]
35/// struct S { }
36/// ```
37/// This is equivalent to `#[repr(C, packed)]` and results in a single [`AttributeKind::Repr`] containing
38/// both `C` and `packed` annotations. This collapsing happens during parsing and is reflected in the
39/// data structures defined in this enum.
40///
41/// ## Usage
42/// These parsed attributes are used throughout the compiler to:
43/// - Control code generation (e.g., `#[repr]`)
44/// - Mark API stability (`#[stable]`, `#[unstable]`)
45/// - Provide documentation (`#[doc]`)
46/// - Guide compiler behavior (e.g., `#[allow_internal_unstable]`)
47///
48/// ## Note on Attribute Organization
49/// Some attributes like `InlineAttr`, `OptimizeAttr`, and `InstructionSetAttr` are defined separately
50/// from this enum because they are used in specific compiler phases (like code generation) and don't
51/// need to persist throughout the entire compilation process. They are typically processed and
52/// converted into their final form earlier in the compilation pipeline.
53///
54/// For example:
55/// - `InlineAttr` is used during code generation to control function inlining
56/// - `OptimizeAttr` is used to control optimization levels
57/// - `InstructionSetAttr` is used for target-specific code generation
58///
59/// These attributes are handled by their respective compiler passes in the [`rustc_codegen_ssa`] crate
60/// and don't need to be preserved in the same way as the attributes in this enum.
61///
62/// For more details on attribute parsing, see the [`rustc_attr_parsing`] crate.
63///
64/// [`rustc_parse`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/index.html
65/// [`rustc_codegen_ssa`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_codegen_ssa/index.html
66/// [`rustc_attr_parsing`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_attr_parsing/index.html
67#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Drive, DriveMut)]
68#[cfg_attr(feature = "charon_on_charon", charon::rename("RustcAttributeKind"))]
69#[cfg_attr(
70 feature = "charon_on_charon",
71 charon::variants_prefix("RustcAttributeKind")
72)]
73pub enum AttributeKind {
74 /// Represents `#[automatically_derived]`
75 AutomaticallyDerived,
76 /// Represents `#[cold]`.
77 Cold,
78 /// Represents [`#[deprecated]`](https://doc.rust-lang.org/stable/reference/attributes/diagnostics.html#the-deprecated-attribute).
79 Deprecated {
80 deprecation: Deprecation,
81 span: Span,
82 },
83 /// Represents `#[fundamental]`.
84 Fundamental,
85 /// Represents `#[ignore]`
86 Ignore {
87 span: Span,
88 /// ignore can optionally have a reason: `#[ignore = "reason this is ignored"]`
89 reason: Option<Ustr>,
90 },
91 /// Represents `#[inline]` and `#[rustc_force_inline]`.
92 Inline(InlineAttr, Span),
93 /// Represents [`#[may_dangle]`](https://std-dev-guide.rust-lang.org/tricky/may-dangle.html).
94 MayDangle(Span),
95 /// Represents `#[naked]`
96 Naked(Span),
97 /// Represents `#[no_link]`
98 NoLink,
99 /// Represents `#[no_mangle]`
100 NoMangle(Span),
101 /// Represents `#[non_exhaustive]`
102 NonExhaustive(Span),
103 /// Represents `#[optimize(size|speed)]`
104 Optimize(OptimizeAttr, Span),
105 /// Represents `#[align(N)]`.
106 RustcAlign { align: u64, span: Span },
107 /// Represents `#[rustc_intrinsic]`
108 RustcIntrinsic,
109 /// Represents `#[rustc_test_entrypoint_marker]`
110 RustcTestEntrypointMarker,
111 /// Represents `#[should_panic]`
112 ShouldPanic { reason: Option<Ustr> },
113 /// Represents `#[target_feature(enable = "...")]` and
114 /// `#[unsafe(force_target_feature(enable = "...")]`.
115 TargetFeature {
116 features: Vec<(Ustr, Span)>,
117 attr_span: Span,
118 was_forced: bool,
119 },
120 /// Represents `#[track_caller]`
121 TrackCaller(Span),
122}
123
124/// A representation of all the valid lang items in Rust.
125#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Drive, DriveMut)]
126#[cfg_attr(feature = "charon_on_charon", charon::rename("RustcLangItem"))]
127#[cfg_attr(feature = "charon_on_charon", charon::variants_prefix("RustcLangItem"))]
128pub enum LangItem {
129 ///The `sized` lang item.
130 Sized,
131 ///The `meta_sized` lang item.
132 MetaSized,
133 ///The `pointee_sized` lang item.
134 PointeeSized,
135 ///The `unsize` lang item.
136 Unsize,
137 ///The `mem_align_const` lang item.
138 AlignOf,
139 ///The `mem_size_const` lang item.
140 SizeOf,
141 ///The `offset_of` lang item.
142 OffsetOf,
143 ///The `structural_peq` lang item.
144 /// Trait injected by `#[derive(PartialEq)]`, (i.e. "Partial EQ").
145 StructuralPeq,
146 ///The `copy` lang item.
147 Copy,
148 ///The `clone` lang item.
149 Clone,
150 ///The `clone_fn` lang item.
151 CloneFn,
152 ///The `use_cloned` lang item.
153 UseCloned,
154 ///The `trivial_clone` lang item.
155 TrivialClone,
156 ///The `sync` lang item.
157 Sync,
158 ///The `discriminant_kind` lang item.
159 DiscriminantKind,
160 ///The `discriminant_type` lang item.
161 /// The associated item of the `DiscriminantKind` trait.
162 Discriminant,
163 ///The `pointee_trait` lang item.
164 PointeeTrait,
165 ///The `metadata_type` lang item.
166 Metadata,
167 ///The `dyn_metadata` lang item.
168 DynMetadata,
169 ///The `freeze` lang item.
170 Freeze,
171 ///The `unsafe_unpin` lang item.
172 UnsafeUnpin,
173 ///The `fn_ptr_trait` lang item.
174 FnPtrTrait,
175 ///The `fn_ptr_addr` lang item.
176 FnPtrAddr,
177 ///The `drop` lang item.
178 Drop,
179 ///The `destruct` lang item.
180 Destruct,
181 ///The `async_drop` lang item.
182 AsyncDrop,
183 ///The `async_drop_in_place` lang item.
184 AsyncDropInPlace,
185 ///The `coerce_unsized` lang item.
186 CoerceUnsized,
187 ///The `dispatch_from_dyn` lang item.
188 DispatchFromDyn,
189 ///The `try_as_dyn` lang item.
190 TryAsDyn,
191 ///The `transmute_opts` lang item.
192 TransmuteOpts,
193 ///The `transmute_trait` lang item.
194 TransmuteTrait,
195 ///The `add` lang item.
196 Add,
197 ///The `sub` lang item.
198 Sub,
199 ///The `mul` lang item.
200 Mul,
201 ///The `div` lang item.
202 Div,
203 ///The `rem` lang item.
204 Rem,
205 ///The `neg` lang item.
206 Neg,
207 ///The `not` lang item.
208 Not,
209 ///The `bitxor` lang item.
210 BitXor,
211 ///The `bitand` lang item.
212 BitAnd,
213 ///The `bitor` lang item.
214 BitOr,
215 ///The `shl` lang item.
216 Shl,
217 ///The `shr` lang item.
218 Shr,
219 ///The `add_assign` lang item.
220 AddAssign,
221 ///The `sub_assign` lang item.
222 SubAssign,
223 ///The `mul_assign` lang item.
224 MulAssign,
225 ///The `div_assign` lang item.
226 DivAssign,
227 ///The `rem_assign` lang item.
228 RemAssign,
229 ///The `bitxor_assign` lang item.
230 BitXorAssign,
231 ///The `bitand_assign` lang item.
232 BitAndAssign,
233 ///The `bitor_assign` lang item.
234 BitOrAssign,
235 ///The `shl_assign` lang item.
236 ShlAssign,
237 ///The `shr_assign` lang item.
238 ShrAssign,
239 ///The `index` lang item.
240 Index,
241 ///The `index_mut` lang item.
242 IndexMut,
243 ///The `unsafe_cell` lang item.
244 UnsafeCell,
245 ///The `covariant_unsafe_cell` lang item.
246 CovariantUnsafeCell,
247 ///The `unsafe_pinned` lang item.
248 UnsafePinned,
249 ///The `va_arg_safe` lang item.
250 VaArgSafe,
251 ///The `va_list` lang item.
252 VaList,
253 ///The `complex` lang item.
254 Complex,
255 ///The `deref` lang item.
256 Deref,
257 ///The `deref_mut` lang item.
258 DerefMut,
259 ///The `deref_pure` lang item.
260 DerefPure,
261 ///The `deref_target` lang item.
262 DerefTarget,
263 ///The `receiver` lang item.
264 Receiver,
265 ///The `receiver_target` lang item.
266 ReceiverTarget,
267 ///The `legacy_receiver` lang item.
268 LegacyReceiver,
269 ///The `Fn` lang item.
270 Fn,
271 ///The `fn_mut` lang item.
272 FnMut,
273 ///The `fn_once` lang item.
274 FnOnce,
275 ///The `async_fn` lang item.
276 AsyncFn,
277 ///The `async_fn_mut` lang item.
278 AsyncFnMut,
279 ///The `async_fn_once` lang item.
280 AsyncFnOnce,
281 ///The `async_fn_once_output` lang item.
282 AsyncFnOnceOutput,
283 ///The `call_once_future` lang item.
284 CallOnceFuture,
285 ///The `call_ref_future` lang item.
286 CallRefFuture,
287 ///The `async_fn_kind_helper` lang item.
288 AsyncFnKindHelper,
289 ///The `async_fn_kind_upvars` lang item.
290 AsyncFnKindUpvars,
291 ///The `fn_once_output` lang item.
292 FnOnceOutput,
293 ///The `iterator` lang item.
294 Iterator,
295 ///The `fused_iterator` lang item.
296 FusedIterator,
297 ///The `future_trait` lang item.
298 Future,
299 ///The `future_output` lang item.
300 FutureOutput,
301 ///The `async_iterator` lang item.
302 AsyncIterator,
303 ///The `coroutine_state` lang item.
304 CoroutineState,
305 ///The `coroutine` lang item.
306 Coroutine,
307 ///The `coroutine_return` lang item.
308 CoroutineReturn,
309 ///The `coroutine_yield` lang item.
310 CoroutineYield,
311 ///The `coroutine_resume` lang item.
312 CoroutineResume,
313 ///The `unpin` lang item.
314 Unpin,
315 ///The `pin` lang item.
316 Pin,
317 ///The `Ordering` lang item.
318 OrderingEnum,
319 ///The `eq` lang item.
320 PartialEq,
321 ///The `partial_ord` lang item.
322 PartialOrd,
323 ///The `c_void` lang item.
324 CVoid,
325 ///The `type_info` lang item.
326 Type,
327 ///The `type_info_generic` lang item.
328 TypeGeneric,
329 ///The `type_id` lang item.
330 TypeId,
331 ///The `panic` lang item.
332 Panic,
333 ///The `panic_nounwind` lang item.
334 PanicNounwind,
335 ///The `panic_fmt` lang item.
336 PanicFmt,
337 ///The `panic_display` lang item.
338 PanicDisplay,
339 ///The `const_panic_fmt` lang item.
340 ConstPanicFmt,
341 ///The `panic_bounds_check` lang item.
342 PanicBoundsCheck,
343 ///The `panic_misaligned_pointer_dereference` lang item.
344 PanicMisalignedPointerDereference,
345 ///The `panic_info` lang item.
346 PanicInfo,
347 ///The `panic_location` lang item.
348 PanicLocation,
349 ///The `panic_impl` lang item.
350 PanicImpl,
351 ///The `panic_cannot_unwind` lang item.
352 PanicCannotUnwind,
353 ///The `panic_in_cleanup` lang item.
354 PanicInCleanup,
355 ///The `panic_const_add_overflow` lang item.
356 /// Constant panic messages, used for codegen of MIR asserts.
357 PanicAddOverflow,
358 ///The `panic_const_sub_overflow` lang item.
359 PanicSubOverflow,
360 ///The `panic_const_mul_overflow` lang item.
361 PanicMulOverflow,
362 ///The `panic_const_div_overflow` lang item.
363 PanicDivOverflow,
364 ///The `panic_const_rem_overflow` lang item.
365 PanicRemOverflow,
366 ///The `panic_const_neg_overflow` lang item.
367 PanicNegOverflow,
368 ///The `panic_const_shr_overflow` lang item.
369 PanicShrOverflow,
370 ///The `panic_const_shl_overflow` lang item.
371 PanicShlOverflow,
372 ///The `panic_const_div_by_zero` lang item.
373 PanicDivZero,
374 ///The `panic_const_rem_by_zero` lang item.
375 PanicRemZero,
376 ///The `panic_const_coroutine_resumed` lang item.
377 PanicCoroutineResumed,
378 ///The `panic_const_async_fn_resumed` lang item.
379 PanicAsyncFnResumed,
380 ///The `panic_const_async_gen_fn_resumed` lang item.
381 PanicAsyncGenFnResumed,
382 ///The `panic_const_gen_fn_none` lang item.
383 PanicGenFnNone,
384 ///The `panic_const_coroutine_resumed_panic` lang item.
385 PanicCoroutineResumedPanic,
386 ///The `panic_const_async_fn_resumed_panic` lang item.
387 PanicAsyncFnResumedPanic,
388 ///The `panic_const_async_gen_fn_resumed_panic` lang item.
389 PanicAsyncGenFnResumedPanic,
390 ///The `panic_const_gen_fn_none_panic` lang item.
391 PanicGenFnNonePanic,
392 ///The `panic_null_pointer_dereference` lang item.
393 PanicNullPointerDereference,
394 ///The `panic_null_reference_constructed` lang item.
395 PanicNullReferenceConstructed,
396 ///The `panic_invalid_enum_construction` lang item.
397 PanicInvalidEnumConstruction,
398 ///The `panic_const_coroutine_resumed_drop` lang item.
399 PanicCoroutineResumedDrop,
400 ///The `panic_const_async_fn_resumed_drop` lang item.
401 PanicAsyncFnResumedDrop,
402 ///The `panic_const_async_gen_fn_resumed_drop` lang item.
403 PanicAsyncGenFnResumedDrop,
404 ///The `panic_const_gen_fn_none_drop` lang item.
405 PanicGenFnNoneDrop,
406 ///The `begin_panic` lang item.
407 /// libstd panic entry point. Necessary for const eval to be able to catch it
408 BeginPanic,
409 ///The `format_argument` lang item.
410 FormatArgument,
411 ///The `format_arguments` lang item.
412 FormatArguments,
413 ///The `drop_glue` lang item.
414 DropGlue,
415 ///The `alloc_layout` lang item.
416 AllocLayout,
417 ///The `start` lang item.
418 /// For all binary crates without `#![no_main]`, Rust will generate a "main" function.
419 /// The exact name and signature are target-dependent. The "main" function will invoke
420 /// this lang item, passing it the `argc` and `argv` (or null, if those don't exist
421 /// on the current target) as well as the user-defined `fn main` from the binary crate.
422 Start,
423 ///The `eh_personality` lang item.
424 EhPersonality,
425 ///The `compiler_move` lang item.
426 CompilerMove,
427 ///The `compiler_copy` lang item.
428 CompilerCopy,
429 ///The `owned_box` lang item.
430 OwnedBox,
431 ///The `global_alloc_ty` lang item.
432 GlobalAlloc,
433 ///The `phantom_data` lang item.
434 PhantomData,
435 ///The `manually_drop` lang item.
436 ManuallyDrop,
437 ///The `maybe_dangling` lang item.
438 MaybeDangling,
439 ///The `bikeshed_guaranteed_no_drop` lang item.
440 BikeshedGuaranteedNoDrop,
441 ///The `maybe_uninit` lang item.
442 MaybeUninit,
443 ///The `termination` lang item.
444 Termination,
445 ///The `Try` lang item.
446 Try,
447 ///The `tuple_trait` lang item.
448 Tuple,
449 ///The `slice_len_fn` lang item.
450 SliceLen,
451 ///The `from_residual` lang item.
452 TryTraitFromResidual,
453 ///The `from_output` lang item.
454 TryTraitFromOutput,
455 ///The `branch` lang item.
456 TryTraitBranch,
457 ///The `from_yeet` lang item.
458 TryTraitFromYeet,
459 ///The `into_try_type` lang item.
460 ResidualIntoTryType,
461 ///The `coerce_pointee_validated` lang item.
462 CoercePointeeValidated,
463 ///The `const_param_ty` lang item.
464 ConstParamTy,
465 ///The `Poll` lang item.
466 Poll,
467 ///The `Ready` lang item.
468 PollReady,
469 ///The `Pending` lang item.
470 PollPending,
471 ///The `AsyncGenReady` lang item.
472 AsyncGenReady,
473 ///The `AsyncGenPending` lang item.
474 AsyncGenPending,
475 ///The `AsyncGenFinished` lang item.
476 AsyncGenFinished,
477 ///The `ResumeTy` lang item.
478 ResumeTy,
479 ///The `get_context` lang item.
480 GetContext,
481 ///The `Context` lang item.
482 Context,
483 ///The `poll` lang item.
484 FuturePoll,
485 ///The `async_iterator_poll_next` lang item.
486 AsyncIteratorPollNext,
487 ///The `into_async_iter_into_iter` lang item.
488 IntoAsyncIterIntoIter,
489 ///The `Option` lang item.
490 Option,
491 ///The `Some` lang item.
492 OptionSome,
493 ///The `None` lang item.
494 OptionNone,
495 ///The `Ok` lang item.
496 ResultOk,
497 ///The `Err` lang item.
498 ResultErr,
499 ///The `Continue` lang item.
500 ControlFlowContinue,
501 ///The `Break` lang item.
502 ControlFlowBreak,
503 ///The `into_future` lang item.
504 IntoFutureIntoFuture,
505 ///The `into_iter` lang item.
506 IntoIterIntoIter,
507 ///The `next` lang item.
508 IteratorNext,
509 ///The `new_unchecked` lang item.
510 PinNewUnchecked,
511 ///The `RangeFrom` lang item.
512 RangeFrom,
513 ///The `RangeFull` lang item.
514 RangeFull,
515 ///The `RangeInclusive` lang item.
516 RangeInclusiveStruct,
517 ///The `range_inclusive_new` lang item.
518 RangeInclusiveNew,
519 ///The `Range` lang item.
520 Range,
521 ///The `RangeToInclusive` lang item.
522 RangeToInclusive,
523 ///The `RangeTo` lang item.
524 RangeTo,
525 ///The `RangeMax` lang item.
526 RangeMax,
527 ///The `RangeMin` lang item.
528 RangeMin,
529 ///The `RangeSub` lang item.
530 RangeSub,
531 ///The `RangeFromCopy` lang item.
532 RangeFromCopy,
533 ///The `RangeCopy` lang item.
534 RangeCopy,
535 ///The `RangeInclusiveCopy` lang item.
536 RangeInclusiveCopy,
537 ///The `RangeToInclusiveCopy` lang item.
538 RangeToInclusiveCopy,
539 ///The `String` lang item.
540 String,
541 ///The `CStr` lang item.
542 CStr,
543 ///The `contract_build_check_ensures` lang item.
544 ContractBuildCheckEnsures,
545 ///The `contract_check_requires` lang item.
546 ContractCheckRequires,
547 ///The `default_trait4` lang item.
548 DefaultTrait4,
549 ///The `default_trait3` lang item.
550 DefaultTrait3,
551 ///The `default_trait2` lang item.
552 DefaultTrait2,
553 ///The `default_trait1` lang item.
554 DefaultTrait1,
555 ///The `contract_check_ensures` lang item.
556 ContractCheckEnsures,
557 ///The `reborrow` lang item.
558 Reborrow,
559 ///The `coerce_shared` lang item.
560 CoerceShared,
561 ///The `field_representing_type` lang item.
562 FieldRepresentingType,
563 ///The `field` lang item.
564 Field,
565 ///The `field_base` lang item.
566 FieldBase,
567 ///The `field_type` lang item.
568 FieldType,
569 ///The `field_offset` lang item.
570 FieldOffset,
571 ///The `From` lang item.
572 From,
573 ///The `from` lang item.
574 FromFn,
575}
576
577#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Drive, DriveMut)]
578#[cfg_attr(feature = "charon_on_charon", charon::rename("RustcDeprecation"))]
579pub struct Deprecation {
580 pub since: DeprecatedSince,
581 /// The note to issue a reason.
582 pub note: Option<Ident>,
583 /// A text snippet used to completely replace any use of the deprecated item in an expression.
584 ///
585 /// This is currently unstable.
586 pub suggestion: Option<Ustr>,
587}
588
589#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Drive, DriveMut)]
590#[cfg_attr(feature = "charon_on_charon", charon::rename("RustcInlineAttr"))]
591#[cfg_attr(
592 feature = "charon_on_charon",
593 charon::variants_prefix("RustcInlineAttr")
594)]
595pub enum InlineAttr {
596 None,
597 Hint,
598 Always,
599 Never,
600 /// `#[rustc_force_inline]` forces inlining to happen in the MIR inliner - it reports an error
601 /// if the inlining cannot happen. It is limited to only free functions so that the calls
602 /// can always be resolved.
603 Force {
604 attr_span: Span,
605 reason: Option<Ustr>,
606 },
607}
608
609#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Drive, DriveMut)]
610#[cfg_attr(feature = "charon_on_charon", charon::rename("RustcOptimizeAttr"))]
611#[cfg_attr(
612 feature = "charon_on_charon",
613 charon::variants_prefix("RustcOptimizeAttr")
614)]
615pub enum OptimizeAttr {
616 /// No `#[optimize(..)]` attribute
617 Default,
618 /// `#[optimize(none)]`
619 DoNotOptimize,
620 /// `#[optimize(speed)]`
621 Speed,
622 /// `#[optimize(size)]`
623 Size,
624}
625
626/// Release in which an API is deprecated.
627#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Drive, DriveMut)]
628#[cfg_attr(feature = "charon_on_charon", charon::rename("RustcDeprecatedSince"))]
629#[cfg_attr(
630 feature = "charon_on_charon",
631 charon::variants_prefix("RustcDeprecatedSince")
632)]
633pub enum DeprecatedSince {
634 RustcVersion(RustcVersion),
635 /// Deprecated in the future ("to be determined").
636 Future,
637 /// `feature(staged_api)` is off. Deprecation versions outside the standard
638 /// library are allowed to be arbitrary strings, for better or worse.
639 NonStandard(Ustr),
640 /// Deprecation version is unspecified but optional.
641 Unspecified,
642 /// Failed to parse a deprecation version, or the deprecation version is
643 /// unspecified and required. An error has already been emitted.
644 Err,
645}
646
647#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Drive, DriveMut)]
648#[cfg_attr(feature = "charon_on_charon", charon::rename("RustcIdent"))]
649pub struct Ident {
650 /// `name` should never be the empty symbol. If you are considering that,
651 /// you are probably conflating "empty identifier with "no identifier" and
652 /// you should use `Option<Ident>` instead.
653 /// Trying to construct an `Ident` with an empty name will trigger debug assertions.
654 pub name: Ustr,
655 pub span: Span,
656}
657
658#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Drive, DriveMut)]
659#[cfg_attr(feature = "charon_on_charon", charon::rename("RustcRustcVersion"))]
660pub struct RustcVersion {
661 pub major: u16,
662 pub minor: u16,
663 pub patch: u16,
664}