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

Test exercising cyclic structure in std::collections #27185

Merged
merged 1 commit into from
Jul 22, 2015

Conversation

pnkfelix
Copy link
Member

This test attempts to exercise cyclic structure in much of std::collections

(as much as is possible; e.g. things like EnumSet and BitVec do not really support carrying references at all, so trying to represent cyclic structure within them dooes not really make sense.)

This work should land before we make future revisions to dropck; that is, I am attempting to catch potential regressions to cases where we supported cyclic structure circa Rust 1.2.

…ions`

(as much as is possible; e.g. things like `EnumSet` and `BitVec` do
not really support carrying references at all, so trying to represent
cyclic structure within them dooes not really make sense.)
@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

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

pnkfelix added a commit to pnkfelix/rust that referenced this pull request Jul 21, 2015
In particular `LinkedList` and `RawTable` (the backing representation
for `HashMap` and `HashSet`).

This is to get the test from PR rust-lang#27185 building.
@alexcrichton
Copy link
Member

@bors: r 4128583

use std::collections::HashMap;
use std::collections::LinkedList;
use std::collections::VecDeque;
use std::collections::VecMap;
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that VecMap is slated for deprecation

Copy link
Contributor

Choose a reason for hiding this comment

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

And also it's literally just a Vec so I can't imagine any possible interesting analysis here.

@bors
Copy link
Contributor

bors commented Jul 22, 2015

⌛ Testing commit 4128583 with merge 9090420...

bors added a commit that referenced this pull request Jul 22, 2015
This test attempts to exercise cyclic structure in much of `std::collections`

(as much as is possible; e.g. things like `EnumSet` and `BitVec` do not really support carrying references at all, so trying to represent cyclic structure within them dooes not really make sense.)

This work should land before we make future revisions to `dropck`; that is, I am attempting to catch potential regressions to cases where we supported cyclic structure circa Rust 1.2.
@bors bors merged commit 4128583 into rust-lang:master Jul 22, 2015
pnkfelix added a commit to pnkfelix/rust that referenced this pull request Oct 6, 2015
I needed it in `RawVec`, `Vec`, and `TypedArena` for `rustc` to
bootstrap; but of course that alone was not sufficient for `make
check`.

Later I added `unsafe_destructor_blind_to_params` to collections, in
particular `LinkedList` and `RawTable` (the backing representation for
`HashMap` and `HashSet`), to get the regression tests exercising
cyclic structure from PR rust-lang#27185 building.

----

Note that the feature is `dropck_parametricity` (which is not the same
as the attribute's name). We will almost certainly vary our strategy
here in the future, so it makes some sense to have a not-as-ugly name
for the feature gate. (The attribute name was deliberately selected to
be ugly looking.)
bors added a commit that referenced this pull request Oct 9, 2015
Major revision to the dropck_legal_cycles test.

1. Added big comment block explaining the test framework.

2. Added tests exericising Rc and Arc. This was inspired by a comment
   from eefriedman on PR #28861.

3. Made the cycle-detection not issue false-positives on acyclic dags.

   Doing this efficiently required revising the framework; instead of
   visiting all children (i.e. doing a traversal), now each test is
   responsible for supplying the path that will act as a witness to
   the cycle.

   Luckily for me, all of the pre-existing tests worked with a trivial
   path built from "always tke your first left", but new tests I added
   did require other input paths (i.e., "first turn right, then left".

   (The path representation is a bit-string and its branches are
    n-ary, not word phrases and binary branches as you might think
    from the outline above.)

cc PR #27185
pnkfelix added a commit to pnkfelix/rust that referenced this pull request Oct 14, 2015
I needed it in `RawVec`, `Vec`, and `TypedArena` for `rustc` to
bootstrap; but of course that alone was not sufficient for `make
check`.

Later I added `unsafe_destructor_blind_to_params` to collections, in
particular `LinkedList` and `RawTable` (the backing representation for
`HashMap` and `HashSet`), to get the regression tests exercising
cyclic structure from PR rust-lang#27185 building.

----

Note that the feature is `dropck_parametricity` (which is not the same
as the attribute's name). We will almost certainly vary our strategy
here in the future, so it makes some sense to have a not-as-ugly name
for the feature gate. (The attribute name was deliberately selected to
be ugly looking.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants