forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#59572 - davidtwco:issue-59508, r=varkor
Include bounds in generic re-ordering diagnostic Fixes rust-lang#59508. r? @estebank cc @varkor
- Loading branch information
Showing
13 changed files
with
140 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#![allow(dead_code)] | ||
#![feature(const_generics)] | ||
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash | ||
|
||
// This test checks that generic parameter re-ordering diagnostic suggestions mention that | ||
// consts come after types and lifetimes when the `const_generics` feature is enabled. | ||
// We cannot run rustfix on this test because of the above const generics warning. | ||
|
||
struct A; | ||
|
||
impl A { | ||
pub fn do_things<T, 'a, 'b: 'a>() { | ||
//~^ ERROR lifetime parameters must be declared prior to type parameters | ||
println!("panic"); | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
warning: the feature `const_generics` is incomplete and may cause the compiler to crash | ||
--> $DIR/issue-59508-1.rs:2:12 | ||
| | ||
LL | #![feature(const_generics)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: lifetime parameters must be declared prior to type parameters | ||
--> $DIR/issue-59508-1.rs:12:25 | ||
| | ||
LL | pub fn do_things<T, 'a, 'b: 'a>() { | ||
| ----^^--^^----- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b: 'a, T>` | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// run-rustfix | ||
|
||
#![allow(dead_code)] | ||
|
||
// This test checks that generic parameter re-ordering diagnostic suggestions contain bounds. | ||
|
||
struct A; | ||
|
||
impl A { | ||
pub fn do_things<'a, 'b: 'a, T>() { | ||
//~^ ERROR lifetime parameters must be declared prior to type parameters | ||
println!("panic"); | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// run-rustfix | ||
|
||
#![allow(dead_code)] | ||
|
||
// This test checks that generic parameter re-ordering diagnostic suggestions contain bounds. | ||
|
||
struct A; | ||
|
||
impl A { | ||
pub fn do_things<T, 'a, 'b: 'a>() { | ||
//~^ ERROR lifetime parameters must be declared prior to type parameters | ||
println!("panic"); | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: lifetime parameters must be declared prior to type parameters | ||
--> $DIR/issue-59508.rs:10:25 | ||
| | ||
LL | pub fn do_things<T, 'a, 'b: 'a>() { | ||
| ----^^--^^----- help: reorder the parameters: lifetimes, then types: `<'a, 'b: 'a, T>` | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters