Skip to content

Commit

Permalink
Update rustdoc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Sep 13, 2022
1 parent ff02ecc commit 7482e5b
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 14 deletions.
9 changes: 9 additions & 0 deletions src/test/rustdoc-ui/intra-doc/malformed-generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@
//! [Vec<] //~ ERROR
//! [Vec<Box<T] //~ ERROR
//! [Vec<Box<T>] //~ ERROR
//~^ WARN
//! [Vec<Box<T>>>] //~ ERROR
//~^ WARN
//! [Vec<T>>>] //~ ERROR
//~^ WARN
//! [<Vec] //~ ERROR
//! [Vec::<] //~ ERROR
//! [<T>] //~ ERROR
//~^ WARN
//! [<invalid syntax>] //~ ERROR
//~^ WARN
//! [Vec:<T>:new()] //~ ERROR
//~^ WARN
//! [Vec<<T>>] //~ ERROR
//~^ WARN
//! [Vec<>] //~ ERROR
//! [Vec<<>>] //~ ERROR
// FIXME(#74563) support UFCS
//! [<Vec as IntoIterator>::into_iter] //~ ERROR
//~^ WARN
//! [<Vec<T> as IntoIterator>::iter] //~ ERROR
//~^ WARN
82 changes: 69 additions & 13 deletions src/test/rustdoc-ui/intra-doc/malformed-generics.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -23,80 +23,136 @@ LL | //! [Vec<Box<T>]
| ^^^^^^^^^^ unbalanced angle brackets

error: unresolved link to `Vec<Box<T>>>`
--> $DIR/malformed-generics.rs:6:6
--> $DIR/malformed-generics.rs:7:6
|
LL | //! [Vec<Box<T>>>]
| ^^^^^^^^^^^^ unbalanced angle brackets

error: unresolved link to `Vec<T>>>`
--> $DIR/malformed-generics.rs:7:6
--> $DIR/malformed-generics.rs:9:6
|
LL | //! [Vec<T>>>]
| ^^^^^^^^ unbalanced angle brackets

error: unresolved link to `<Vec`
--> $DIR/malformed-generics.rs:8:6
--> $DIR/malformed-generics.rs:11:6
|
LL | //! [<Vec]
| ^^^^ unbalanced angle brackets

error: unresolved link to `Vec::<`
--> $DIR/malformed-generics.rs:9:6
--> $DIR/malformed-generics.rs:12:6
|
LL | //! [Vec::<]
| ^^^^^^ unbalanced angle brackets

error: unresolved link to `<T>`
--> $DIR/malformed-generics.rs:10:6
--> $DIR/malformed-generics.rs:13:6
|
LL | //! [<T>]
| ^^^ missing type for generic parameters

error: unresolved link to `<invalid syntax>`
--> $DIR/malformed-generics.rs:11:6
--> $DIR/malformed-generics.rs:15:6
|
LL | //! [<invalid syntax>]
| ^^^^^^^^^^^^^^^^ missing type for generic parameters

error: unresolved link to `Vec:<T>:new`
--> $DIR/malformed-generics.rs:12:6
--> $DIR/malformed-generics.rs:17:6
|
LL | //! [Vec:<T>:new()]
| ^^^^^^^^^^^^^ has invalid path separator

error: unresolved link to `Vec<<T>>`
--> $DIR/malformed-generics.rs:13:6
--> $DIR/malformed-generics.rs:19:6
|
LL | //! [Vec<<T>>]
| ^^^^^^^^ too many angle brackets

error: unresolved link to `Vec<>`
--> $DIR/malformed-generics.rs:14:6
--> $DIR/malformed-generics.rs:21:6
|
LL | //! [Vec<>]
| ^^^^^ empty angle brackets

error: unresolved link to `Vec<<>>`
--> $DIR/malformed-generics.rs:15:6
--> $DIR/malformed-generics.rs:22:6
|
LL | //! [Vec<<>>]
| ^^^^^^^ too many angle brackets

error: unresolved link to `<Vec as IntoIterator>::into_iter`
--> $DIR/malformed-generics.rs:18:6
--> $DIR/malformed-generics.rs:25:6
|
LL | //! [<Vec as IntoIterator>::into_iter]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ fully-qualified syntax is unsupported
|
= note: see https://github.com/rust-lang/rust/issues/74563 for more information

error: unresolved link to `<Vec<T> as IntoIterator>::iter`
--> $DIR/malformed-generics.rs:19:6
--> $DIR/malformed-generics.rs:27:6
|
LL | //! [<Vec<T> as IntoIterator>::iter]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ fully-qualified syntax is unsupported
|
= note: see https://github.com/rust-lang/rust/issues/74563 for more information

error: aborting due to 15 previous errors
warning: unclosed HTML tag `T`
--> $DIR/malformed-generics.rs:5:13
|
LL | //! [Vec<Box<T>]
| ^^^
|
= note: `#[warn(rustdoc::invalid_html_tags)]` on by default

warning: unclosed HTML tag `T`
--> $DIR/malformed-generics.rs:7:13
|
LL | //! [Vec<Box<T>>>]
| ^^^

warning: unclosed HTML tag `T`
--> $DIR/malformed-generics.rs:9:9
|
LL | //! [Vec<T>>>]
| ^^^

warning: unclosed HTML tag `T`
--> $DIR/malformed-generics.rs:13:6
|
LL | //! [<T>]
| ^^^

warning: unclosed HTML tag `invalid`
--> $DIR/malformed-generics.rs:15:6
|
LL | //! [<invalid syntax>]
| ^^^^^^^^

warning: unclosed HTML tag `T`
--> $DIR/malformed-generics.rs:17:10
|
LL | //! [Vec:<T>:new()]
| ^^^

warning: unclosed HTML tag `T`
--> $DIR/malformed-generics.rs:19:10
|
LL | //! [Vec<<T>>]
| ^^^

warning: unclosed HTML tag `Vec`
--> $DIR/malformed-generics.rs:25:6
|
LL | //! [<Vec as IntoIterator>::into_iter]
| ^^^^

warning: unclosed HTML tag `T`
--> $DIR/malformed-generics.rs:27:10
|
LL | //! [<Vec<T> as IntoIterator>::iter]
| ^^^

error: aborting due to 15 previous errors; 9 warnings emitted

Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
//! [`empty`]
// @has - '//a[@href="../empty2/index.html"]' 'empty2'
//! [empty2<x>]
//! [`empty2<x>`]

0 comments on commit 7482e5b

Please sign in to comment.