From be71f41aee626c10dec546657047afc57442dff8 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Fri, 5 May 2023 13:29:41 -0700 Subject: [PATCH] Update tests for 1.71 --- rust/messages.py | 2 ++ rust/themes.py | 1 - tests/error-tests/tests/macro-expansion-inside-1.rs | 2 +- tests/error-tests/tests/macro-expansion-outside-1.rs | 1 + tests/error-tests/tests/macro_expansion_inside_mod1.rs | 2 ++ 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rust/messages.py b/rust/messages.py index 65a30cbe..016b8dfe 100644 --- a/rust/messages.py +++ b/rust/messages.py @@ -1069,6 +1069,8 @@ def find_span_r(span, expansion=None): not _is_external(window, span['file_name']) and \ not span['expansion']['macro_decl_name'].startswith('#['): invoke_span, expansion = find_span_r(span) + # TODO: rustc now emits this in its text output in some cases. + # Consider trying to avoid the duplicate note. add_additional(window, invoke_span, 'in this macro invocation', 'help') if span['is_primary']: diff --git a/rust/themes.py b/rust/themes.py index 4c8ee63c..a3898672 100644 --- a/rust/themes.py +++ b/rust/themes.py @@ -342,7 +342,6 @@ def add_fake(msg, text): } def see_also(path): - print(path) if path.endswith(':external'): return 'See Also (external):' else: diff --git a/tests/error-tests/tests/macro-expansion-inside-1.rs b/tests/error-tests/tests/macro-expansion-inside-1.rs index 65649f2e..acd8c402 100644 --- a/tests/error-tests/tests/macro-expansion-inside-1.rs +++ b/tests/error-tests/tests/macro-expansion-inside-1.rs @@ -6,5 +6,5 @@ mod macro_expansion_inside_mod1; /*BEGIN*/example_bad_syntax!{}/*END*/ // ~HELP(>=1.20.0) in this macro invocation // ~HELP(>=1.20.0,<1.34.0-beta) in this macro invocation -// ~MSG(>=1.20.0) See Primary: macro_expansion_inside_mod1.rs:7 +// ~MSG(>=1.20.0) See Primary: macro_expansion_inside_mod1.rs:8 // ~MSG(>=1.20.0,<1.34.0-beta) See Primary: macro_expansion_inside_mod1.rs:7 diff --git a/tests/error-tests/tests/macro-expansion-outside-1.rs b/tests/error-tests/tests/macro-expansion-outside-1.rs index e8d47550..9efb105f 100644 --- a/tests/error-tests/tests/macro-expansion-outside-1.rs +++ b/tests/error-tests/tests/macro-expansion-outside-1.rs @@ -8,6 +8,7 @@ extern crate dcrate; /*BEGIN*/example_bad_syntax!{}/*END*/ // ^^^^^^^^^^^^^^^^^^^^^HELP(>=1.44.0-beta) in this macro invocation +// ^^^^^^^^^^^^^^^^^^^^^ERR(>=1.71.0-beta) in this macro invocation // ^^^^^^^^^^^^^^^^^^^^^MSG(>=1.44.0-beta) See Primary: lib.rs:20 // ~ERR(>=1.20.0,<1.44.0-beta) /expected one of .*, found `:`/ // ~ERR(>=1.20.0,<1.44.0-beta) this error originates in a macro outside of the current crate diff --git a/tests/error-tests/tests/macro_expansion_inside_mod1.rs b/tests/error-tests/tests/macro_expansion_inside_mod1.rs index 950ff96c..379fb22c 100644 --- a/tests/error-tests/tests/macro_expansion_inside_mod1.rs +++ b/tests/error-tests/tests/macro_expansion_inside_mod1.rs @@ -2,6 +2,7 @@ macro_rules! example_bad_syntax { () => { enum E { +// ^ERR(>=1.71.0-beta) while parsing this enum // This is somewhat of an odd example, since rustc gives two // syntax errors. Kind(x: u32) @@ -12,6 +13,7 @@ macro_rules! example_bad_syntax { // ^ERR(<1.34.0-beta) /expected one of .*, found `:`/ // ^ERR(>=1.18.0,<1.34.0-beta) expected one of // ^MSG(>=1.20.0,<1.34.0-beta) See Also: macro-expansion-inside-1.rs:6 +// ^HELP(>=1.71.0-beta) enum variants can be } } }