diff options
| author | Bryanskiy <ivakin.kir@gmail.com> | 2024-09-30 21:07:36 +0300 |
|---|---|---|
| committer | Bryanskiy <ivakin.kir@gmail.com> | 2025-05-04 22:03:15 +0300 |
| commit | 14535312b522c0524dd94633cc6a49992b12cecd (patch) | |
| tree | f397262aa2e597623ac7dc9a721da0360398808d /compiler/rustc_passes/src/lang_items.rs | |
| parent | 62c5f58f57670ce65e7fec34f8c4ba00c27da2d9 (diff) | |
| download | rust-14535312b522c0524dd94633cc6a49992b12cecd.tar.gz rust-14535312b522c0524dd94633cc6a49992b12cecd.zip | |
Initial support for dynamically linked crates
Diffstat (limited to 'compiler/rustc_passes/src/lang_items.rs')
| -rw-r--r-- | compiler/rustc_passes/src/lang_items.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/rustc_passes/src/lang_items.rs b/compiler/rustc_passes/src/lang_items.rs index 664bd4ad0a2..275714c2d0e 100644 --- a/compiler/rustc_passes/src/lang_items.rs +++ b/compiler/rustc_passes/src/lang_items.rs @@ -19,7 +19,8 @@ use rustc_session::cstore::ExternCrate; use rustc_span::Span; use crate::errors::{ - DuplicateLangItem, IncorrectTarget, LangItemOnIncorrectTarget, UnknownLangItem, + DuplicateLangItem, IncorrectCrateType, IncorrectTarget, LangItemOnIncorrectTarget, + UnknownLangItem, }; use crate::weak_lang_items; @@ -236,6 +237,10 @@ impl<'ast, 'tcx> LanguageItemCollector<'ast, 'tcx> { } } + if self.tcx.crate_types().contains(&rustc_session::config::CrateType::Sdylib) { + self.tcx.dcx().emit_err(IncorrectCrateType { span: attr_span }); + } + self.collect_item(lang_item, item_def_id.to_def_id(), Some(item_span)); } } |
