Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/rustc_passes/src/eii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ enum CheckingMode {
}

fn get_checking_mode(tcx: TyCtxt<'_>) -> CheckingMode {
// if any of the crate types is not rlib or dylib, we must check for existence.
if tcx.crate_types().iter().any(|i| !matches!(i, CrateType::Rlib | CrateType::Dylib)) {
// if any of the crate types is not rlib, we must check for existence.
if tcx.crate_types().iter().any(|i| !matches!(i, CrateType::Rlib)) {
CheckingMode::CheckExistence
} else {
CheckingMode::CheckDuplicates
Expand Down
7 changes: 7 additions & 0 deletions tests/ui/eii/dylib_needs_impl.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@ no-prefer-dynamic
//@ needs-crate-type: dylib
#![crate_type = "dylib"]
#![feature(extern_item_impls)]

#[eii(eii1)] //~ ERROR `#[eii1]` required, but not found
fn decl1(x: u64);
10 changes: 10 additions & 0 deletions tests/ui/eii/dylib_needs_impl.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
error: `#[eii1]` required, but not found
--> $DIR/dylib_needs_impl.rs:6:7
|
LL | #[eii(eii1)]
| ^^^^ expected because `#[eii1]` was declared here in crate `dylib_needs_impl`
|
= help: expected at least one implementation in crate `dylib_needs_impl` or any of its dependencies

error: aborting due to 1 previous error

Loading