diff --git a/rust/messages.py b/rust/messages.py index 65a30cb..016b8df 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 4c8ee63..a389867 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 65649f2..acd8c40 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 e8d4755..9efb105 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 950ff96..379fb22 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 } } }