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

Borrow checker is not flow sensitive #4903

Closed
nikomatsakis opened this issue Feb 12, 2013 · 4 comments
Closed

Borrow checker is not flow sensitive #4903

nikomatsakis opened this issue Feb 12, 2013 · 4 comments
Assignees
Labels
A-lifetimes Area: Lifetimes / regions A-type-system Area: Type system C-enhancement Category: An issue proposing an enhancement or a PR with one.
Milestone

Comments

@nikomatsakis
Copy link
Contributor

This results in spurious errors. Proper fix is a bit tricky so as to avoid re-encoding the control flow that liveness/trans already know about. May come about as part of a refactoring I want to do to liveness to accommodate once fns.

@nikomatsakis
Copy link
Contributor Author

Now with INHTWAMA this is more important. Some routines, such as these two from hashmap, cannot be checked without flow-sensitivity:

    fn find_or_insert(&mut self, k: K, v: V) -> &self/V {...}
    fn find_or_insert_with(&mut self, k: K, f: fn(&K) -> V) -> &self/V {...}

@nikomatsakis
Copy link
Contributor Author

Part of #5074

@nikomatsakis
Copy link
Contributor Author

Going to re-open and convert #5074 into a "meta" issue

@nikomatsakis nikomatsakis reopened this Apr 30, 2013
bors added a commit that referenced this issue May 7, 2013
…omatsakis

This rather sprawling branch refactors the borrow checker and much of the region code, addressing a number of outstanding issues. I will close them manually after validating that there are test cases for each one, but here is a (probably partial) list:

  - #4903: Flow sensitivity
  - #3387: Moves in overloaded operators
  - #3850: Region granularity
  - #4666: Odd loaning errors
  - #6021: borrow check errors with hashmaps
  - #5910: @mut broken

cc #5047

(take 5)
@thestinger
Copy link
Contributor

Fixed by #6286.

bors added a commit to rust-lang-ci/rust that referenced this issue May 2, 2020
Closes Issue4903

fixes rust-lang#4903.

Check list:
- [x] Followed [lint naming conventions][lint_naming]
- [x] Added passing UI tests (including committed `.stderr` file)
- [x] `cargo test` passes locally
- [x] Executed `./util/dev update_lints`
- [x] Added lint documentation
- [x] Run `./util/dev fmt`

[lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
---

changelog: implement lint that warn about single component path imports(`use ident;`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lifetimes Area: Lifetimes / regions A-type-system Area: Type system C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

2 participants