|
1 |
| -For information on how to help contribute to chalk, see the [contribution guide](https://rust-lang.github.io/chalk/book/contribution_guide.html) in the chalk book |
| 1 | +# Contributing to chalk |
| 2 | + |
| 3 | +Thank you for your interest in contributing to chalk! There are many ways to |
| 4 | +contribute, and we appreciate all of them. |
| 5 | + |
| 6 | +* [Bug Reports](#bug-reports) |
| 7 | +* [Running and Debugging](#running-and-debugging) |
| 8 | +* [Pull Requests](#pull-requests) |
| 9 | +* [Writing Documentation](#writing-documentation) |
| 10 | +* [Helpful Links and Information](#helpful-links-and-information) |
| 11 | + |
| 12 | +If you'd like to contribute, consider joining the [Traits Working Group][traits-working-group]. |
| 13 | +We hang out on the [rust-lang zulip][rust-lang-zulip] in the [#wg-traits][wg-traits-stream] stream. |
| 14 | + |
| 15 | +As a reminder, all contributors are expected to follow our [Code of Conduct][coc]. |
| 16 | + |
| 17 | +[traits-working-group]: https://rust-lang.github.io/compiler-team/working-groups/traits/ |
| 18 | +[rust-lang-zulip]:https://rust-lang.zulipchat.com |
| 19 | +[wg-traits-stream]: https://rust-lang.zulipchat.com/#narrow/stream/144729-wg-traits |
| 20 | +[coc]: https://www.rust-lang.org/conduct.html |
| 21 | + |
| 22 | +## Bug Reports |
| 23 | +[bug-reports]: #bug-reports |
| 24 | + |
| 25 | +While bugs are unfortunate, they're a reality in software. We can't fix what we |
| 26 | +don't know about, so please report liberally. If you're not sure if something |
| 27 | +is a bug or not, feel free to file a bug anyway. |
| 28 | + |
| 29 | +If you have the chance, before reporting a bug, please search existing issues, |
| 30 | +as it's possible that someone else has already reported your error. This doesn't |
| 31 | +always work, and sometimes it's hard to know what to search for, so consider |
| 32 | +this extra credit. We won't mind if you accidentally file a duplicate report. |
| 33 | + |
| 34 | +Sometimes, a backtrace is helpful, and so including that is nice. To get |
| 35 | +a backtrace, set the `RUST_BACKTRACE` environment variable to a value |
| 36 | +other than `0`. The easiest way to do this is to invoke `chalk` like this: |
| 37 | + |
| 38 | +```bash |
| 39 | +$ RUST_BACKTRACE=1 chalk ... |
| 40 | +``` |
| 41 | + |
| 42 | +## Running and Debugging |
| 43 | +[running-and-debugging]: #running-and-debugging |
| 44 | +There is a repl mainly for debugging purposes which can be run by `cargo run`. Some basic examples are in [libstd.chalk](libstd.chalk): |
| 45 | +```bash |
| 46 | +$ cargo run |
| 47 | +?- load libstd.chalk |
| 48 | +?- Vec<Box<i32>>: Clone |
| 49 | +Unique; substitution [], lifetime constraints [] |
| 50 | +``` |
| 51 | + |
| 52 | +More logging can be enabled by setting the `CHALK_DEBUG` environment variable. Set `CHALK_DEBUG=1` to see `info!(...)` output, and `CHALK_DEBUG=2` to see `debug!(...)` output as well. |
| 53 | + |
| 54 | +## Pull Requests |
| 55 | +[pull-requests]: #pull-requests |
| 56 | + |
| 57 | +Pull requests are the primary mechanism we use to change Rust. GitHub itself |
| 58 | +has some [great documentation][pull-request-documentation] on using the Pull Request feature. |
| 59 | +We use the "fork and pull" model [described here][development-models], where |
| 60 | +contributors push changes to their personal fork and create pull requests to |
| 61 | +bring those changes into the source repository. |
| 62 | + |
| 63 | +Please make pull requests against the `master` branch. |
| 64 | + |
| 65 | +[pull-request-documentation]: https://help.github.com/articles/about-pull-requests/ |
| 66 | +[development-models]: https://help.github.com/articles/about-collaborative-development-models/ |
| 67 | + |
| 68 | +## Writing Documentation |
| 69 | +[writing-documentation]: #writing-documentation |
| 70 | + |
| 71 | +Documentation improvements are very welcome. Documentation pull requests |
| 72 | +function in the same way as other pull requests. |
| 73 | + |
| 74 | +You can find documentation style guidelines in [RFC 1574][rfc1574]. |
| 75 | + |
| 76 | +[rfc1574]: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text |
| 77 | + |
| 78 | +## Helpful Links and Information |
| 79 | +[Helpful Links and Information]: #helpful-links-and-information |
| 80 | + |
| 81 | +### Blog posts |
| 82 | +There are several [blog posts][blog-posts] which describe the ideas and |
| 83 | +machinery inside of chalk. |
| 84 | + |
| 85 | +[blog-posts]: README.md#blog-posts |
| 86 | + |
| 87 | +### Glossary |
| 88 | + |
| 89 | +In addition to the blog posts there is a [glossary](GLOSSARY.md) explaining some |
| 90 | +of the terminology used in chalk. |
| 91 | + |
| 92 | +### Trait solving in rustc-dev-guide |
| 93 | +The rustc-dev-guide describes [new-style trait solving][trait-solving], which is slowly replacing the old trait resolution. |
| 94 | + |
| 95 | +[trait-solving]: https://rustc-dev-guide.rust-lang.org/traits/index.html |
0 commit comments