Skip to content

Commit

Permalink
fix formatting + test syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
SpanishPear committed Feb 1, 2023
1 parent 70bfcc2 commit a3d32bb
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_parse/src/parser/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ impl<'a> Parser<'a> {

if !self.look_ahead(1, |t| *t == token::Lt) &&
let Ok(snippet) = self.sess.source_map().span_to_snippet(generic.span) {
err.multipart_suggestion_verbose(
err.multipart_suggestion_verbose(
format!("place the generic parameter name after the {ident_name} name"),
vec![
(self.token.span.shrink_to_hi(), snippet),
Expand Down
1 change: 0 additions & 1 deletion tests/ui/parser/suggest_misplaced_generics/enum.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
enum Foo<T> { Variant(T) }
//~^ ERROR expected identifier, found `<`
//~| HELP place the generic parameter name after the enum name
//~| SUGGESTION Foo<T>

fn main() {}
1 change: 0 additions & 1 deletion tests/ui/parser/suggest_misplaced_generics/enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
enum<T> Foo { Variant(T) }
//~^ ERROR expected identifier, found `<`
//~| HELP place the generic parameter name after the enum name
//~| SUGGESTION Foo<T>

fn main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
fn f<'a, B: 'a + std::ops::Add<Output = u32>>(_x: B) { }
//~^ ERROR expected identifier, found `<`
//~| HELP place the generic parameter name after the fn name
//~| SUGGESTION f<'a, B: 'a + std::ops::Add<Output = u32>>

fn main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
fn<'a, B: 'a + std::ops::Add<Output = u32>> f(_x: B) { }
//~^ ERROR expected identifier, found `<`
//~| HELP place the generic parameter name after the fn name
//~| SUGGESTION f<'a, B: 'a + std::ops::Add<Output = u32>>

fn main() {}
1 change: 0 additions & 1 deletion tests/ui/parser/suggest_misplaced_generics/fn-simple.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
fn id<T>(x: T) -> T { x }
//~^ ERROR expected identifier, found `<`
//~| HELP place the generic parameter name after the fn name
//~| SUGGESTION id<T>

fn main() {}
1 change: 0 additions & 1 deletion tests/ui/parser/suggest_misplaced_generics/fn-simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
fn<T> id(x: T) -> T { x }
//~^ ERROR expected identifier, found `<`
//~| HELP place the generic parameter name after the fn name
//~| SUGGESTION id<T>

fn main() {}
1 change: 0 additions & 1 deletion tests/ui/parser/suggest_misplaced_generics/struct.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
struct Foo<T> { x: T }
//~^ ERROR expected identifier, found `<`
//~| HELP place the generic parameter name after the struct name
//~| SUGGESTION Foo<T>

fn main() {}
1 change: 0 additions & 1 deletion tests/ui/parser/suggest_misplaced_generics/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
struct<T> Foo { x: T }
//~^ ERROR expected identifier, found `<`
//~| HELP place the generic parameter name after the struct name
//~| SUGGESTION Foo<T>

fn main() {}
1 change: 0 additions & 1 deletion tests/ui/parser/suggest_misplaced_generics/trait.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
trait Foo<T> {
//~^ ERROR expected identifier, found `<`
//~| HELP place the generic parameter name after the trait name
//~| SUGGESTION Foo<T>
}


Expand Down
1 change: 0 additions & 1 deletion tests/ui/parser/suggest_misplaced_generics/trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
trait<T> Foo {
//~^ ERROR expected identifier, found `<`
//~| HELP place the generic parameter name after the trait name
//~| SUGGESTION Foo<T>
}


Expand Down
1 change: 0 additions & 1 deletion tests/ui/parser/suggest_misplaced_generics/type.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
type Foo<T> = T;
//~^ ERROR expected identifier, found `<`
//~| HELP place the generic parameter name after the type name
//~| SUGGESTION Foo<T>

fn main() {}
1 change: 0 additions & 1 deletion tests/ui/parser/suggest_misplaced_generics/type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
type<T> Foo = T;
//~^ ERROR expected identifier, found `<`
//~| HELP place the generic parameter name after the type name
//~| SUGGESTION Foo<T>

fn main() {}

0 comments on commit a3d32bb

Please sign in to comment.