From 1ec92c8fb8887b468d47e8e417605ab13a7800e9 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Wed, 14 Sep 2022 13:41:29 -0700 Subject: [PATCH] rustdoc: add test cases for turning ``[Vec]`` into ``[`Vec`]`` --- .../suggestions/html-as-generics.fixed | 10 ++++++++ .../suggestions/html-as-generics.rs | 10 ++++++++ .../suggestions/html-as-generics.stderr | 24 ++++++++++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/test/rustdoc-ui/suggestions/html-as-generics.fixed b/src/test/rustdoc-ui/suggestions/html-as-generics.fixed index 07c8c9ff254..003542d3855 100644 --- a/src/test/rustdoc-ui/suggestions/html-as-generics.fixed +++ b/src/test/rustdoc-ui/suggestions/html-as-generics.fixed @@ -70,3 +70,13 @@ pub struct NestedGenericsWithPunct; //~^ ERROR unclosed HTML tag `i32` //~|HELP try marking as source pub struct NestedGenericsWithPunct2; + +/// This [`Vec`] thing! +//~^ERROR unclosed HTML tag `i32` +//~|HELP try marking as source +pub struct IntraDocLink; + +/// This [`Vec::`] thing! +//~^ERROR unclosed HTML tag `i32` +//~|HELP try marking as source +pub struct IntraDocLinkTurbofish; diff --git a/src/test/rustdoc-ui/suggestions/html-as-generics.rs b/src/test/rustdoc-ui/suggestions/html-as-generics.rs index cdd652f397e..4254a660b19 100644 --- a/src/test/rustdoc-ui/suggestions/html-as-generics.rs +++ b/src/test/rustdoc-ui/suggestions/html-as-generics.rs @@ -70,3 +70,13 @@ //~^ ERROR unclosed HTML tag `i32` //~|HELP try marking as source pub struct NestedGenericsWithPunct2; + +/// This [Vec] thing! +//~^ERROR unclosed HTML tag `i32` +//~|HELP try marking as source +pub struct IntraDocLink; + +/// This [Vec::] thing! +//~^ERROR unclosed HTML tag `i32` +//~|HELP try marking as source +pub struct IntraDocLinkTurbofish; diff --git a/src/test/rustdoc-ui/suggestions/html-as-generics.stderr b/src/test/rustdoc-ui/suggestions/html-as-generics.stderr index 211dd4210d5..481278bdaf9 100644 --- a/src/test/rustdoc-ui/suggestions/html-as-generics.stderr +++ b/src/test/rustdoc-ui/suggestions/html-as-generics.stderr @@ -157,5 +157,27 @@ help: try marking as source code LL | /// Generics with punct `Vec>`! | + + -error: aborting due to 14 previous errors +error: unclosed HTML tag `i32` + --> $DIR/html-as-generics.rs:74:14 + | +LL | /// This [Vec] thing! + | ^^^^^ + | +help: try marking as source code + | +LL | /// This [`Vec`] thing! + | + + + +error: unclosed HTML tag `i32` + --> $DIR/html-as-generics.rs:79:16 + | +LL | /// This [Vec::] thing! + | ^^^^^ + | +help: try marking as source code + | +LL | /// This [`Vec::`] thing! + | + + + +error: aborting due to 16 previous errors