Skip to content

Commit 314c2b1

Browse files
committed
Adjust dependency-resolution errors to be more consistent
1 parent 779041c commit 314c2b1

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/librustc/middle/dependency_format.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
161161
if tcx.dep_kind(cnum).macros_only() { continue }
162162
let src = tcx.used_crate_source(cnum);
163163
if src.rlib.is_some() { continue }
164-
sess.err(&format!("dependency `{}` not found in rlib format",
164+
sess.err(&format!("crate `{}` required to be available in rlib format, \
165+
but was not found in this form",
165166
tcx.crate_name(cnum)));
166167
}
167168
return Vec::new();
@@ -244,10 +245,9 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
244245
Linkage::Static => "rlib",
245246
_ => "dylib",
246247
};
247-
let name = tcx.crate_name(cnum);
248-
sess.err(&format!("crate `{}` required to be available in {}, \
249-
but it was not available in this form",
250-
name, kind));
248+
sess.err(&format!("crate `{}` required to be available in {} format, \
249+
but was not found in this form",
250+
tcx.crate_name(cnum), kind));
251251
}
252252
}
253253
}

src/test/compile-fail/cdylib-deps-must-be-static.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: dependency `cdylib_dep` not found in rlib format
11+
// error-pattern: crate `cdylib_dep` required to be available in rlib format, but was not found
1212
// aux-build:cdylib-dep.rs
1313
// ignore-musl
1414
// ignore-emscripten

src/test/compile-fail/rmeta_lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// aux-build:rmeta_meta.rs
1212
// no-prefer-dynamic
13-
// error-pattern: crate `rmeta_meta` required to be available in rlib, but it was not available
13+
// error-pattern: crate `rmeta_meta` required to be available in rlib format, but was not found
1414

1515
// Check that building a non-metadata crate fails if a dependent crate is
1616
// metadata-only.

0 commit comments

Comments
 (0)