rust-lang / polonius

Defines the Rust borrow checker.
Apache License 2.0
1.35k stars 73 forks source link

Print the relation name for each fact when dumping to stdout #151

Closed utaal closed 4 years ago

utaal commented 4 years ago

When writing output facts to stdout, it may be helpful to have the relation/variable name as the first column, so that one can search/grep the output for an atom and quickly find all relations/variables it appears in.

This is in part a possible answer to @lqd's comment on https://github.com/rust-lang/polonius/pull/150#issuecomment-650812589

The verbose debug output can easily become overwhelming and hide the information you're looking for on the bigger datasets.

Stdout looks like this with this patch: https://gist.github.com/utaal/a88be7de8cbdd1e36c8a0a177489bdcf

If this isn't in line with your existing plans, let me know and I'll close.

lqd commented 4 years ago

Could be interesting.

I myself was thinking about enabling/disabling specific relations via flags, but adding the relation names per row like here would work equally well.

Let's see what the others think

amandasystems commented 4 years ago

Could be interesting.

I myself was thinking about enabling/disabling specific relations via flags, but adding the relation names per row like here would work equally well.

Let's see what the others think

Sounds like a good idea to me! We could always easily revert it if it turns out to be a bad idea anyway. :)

lqd commented 4 years ago

CI is red presumably because of formatting, we can merge as soon as that's taken care of :)

lqd commented 4 years ago

Thanks a lot @utaal