Skip to content

Commit

Permalink
rewrite use-suggestions-rust-2018 to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jun 26, 2024
1 parent 4bdf8d2 commit bfc8dc8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ run-make/translation/Makefile
run-make/type-mismatch-same-crate-name/Makefile
run-make/unknown-mod-stdin/Makefile
run-make/unstable-flag-required/Makefile
run-make/use-suggestions-rust-2018/Makefile
run-make/used-cdylib-macos/Makefile
run-make/volatile-intrinsics/Makefile
run-make/wasm-exceptions-nostd/Makefile
Expand Down
7 changes: 0 additions & 7 deletions tests/run-make/use-suggestions-rust-2018/Makefile

This file was deleted.

18 changes: 18 additions & 0 deletions tests/run-make/use-suggestions-rust-2018/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// The compilation error caused by calling on an unimported crate
// should have a suggestion to write, say, crate::bar::Foo instead
// of just bar::Foo. However, this suggestion used to only appear for
// extern crate statements, not crate struct. After this was fixed in #51456,
// this test checks that the correct suggestion is printed no matter what.
// See https://github.com/rust-lang/rust/issues/51212

use run_make_support::{rust_lib_name, rustc};

fn main() {
rustc().input("ep-nested-lib.rs").run();
rustc()
.input("use-suggestions.rs")
.edition("2018")
.extern_("ep_nested_lib", rust_lib_name("ep_nested_lib"))
.run_fail()
.assert_stderr_contains("use ep_nested_lib::foo::bar::Baz");
}

0 comments on commit bfc8dc8

Please sign in to comment.