Skip to content

Commit

Permalink
Update error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbembenek committed Jan 17, 2023
1 parent e7658ce commit b9e314c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions kani-compiler/src/kani_middle/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use std::collections::VecDeque;

use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_INDEX};
use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
use rustc_hir::{ItemKind, UseKind};
use rustc_middle::ty::TyCtxt;

Expand Down Expand Up @@ -217,7 +217,7 @@ fn resolve_in_foreign_module(
fn module_to_string(tcx: TyCtxt, current_module: LocalDefId) -> String {
let def_id = current_module.to_def_id();
if def_id.is_crate_root() {
"crate root".to_string()
format!("module `{}`", tcx.crate_name(LOCAL_CRATE))
} else {
format!("module `{}`", tcx.def_path_str(def_id))
}
Expand Down
2 changes: 1 addition & 1 deletion tests/expected/stubbing-ambiguous-path/expected
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: glob imports in local crate root make it impossible to unambiguously resolve path; the possibilities are:\
error: glob imports in local module `main` make it impossible to unambiguously resolve path; the possibilities are:\
mod1::foo\
mod2::foo

Expand Down

0 comments on commit b9e314c

Please sign in to comment.