From 2b25738b01cfccbc29b75b8e20b01ff2ad3bd730 Mon Sep 17 00:00:00 2001 From: jyn Date: Sat, 9 Dec 2023 08:40:55 -0500 Subject: [PATCH] wip: use different revisions for testing colors on windows this just uses the same file for windows and linux right now lol --- .../highlighting.not-windows.stderr | 22 +++++++++ tests/ui/error-emitter/highlighting.rs | 1 + tests/ui/error-emitter/highlighting.stderr | 22 --------- .../error-emitter/highlighting.windows.stderr | 22 +++++++++ ...ne-multipart-suggestion.not-windows.stderr | 46 +++++++++++++++++++ .../multiline-multipart-suggestion.rs | 2 +- .../multiline-multipart-suggestion.stderr | 46 ------------------- ...tiline-multipart-suggestion.windows.stderr | 46 +++++++++++++++++++ 8 files changed, 138 insertions(+), 69 deletions(-) create mode 100644 tests/ui/error-emitter/highlighting.not-windows.stderr delete mode 100644 tests/ui/error-emitter/highlighting.stderr create mode 100644 tests/ui/error-emitter/highlighting.windows.stderr create mode 100644 tests/ui/error-emitter/multiline-multipart-suggestion.not-windows.stderr delete mode 100644 tests/ui/error-emitter/multiline-multipart-suggestion.stderr create mode 100644 tests/ui/error-emitter/multiline-multipart-suggestion.windows.stderr diff --git a/tests/ui/error-emitter/highlighting.not-windows.stderr b/tests/ui/error-emitter/highlighting.not-windows.stderr new file mode 100644 index 0000000000000..cc10015ed6ffe --- /dev/null +++ b/tests/ui/error-emitter/highlighting.not-windows.stderr @@ -0,0 +1,22 @@ +error[E0308]: mismatched types + --> $DIR/highlighting.rs:23:11 + | +LL |  query(wrapped_fn); + |  ----- ^^^^^^^^^^ one type is more general than the other + |  | + |  arguments to this function are incorrect + | + = note: expected fn pointer `for<'a> fn(Box<(dyn Any + Send + 'a)>) -> Pin<_>` + found fn item `fn(Box<(dyn Any + Send + 'static)>) -> Pin<_> {wrapped_fn}` +note: function defined here + --> $DIR/highlighting.rs:12:4 + | +LL | fn query(_: fn(Box<(dyn Any + Send + '_)>) -> Pin, String>> + Send + 'static +LL | | )>>) {} + | |___- + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/error-emitter/highlighting.rs b/tests/ui/error-emitter/highlighting.rs index f7c15100fed78..5486158a6f630 100644 --- a/tests/ui/error-emitter/highlighting.rs +++ b/tests/ui/error-emitter/highlighting.rs @@ -1,6 +1,7 @@ // Make sure "highlighted" code is colored purple // compile-flags: --error-format=human --color=always +// revisions: windows not-windows // error-pattern:for<'a>  // edition:2018 diff --git a/tests/ui/error-emitter/highlighting.stderr b/tests/ui/error-emitter/highlighting.stderr deleted file mode 100644 index 12a1caa6ef315..0000000000000 --- a/tests/ui/error-emitter/highlighting.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/highlighting.rs:22:11 - | -LL |  query(wrapped_fn); - |  ----- ^^^^^^^^^^ one type is more general than the other - |  | - |  arguments to this function are incorrect - | - = note: expected fn pointer `for<'a> fn(Box<(dyn Any + Send + 'a)>) -> Pin<_>` - found fn item `fn(Box<(dyn Any + Send + 'static)>) -> Pin<_> {wrapped_fn}` -note: function defined here - --> $DIR/highlighting.rs:11:4 - | -LL | fn query(_: fn(Box<(dyn Any + Send + '_)>) -> Pin, String>> + Send + 'static -LL | | )>>) {} - | |___- - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/error-emitter/highlighting.windows.stderr b/tests/ui/error-emitter/highlighting.windows.stderr new file mode 100644 index 0000000000000..cc10015ed6ffe --- /dev/null +++ b/tests/ui/error-emitter/highlighting.windows.stderr @@ -0,0 +1,22 @@ +error[E0308]: mismatched types + --> $DIR/highlighting.rs:23:11 + | +LL |  query(wrapped_fn); + |  ----- ^^^^^^^^^^ one type is more general than the other + |  | + |  arguments to this function are incorrect + | + = note: expected fn pointer `for<'a> fn(Box<(dyn Any + Send + 'a)>) -> Pin<_>` + found fn item `fn(Box<(dyn Any + Send + 'static)>) -> Pin<_> {wrapped_fn}` +note: function defined here + --> $DIR/highlighting.rs:12:4 + | +LL | fn query(_: fn(Box<(dyn Any + Send + '_)>) -> Pin, String>> + Send + 'static +LL | | )>>) {} + | |___- + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/error-emitter/multiline-multipart-suggestion.not-windows.stderr b/tests/ui/error-emitter/multiline-multipart-suggestion.not-windows.stderr new file mode 100644 index 0000000000000..75e2ebc6078f3 --- /dev/null +++ b/tests/ui/error-emitter/multiline-multipart-suggestion.not-windows.stderr @@ -0,0 +1,46 @@ +error[E0106]: missing lifetime specifier + --> $DIR/multiline-multipart-suggestion.rs:5:34 + | +LL | fn short(foo_bar: &Vec<&i32>) -> &i32 { + |  ---------- ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say which one of `foo_bar`'s 2 lifetimes it is borrowed from +help: consider introducing a named lifetime parameter + | +LL | fn short<'a>(foo_bar: &'a Vec<&'a i32>) -> &'a i32 { + | ++++ ++ ++ ++ + +error[E0106]: missing lifetime specifier + --> $DIR/multiline-multipart-suggestion.rs:12:6 + | +LL |  foo_bar: &Vec<&i32>, + |  ---------- +LL |  something_very_long_so_that_the_line_will_wrap_around__________: i32, +LL | ) -> &i32 { + |  ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say which one of `foo_bar`'s 2 lifetimes it is borrowed from +help: consider introducing a named lifetime parameter + | +LL ~ fn long<'a>( +LL ~  foo_bar: &'a Vec<&'a i32>, +LL |  something_very_long_so_that_the_line_will_wrap_around__________: i32, +LL ~ ) -> &'a i32 { + | + +error[E0106]: missing lifetime specifier + --> $DIR/multiline-multipart-suggestion.rs:17:29 + | +LL |  foo_bar: &Vec<&i32>) -> &i32 { + |  ---------- ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say which one of `foo_bar`'s 2 lifetimes it is borrowed from +help: consider introducing a named lifetime parameter + | +LL ~ fn long2<'a>( +LL ~  foo_bar: &'a Vec<&'a i32>) -> &'a i32 { + | + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0106`. diff --git a/tests/ui/error-emitter/multiline-multipart-suggestion.rs b/tests/ui/error-emitter/multiline-multipart-suggestion.rs index 5532fe3d6f779..c9c92ae795ed6 100644 --- a/tests/ui/error-emitter/multiline-multipart-suggestion.rs +++ b/tests/ui/error-emitter/multiline-multipart-suggestion.rs @@ -1,6 +1,6 @@ // compile-flags: --error-format=human --color=always // error-pattern: missing lifetime specifier -// ignore-windows +// revisions: windows not-windows fn short(foo_bar: &Vec<&i32>) -> &i32 { &12 diff --git a/tests/ui/error-emitter/multiline-multipart-suggestion.stderr b/tests/ui/error-emitter/multiline-multipart-suggestion.stderr deleted file mode 100644 index 7f418fe8ad1eb..0000000000000 --- a/tests/ui/error-emitter/multiline-multipart-suggestion.stderr +++ /dev/null @@ -1,46 +0,0 @@ -error[E0106]: missing lifetime specifier - --> $DIR/multiline-multipart-suggestion.rs:5:34 - | -LL | fn short(foo_bar: &Vec<&i32>) -> &i32 { - |  ---------- ^ expected named lifetime parameter - | - = help: this function's return type contains a borrowed value, but the signature does not say which one of `foo_bar`'s 2 lifetimes it is borrowed from -help: consider introducing a named lifetime parameter - | -LL | fn short<'a>(foo_bar: &'a Vec<&'a i32>) -> &'a i32 { - | ++++ ++ ++ ++ - -error[E0106]: missing lifetime specifier - --> $DIR/multiline-multipart-suggestion.rs:12:6 - | -LL |  foo_bar: &Vec<&i32>, - |  ---------- -LL |  something_very_long_so_that_the_line_will_wrap_around__________: i32, -LL | ) -> &i32 { - |  ^ expected named lifetime parameter - | - = help: this function's return type contains a borrowed value, but the signature does not say which one of `foo_bar`'s 2 lifetimes it is borrowed from -help: consider introducing a named lifetime parameter - | -LL ~ fn long<'a>( -LL ~  foo_bar: &'a Vec<&'a i32>, -LL |  something_very_long_so_that_the_line_will_wrap_around__________: i32, -LL ~ ) -> &'a i32 { - | - -error[E0106]: missing lifetime specifier - --> $DIR/multiline-multipart-suggestion.rs:17:29 - | -LL |  foo_bar: &Vec<&i32>) -> &i32 { - |  ---------- ^ expected named lifetime parameter - | - = help: this function's return type contains a borrowed value, but the signature does not say which one of `foo_bar`'s 2 lifetimes it is borrowed from -help: consider introducing a named lifetime parameter - | -LL ~ fn long2<'a>( -LL ~  foo_bar: &'a Vec<&'a i32>) -> &'a i32 { - | - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0106`. diff --git a/tests/ui/error-emitter/multiline-multipart-suggestion.windows.stderr b/tests/ui/error-emitter/multiline-multipart-suggestion.windows.stderr new file mode 100644 index 0000000000000..75e2ebc6078f3 --- /dev/null +++ b/tests/ui/error-emitter/multiline-multipart-suggestion.windows.stderr @@ -0,0 +1,46 @@ +error[E0106]: missing lifetime specifier + --> $DIR/multiline-multipart-suggestion.rs:5:34 + | +LL | fn short(foo_bar: &Vec<&i32>) -> &i32 { + |  ---------- ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say which one of `foo_bar`'s 2 lifetimes it is borrowed from +help: consider introducing a named lifetime parameter + | +LL | fn short<'a>(foo_bar: &'a Vec<&'a i32>) -> &'a i32 { + | ++++ ++ ++ ++ + +error[E0106]: missing lifetime specifier + --> $DIR/multiline-multipart-suggestion.rs:12:6 + | +LL |  foo_bar: &Vec<&i32>, + |  ---------- +LL |  something_very_long_so_that_the_line_will_wrap_around__________: i32, +LL | ) -> &i32 { + |  ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say which one of `foo_bar`'s 2 lifetimes it is borrowed from +help: consider introducing a named lifetime parameter + | +LL ~ fn long<'a>( +LL ~  foo_bar: &'a Vec<&'a i32>, +LL |  something_very_long_so_that_the_line_will_wrap_around__________: i32, +LL ~ ) -> &'a i32 { + | + +error[E0106]: missing lifetime specifier + --> $DIR/multiline-multipart-suggestion.rs:17:29 + | +LL |  foo_bar: &Vec<&i32>) -> &i32 { + |  ---------- ^ expected named lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say which one of `foo_bar`'s 2 lifetimes it is borrowed from +help: consider introducing a named lifetime parameter + | +LL ~ fn long2<'a>( +LL ~  foo_bar: &'a Vec<&'a i32>) -> &'a i32 { + | + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0106`.