Skip to content

Commit

Permalink
fix: bless ui test output
Browse files Browse the repository at this point in the history
  • Loading branch information
BD103 committed Dec 13, 2024
1 parent 0460c54 commit 0eb2b4b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
24 changes: 24 additions & 0 deletions tools/compile_fail_utils/tests/example_tests/basic_test.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Compiler warnings also need to be annotated. We don't
// want to annotate all the unused variables so let's instruct
// the compiler to ignore them.
#![allow(unused_variables)]

fn bad_moves() {
let x = String::new();
// Help diagnostics need to be annotated
let y = x.clone();
//~^ HELP: consider cloning

// We expect a failure on this line
println!("{x}"); //~ ERROR: borrow


let x = String::new();
// We expect the help message to mention cloning.
//~v HELP: consider cloning
let y = x.clone();

// Check error message using a regex
println!("{x}");
//~^ ERROR: /(move)|(borrow)/
}
6 changes: 3 additions & 3 deletions tools/compile_fail_utils/tests/example_tests/import.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ error[E0599]: no function or associated item named `this_function_does_not_exist
note: if you're trying to build a new `Config` consider using one of the following associated functions:
Config::rustc
Config::cargo
--> $RUSTUP_HOME/.cargo/git/checkouts/ui_test-2b82183a391bb05c/680bb08/src/config.rs:63:5
--> $RUSTUP_HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ui_test-0.23.0/src/config.rs:70:5
|
63 | pub fn rustc(root_dir: impl Into<PathBuf>) -> Self {
70 | pub fn rustc(root_dir: impl Into<PathBuf>) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
108 | pub fn cargo(root_dir: impl Into<PathBuf>) -> Self {
221 | pub fn cargo(root_dir: impl Into<PathBuf>) -> Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error
Expand Down

0 comments on commit 0eb2b4b

Please sign in to comment.