Skip to content

Fix suggestion to use lifetime in type and in assoc const - #75372

Merged
bors merged 5 commits into
rust-lang:masterfrom
estebank:lt-sugg-in-type
Aug 13, 2020
Merged

Fix suggestion to use lifetime in type and in assoc const#75372
bors merged 5 commits into
rust-lang:masterfrom
estebank:lt-sugg-in-type

Conversation

@estebank

@estebankestebank commented Aug 10, 2020

Copy link
Copy Markdown
Contributor

Do not merge until #75363 has landed, as it has the test case for this.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 10, 2020
@estebank

Copy link
Copy Markdown
ContributorAuthor

r? @lcnr

@rust-highfiverust-highfive assigned lcnr and unassigned eddybAug 10, 2020
@estebankestebank changed the title Fix suggestion to use lifetime in typeFix suggestion to use lifetime in type and in assoc constAug 10, 2020
@estebank

Copy link
Copy Markdown
ContributorAuthor

cc @JohnTitor

Comment threadsrc/test/ui/suggestions/missing-lifetime-in-assoc-const-type.stderr Outdated
Comment threadsrc/librustc_resolve/late/diagnostics.rs Outdated
Comment threadsrc/librustc_resolve/late/diagnostics.rs Outdated

@lcnrlcnr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

LL | const A: &str = "";
LL | const B: S = S { s: &() };
LL | const C: &'_ str = "";
LL | const D: T<'a, 'a> = T { a: &(), b: &() };

@lcnrlcnrAug 12, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That snippet is somewhat unfortunate, but I don't think there is something we can do here 🤷

@lcnr

lcnr commented Aug 12, 2020

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Aug 12, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 6a3deb0 has been approved by lcnr

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 12, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Aug 13, 2020
Fix suggestion to use lifetime in type and in assoc const
_Do not merge until rust-lang#75363 has landed, as it has the test case for this._
* Account for associated types
* Associated `const`s can't have generics (fixrust-lang#74264)
* Do not suggest duplicate lifetimes and suggest `for<'a>` more (fixrust-lang#72404)
@JohnTitorJohnTitor mentioned this pull request Aug 13, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 13, 2020
Rollup of 11 pull requests
Successful merges:
- rust-lang#75189 (Fix wasi::fs::OpenOptions to imply write when append is on)
- rust-lang#75201 (Fix some Clippy warnings in librustc_serialize)
- rust-lang#75372 (Fix suggestion to use lifetime in type and in assoc const)
- rust-lang#75400 (Fix minor things in the `f32` primitive docs)
- rust-lang#75449 (add regression test for rust-lang#74739 (mir const-prop bug))
- rust-lang#75451 (Clean up E0751 explanation)
- rust-lang#75455 (Use explicit path link in place for doc in time)
- rust-lang#75457 (Remove some dead variants in LLVM FFI)
- rust-lang#75466 (Move to intra doc links whenever possible within std/src/lib.rs)
- rust-lang#75469 (Switch to intra-doc links in `std/io/mod.rs`)
- rust-lang#75473 (Flip order of const & type)
Failed merges:
r? @ghost
@bors
bors merged commit d90a4b8 into rust-lang:masterAug 13, 2020
@estebank
estebank deleted the lt-sugg-in-type branch November 9, 2023 05:16
@cuvipercuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

6 participants

@estebank@rust-highfive@lcnr@bors@cuviper@eddyb