Skip to content
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

Generic parameter reordering diagnostic doesn't contain bounds #59508

Closed
varkor opened this Issue Mar 28, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@varkor
Copy link
Member

commented Mar 28, 2019

struct A;

impl A {
    pub fn do_things<T, 'a, 'b: 'a>() {
        println!("panic");
    }
}

produces:

error: lifetime parameters must be declared prior to type parameters
 --> src/lib.rs:4:25
  |
4 |     pub fn do_things<T, 'a, 'b: 'a>() {
  |                     ----^^--^^----- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b, T>`

which should be:

error: lifetime parameters must be declared prior to type parameters
 --> src/lib.rs:4:25
  |
4 |     pub fn do_things<T, 'a, 'b: 'a>() {
  |                     ----^^--^^----- help: reorder the parameters: lifetimes, then types, then consts: `<'a, 'b: 'a, T>`
@varkor

This comment has been minimized.

Copy link
Member Author

commented Mar 29, 2019

It should also probably not contain the phrase , then consts if const generics aren't enabled.

@davidtwco

This comment has been minimized.

Copy link
Member

commented Mar 30, 2019

Submitted #59572 to address this.

bors added a commit that referenced this issue Mar 31, 2019

Auto merge of #59572 - davidtwco:issue-59508, r=varkor
Include bounds in generic re-ordering diagnostic

Fixes #59508.

r? @estebank
cc @varkor

Centril added a commit to Centril/rust that referenced this issue Mar 31, 2019

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

Centril added a commit to Centril/rust that referenced this issue Mar 31, 2019

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

Centril added a commit to Centril/rust that referenced this issue Mar 31, 2019

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

@bors bors closed this in #59572 Mar 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.