Skip to content

Make test err annotations formatting uniform #103014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/test/rustdoc-ui/intra-doc/ambiguity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ pub mod foo {
pub fn bar() {}
}

/// [`ambiguous`] is ambiguous. //~ERROR `ambiguous`
/// [`ambiguous`] is ambiguous. //~ ERROR `ambiguous`
///
/// [ambiguous] is ambiguous. //~ERROR ambiguous
/// [ambiguous] is ambiguous. //~ ERROR ambiguous
///
/// [`multi_conflict`] is a three-way conflict. //~ERROR `multi_conflict`
/// [`multi_conflict`] is a three-way conflict. //~ ERROR `multi_conflict`
///
/// Ambiguous [type_and_value]. //~ERROR type_and_value
/// Ambiguous [type_and_value]. //~ ERROR type_and_value
///
/// Ambiguous non-implied shortcut link [`foo::bar`]. //~ERROR `foo::bar`
/// Ambiguous non-implied shortcut link [`foo::bar`]. //~ ERROR `foo::bar`
pub struct Docs {}

/// [true] //~ ERROR `true` is both a module and a builtin type
Expand Down
8 changes: 4 additions & 4 deletions src/test/rustdoc-ui/intra-doc/field-ice.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#![deny(rustdoc::broken_intra_doc_links)]
//~^NOTE the lint level is defined here
//~^ NOTE the lint level is defined here

/// [`Foo::bar`]
/// [`Foo::bar()`]
//~^ERROR incompatible link kind for `Foo::bar`
//~|HELP to link to the field, remove the disambiguator
//~|NOTE this link resolved to a field, which is not a function
//~^ ERROR incompatible link kind for `Foo::bar`
//~| HELP to link to the field, remove the disambiguator
//~| NOTE this link resolved to a field, which is not a function
pub struct Foo {
pub bar: u8
}
8 changes: 4 additions & 4 deletions src/test/rustdoc-ui/reference-link-reports-error-once.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
/// And also a [third link][a]
/// And also a [reference link][b]
///
/// Other links to the same target should still emit error: [ref] //~ERROR unresolved link to `ref`
/// Duplicate [ref] //~ERROR unresolved link to `ref`
/// Other links to the same target should still emit error: [ref] //~ ERROR unresolved link to `ref`
/// Duplicate [ref] //~ ERROR unresolved link to `ref`
///
/// Other links to other targets should still emit error: [ref2] //~ERROR unresolved link to `ref2`
/// Duplicate [ref2] //~ERROR unresolved link to `ref2`
/// Other links to other targets should still emit error: [ref2] //~ ERROR unresolved link to `ref2`
/// Duplicate [ref2] //~ ERROR unresolved link to `ref2`
///
/// [a]: ref
//~^ ERROR unresolved link to `ref`
Expand Down
20 changes: 10 additions & 10 deletions src/test/rustdoc-ui/suggestions/html-as-generics-no-suggestions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub struct ConstGeneric;
pub struct MultipleGenerics;

/// This <[u32] as Iterator<Item>> thing!
//~^ERROR unclosed HTML tag `Item`
//~^ ERROR unclosed HTML tag `Item`
// Some forms of fully-qualified path are simultaneously valid HTML tags
// with attributes. They produce an error, but no suggestion, because figuring
// out if this is valid would require parsing the entire path grammar.
Expand All @@ -23,35 +23,35 @@ pub struct MultipleGenerics;
pub struct FullyQualifiedPathsDoNotCount;

/// This <Vec as IntoIter>::Iter thing!
//~^ERROR unclosed HTML tag `Vec`
//~^ ERROR unclosed HTML tag `Vec`
// Some forms of fully-qualified path are simultaneously valid HTML tags
// with attributes. They produce an error, but no suggestion, because figuring
// out if this is valid would require parsing the entire path grammar.
pub struct FullyQualifiedPathsDoNotCount1;

/// This Vec<Vec as IntoIter>::Iter thing!
//~^ERROR unclosed HTML tag `Vec`
//~^ ERROR unclosed HTML tag `Vec`
// Some forms of fully-qualified path are simultaneously valid HTML tags
// with attributes. They produce an error, but no suggestion, because figuring
// out if this is valid would require parsing the entire path grammar.
pub struct FullyQualifiedPathsDoNotCount2;

/// This Vec<Vec as IntoIter> thing!
//~^ERROR unclosed HTML tag `Vec`
//~^ ERROR unclosed HTML tag `Vec`
// Some forms of fully-qualified path are simultaneously valid HTML tags
// with attributes. They produce an error, but no suggestion, because figuring
// out if this is valid would require parsing the entire path grammar.
pub struct FullyQualifiedPathsDoNotCount3;

/// This Vec<Vec<i32> as IntoIter> thing!
//~^ERROR unclosed HTML tag `i32`
//~^ ERROR unclosed HTML tag `i32`
// Some forms of fully-qualified path are simultaneously valid HTML tags
// with attributes. They produce an error, but no suggestion, because figuring
// out if this is valid would require parsing the entire path grammar.
pub struct FullyQualifiedPathsDoNotCount4;

/// This Vec<i32 class="test"> thing!
//~^ERROR unclosed HTML tag `i32`
//~^ ERROR unclosed HTML tag `i32`
// HTML attributes shouldn't be treated as Rust syntax, so no suggestions.
pub struct TagWithAttributes;

Expand All @@ -60,21 +60,21 @@ pub struct TagWithAttributes;
pub struct DoNotWarnOnMatchingTags;

/// This Vec</i32> thing!
//~^ERROR unopened HTML tag `i32`
//~^ ERROR unopened HTML tag `i32`
// This should produce an error, but no suggestion.
pub struct EndTagsAreNotValidRustSyntax;

/// This 123<i32> thing!
//~^ERROR unclosed HTML tag `i32`
//~^ ERROR unclosed HTML tag `i32`
// This should produce an error, but no suggestion.
pub struct NumbersAreNotPaths;

/// This Vec:<i32> thing!
//~^ERROR unclosed HTML tag `i32`
//~^ ERROR unclosed HTML tag `i32`
// This should produce an error, but no suggestion.
pub struct InvalidTurbofish;

/// This [link](https://rust-lang.org)<i32> thing!
//~^ERROR unclosed HTML tag `i32`
//~^ ERROR unclosed HTML tag `i32`
// This should produce an error, but no suggestion.
pub struct BareTurbofish;
48 changes: 24 additions & 24 deletions src/test/rustdoc-ui/suggestions/html-as-generics.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -2,81 +2,81 @@
#![deny(rustdoc::invalid_html_tags)]

/// This `Vec<i32>` thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct Generic;

/// This `vec::Vec<i32>` thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct GenericPath;

/// This `i32<i32>` thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct PathsCanContainTrailingNumbers;

/// This `Vec::<i32>` thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct Turbofish;

/// This [link](https://rust-lang.org)`::<i32>` thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct BareTurbofish;

/// This <span>`Vec::<i32>`</span> thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct Nested;

/// Nested generics `Vec<Vec<u32>>`
//~^ ERROR unclosed HTML tag `u32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenerics;

/// Generics with path `Vec<i32>::Iter`
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct GenericsWithPath;

/// Generics with path `<Vec<i32>>::Iter`
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenericsWithPath;

/// Generics with path `Vec<Vec<i32>>::Iter`
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenericsWithPath2;

/// Generics with bump `<Vec<i32>>`s
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenericsWithBump;

/// Generics with bump `Vec<Vec<i32>>`s
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenericsWithBump2;

/// Generics with punct `<Vec<i32>>`!
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenericsWithPunct;

/// Generics with punct `Vec<Vec<i32>>`!
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenericsWithPunct2;

/// This [`Vec<i32>`] thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct IntraDocLink;

/// This [`Vec::<i32>`] thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct IntraDocLinkTurbofish;
48 changes: 24 additions & 24 deletions src/test/rustdoc-ui/suggestions/html-as-generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,81 +2,81 @@
#![deny(rustdoc::invalid_html_tags)]

/// This Vec<i32> thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct Generic;

/// This vec::Vec<i32> thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct GenericPath;

/// This i32<i32> thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct PathsCanContainTrailingNumbers;

/// This Vec::<i32> thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct Turbofish;

/// This [link](https://rust-lang.org)::<i32> thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct BareTurbofish;

/// This <span>Vec::<i32></span> thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct Nested;

/// Nested generics Vec<Vec<u32>>
//~^ ERROR unclosed HTML tag `u32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenerics;

/// Generics with path Vec<i32>::Iter
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct GenericsWithPath;

/// Generics with path <Vec<i32>>::Iter
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenericsWithPath;

/// Generics with path Vec<Vec<i32>>::Iter
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenericsWithPath2;

/// Generics with bump <Vec<i32>>s
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenericsWithBump;

/// Generics with bump Vec<Vec<i32>>s
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenericsWithBump2;

/// Generics with punct <Vec<i32>>!
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenericsWithPunct;

/// Generics with punct Vec<Vec<i32>>!
//~^ ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~| HELP try marking as source
pub struct NestedGenericsWithPunct2;

/// This [Vec<i32>] thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct IntraDocLink;

/// This [Vec::<i32>] thing!
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
//~^ ERROR unclosed HTML tag `i32`
//~| HELP try marking as source
pub struct IntraDocLinkTurbofish;
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ declare_lint! {

struct Foo;

impl LintPass for Foo { //~ERROR implementing `LintPass` by hand
impl LintPass for Foo { //~ ERROR implementing `LintPass` by hand
fn name(&self) -> &'static str {
"Foo"
}
Expand All @@ -27,7 +27,7 @@ macro_rules! custom_lint_pass_macro {
() => {
struct Custom;

impl LintPass for Custom { //~ERROR implementing `LintPass` by hand
impl LintPass for Custom { //~ ERROR implementing `LintPass` by hand
fn name(&self) -> &'static str {
"Custom"
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/array-slice-vec/slice-mut-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ fn main() {
let x: &[isize] = &[1, 2, 3, 4, 5];
// Can't mutably slice an immutable slice
let slice: &mut [isize] = &mut [0, 1];
let _ = &mut x[2..4]; //~ERROR cannot borrow `*x` as mutable, as it is behind a `&` reference
let _ = &mut x[2..4]; //~ ERROR cannot borrow `*x` as mutable, as it is behind a `&` reference
}
2 changes: 1 addition & 1 deletion src/test/ui/assoc-inherent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ impl Foo {
}

fn main() {
let x : Foo::Bar; //~ERROR ambiguous associated type
let x : Foo::Bar; //~ ERROR ambiguous associated type
x = 0isize;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ mod bar1 {

fn main() {
assert_eq!(1, bar1::Foo::ID);
//~^ERROR associated constant `ID` is private
//~^ ERROR associated constant `ID` is private
}
2 changes: 1 addition & 1 deletion src/test/ui/associated-type-bounds/issue-71443-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
struct Incorrect;

fn hello<F: for<'a> Iterator<Item: 'a>>() {
Incorrect //~ERROR: mismatched types
Incorrect //~ ERROR: mismatched types
}

fn main() {}
4 changes: 2 additions & 2 deletions src/test/ui/associated-types/associated-types-path-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub trait Bar {
type A;
}

pub fn f1<T>(a: T, x: T::A) {} //~ERROR associated type `A` not found
pub fn f2<T: Foo + Bar>(a: T, x: T::A) {} //~ERROR ambiguous associated type `A`
pub fn f1<T>(a: T, x: T::A) {} //~ ERROR associated type `A` not found
pub fn f2<T: Foo + Bar>(a: T, x: T::A) {} //~ ERROR ambiguous associated type `A`

pub fn main() {}
Loading