Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a570c97

Browse files
committedFeb 11, 2025·
Initial support for dynamically linked crates
1 parent 69482e8 commit a570c97

File tree

89 files changed

+1983
-191
lines changed

Some content is hidden

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

89 files changed

+1983
-191
lines changed
 

‎Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4011,6 +4011,7 @@ dependencies = [
40114011
"rustc_fs_util",
40124012
"rustc_hir",
40134013
"rustc_hir_analysis",
4014+
"rustc_hir_pretty",
40144015
"rustc_hir_typeck",
40154016
"rustc_incremental",
40164017
"rustc_lint",

‎compiler/rustc_ast/src/ast.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3192,6 +3192,7 @@ impl Item {
31923192
pub fn opt_generics(&self) -> Option<&Generics> {
31933193
match &self.kind {
31943194
ItemKind::ExternCrate(_)
3195+
| ItemKind::ExternDynCrate(_)
31953196
| ItemKind::Use(_)
31963197
| ItemKind::Mod(_, _)
31973198
| ItemKind::ForeignMod(_)
@@ -3407,6 +3408,10 @@ pub enum ItemKind {
34073408
///
34083409
/// E.g., `extern crate foo` or `extern crate foo_bar as foo`.
34093410
ExternCrate(Option<Symbol>),
3411+
/// An extern crate with a stable interface.
3412+
///
3413+
/// E.g., `extern dyn crate foo` or `extern dyn crate foo_bar as foo`.
3414+
ExternDynCrate(Option<Symbol>),
34103415
/// A use declaration item (`use`).
34113416
///
34123417
/// E.g., `use foo;`, `use foo::bar;` or `use foo::bar as FooBar;`.
@@ -3488,13 +3493,19 @@ impl ItemKind {
34883493
Use(..) | Static(..) | Const(..) | Fn(..) | Mod(..) | GlobalAsm(..) | TyAlias(..)
34893494
| Struct(..) | Union(..) | Trait(..) | TraitAlias(..) | MacroDef(..)
34903495
| Delegation(..) | DelegationMac(..) => "a",
3491-
ExternCrate(..) | ForeignMod(..) | MacCall(..) | Enum(..) | Impl { .. } => "an",
3496+
ExternCrate(..)
3497+
| ExternDynCrate(..)
3498+
| ForeignMod(..)
3499+
| MacCall(..)
3500+
| Enum(..)
3501+
| Impl { .. } => "an",
34923502
}
34933503
}
34943504

34953505
pub fn descr(&self) -> &'static str {
34963506
match self {
34973507
ItemKind::ExternCrate(..) => "extern crate",
3508+
ItemKind::ExternDynCrate(..) => "extern dyn crate",
34983509
ItemKind::Use(..) => "`use` import",
34993510
ItemKind::Static(..) => "static item",
35003511
ItemKind::Const(..) => "constant item",

0 commit comments

Comments
 (0)
Please sign in to comment.