-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Add a graphviz
crate for making .dot files to layout and render graphs.
#13749
Conversation
r? anyone (i don't think anyone needs to own review of this). |
Is this something that belongs in the rust distribution, as opposed to being a separate project? |
At the moment there is no other feasible way to use a crate in the compiler, as @pnkfelix is aiming to do with control-flow graphs. |
As much as I don't want to have a graphviz library, if rustc needs it then, like ebml, I guess we don't have a lot of choice. @pnkfelix can you add |
html_favicon_url = "http://www.rust-lang.org/favicon.ico", | ||
html_root_url = "http://static.rust-lang.org/doc/master")] | ||
|
||
#![experimental] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brson is this not the right place to put the experimental
directive?
(I admit, I was a little surprised that these headers all appear after the (long) documentation block; but that appears to be the pattern used in the other crates...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is interesting, I had been spitting out graphviz dot files from "rust find".
I did not review for correctness (I'm not particularly familiar with graphviz), and I ignored the tests, but I've put comments on most everything else. I would like to see Given the issues surrounding |
After thinking some more, I don't think we can change |
(i'll fix the other formatting issues that @kballard has pointed out; I decided I should stop spamming with the "will fix" notes on minor things like that.) |
I don't see much point in trying to remove all occurrences of What I am trying to say is that there is a broader argument about whether to use |
/// edges, as well as an identifier for the graph itself. | ||
pub trait Labeller<'a,N,E> { | ||
/// Must return a DOT compatible identifier naming the graph. | ||
fn graph_id<'b>(&'a self) -> Id<'a>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argh, I just noticed these useless <'b>
bounds, I need to get rid of those before this gets merged.
Namely: * Added conversion traits both to and from the various vector types, analogous to how `str::MaybeOwned` works with `str::IntoMaybeOwned` and `str::Str`. This led me to add the `FixedLen` variant of `MaybeOwnedVector` for interoperability with `std::slice`. * Revised client example code to make use of `into_maybe_owned` * Added implementations of `Show` and `CloneableVector` for `MaybeOwnedVector`. * As suggested by kballard, added `into_vec` method that is analogous to `CloneableVector::into_owned` except it produces a `Vec` rather than a `~[T]`.
( |
(... and apparently I clobbered the previous short discussion ... sorry all.... ) |
hmm I thought I had tested making the docs, but maybe not the way that bors does... (it looks to me like its interpreting my code block of |
(and I was inspired by this problem to file #13947 ) |
…chton Add a `graphviz` crate for making .dot files to layout and render graphs. (This is a precursor to other work to render control-flow graphs from within rustc itself; but this crate should be independently usable, since it abstracts over the client's graph-representation and labeling method.)
…ustment_hints, r=Veykril fix: Don't show duplicated adjustment hints for blocks, ifs and matches Before: ![2022-12-09_21-10](https://user-images.githubusercontent.com/38225716/206761100-5511d91b-2543-4166-aa2c-abdb8bad3613.png) After: ![2022-12-09_21-22](https://user-images.githubusercontent.com/38225716/206761113-c58dbb5a-8616-4287-a3b4-69c13703294d.png) ---- I want to improve adjustment hints, this is the first step :)
Fix rust-lang#13749 changelog: [`needless_lifetimes`]: do not suggest using `'_` in `where` clauses
Add a
graphviz
crate for making .dot files to layout and render graphs.(This is a precursor to other work to render control-flow graphs from within rustc itself; but this crate should be independently usable, since it abstracts over the client's graph-representation and labeling method.)