Skip to content

Commit

Permalink
Adjust dependency-resolution errors to be more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
smaeul committed Sep 20, 2017
1 parent 779041c commit 314c2b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/librustc/middle/dependency_format.rs
Expand Up @@ -161,7 +161,8 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
if tcx.dep_kind(cnum).macros_only() { continue }
let src = tcx.used_crate_source(cnum);
if src.rlib.is_some() { continue }
sess.err(&format!("dependency `{}` not found in rlib format",
sess.err(&format!("crate `{}` required to be available in rlib format, \
but was not found in this form",
tcx.crate_name(cnum)));
}
return Vec::new();
Expand Down Expand Up @@ -244,10 +245,9 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
Linkage::Static => "rlib",
_ => "dylib",
};
let name = tcx.crate_name(cnum);
sess.err(&format!("crate `{}` required to be available in {}, \
but it was not available in this form",
name, kind));
sess.err(&format!("crate `{}` required to be available in {} format, \
but was not found in this form",
tcx.crate_name(cnum), kind));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/cdylib-deps-must-be-static.rs
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// error-pattern: dependency `cdylib_dep` not found in rlib format
// error-pattern: crate `cdylib_dep` required to be available in rlib format, but was not found
// aux-build:cdylib-dep.rs
// ignore-musl
// ignore-emscripten
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/rmeta_lib.rs
Expand Up @@ -10,7 +10,7 @@

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

// Check that building a non-metadata crate fails if a dependent crate is
// metadata-only.
Expand Down

0 comments on commit 314c2b1

Please sign in to comment.