about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2021-07-26Fix typo in building/bootstrapping.md (#1175)Ben Reeves-1/+1
2021-07-22Add support for powerpc-unknown-freebsdPiotr Kubaj-0/+1
2021-07-21Rollup merge of #87346 - rylev:rename-force-warn, r=nikomatsakisEric Huss-3/+3
Rename force-warns to force-warn The renames the `--force-warns` option to `--force-warn`. This mirrors other lint options like `--warn` and `--deny` which are in the singular. r? `@nikomatsakis` cc `@ehuss` - this option is being used by Cargo. How do we make sure the transition to using the new name is as smooth as possible?
2021-07-21Rename force-warns to force-warnRyan Levick-3/+3
2021-07-20Link directly to stabilization report comments (#1173)Noah Lev-3/+9
Previously, readers had to scroll through tons of comments to find the report.
2021-07-20Fix ignore annotationRichard Cobbe-2/+1
2021-07-20Ignore example in automationRichard Cobbe-1/+2
2021-07-20Update booksEric Huss-0/+0
2021-07-20Auto merge of #87141 - spastorino:remove_impl_trait_in_bindings, r=oli-obkbors-28/+0
Remove impl trait in bindings Closes #86729 r? `@oli-obk`
2021-07-19Add docs for raw-dylib to unstable bookRichard Cobbe-0/+34
2021-07-18Remove impl_trait_in_bindings feature flagSantiago Pastorino-28/+0
2021-07-18Add doc for --nocaptureGuillaume Gomez-0/+7
2021-07-13Update for merge of CrateDisambiguator into StableCrateIdbjorn3-14/+15
2021-07-12Rollup merge of #87031 - ZuseZ4:patch-1, r=GuillaumeGomezYuki Okushi-1/+1
Update reference.md I ran into a link to the outdated src/doc/reference.md here: https://users.rust-lang.org/t/conditional-compilation-for-debug-release/1098/6 Apparently the Rust reference has moved again, so the link gave a 404 error. This should fix it.
2021-07-11Auto merge of #83918 - workingjubilee:stable-rangefrom-pat, r=joshtriplettbors-0/+53
Stabilize "RangeFrom" patterns in 1.55 Implements a partial stabilization of #67264 and #37854. Reference PR: https://github.com/rust-lang/reference/pull/900 # Stabilization Report This stabilizes the `X..` pattern, shown as such, offering an exhaustive match for unsigned integers: ```rust match x as u32 { 0 => println!("zero!"), 1.. => println!("positive number!"), } ``` Currently if a Rust author wants to write such a match on an integer, they must use `1..={integer}::MAX` . By allowing a "RangeFrom" style pattern, this simplifies the match to not require the MAX path and thus not require specifically repeating the type inside the match, allowing for easier refactoring. This is particularly useful for instances like the above case, where different behavior on "0" vs. "1 or any positive number" is desired, and the actual MAX is unimportant. Notably, this excepts slice patterns which include half-open ranges from stabilization, as the wisdom of those is still subject to some debate. ## Practical Applications Instances of this specific usage have appeared in the compiler: https://github.com/rust-lang/rust/blob/16143d10679537d3fde4247e15334e78ad9d55b9/compiler/rustc_middle/src/ty/inhabitedness/mod.rs#L219 https://github.com/rust-lang/rust/blob/673d0db5e393e9c64897005b470bfeb6d5aec61b/compiler/rustc_ty_utils/src/ty.rs#L524 And I have noticed there are also a handful of "in the wild" users who have deployed it to similar effect, especially in the case of rejecting any value of a certain number or greater. It simply makes it much more ergonomic to write an irrefutable match, as done in Katholieke Universiteit Leuven's [SCALE and MAMBA project](https://github.com/KULeuven-COSIC/SCALE-MAMBA/blob/05e5db00d553573534258585651c525d0da5f83f/WebAssembly/scale_std/src/fixed_point.rs#L685-L695). ## Tests There were already many tests in [src/test/ui/half-open-range/patterns](https://github.com/rust-lang/rust/tree/90a2e5e3fe59a254d4d707aa291517b3791ea5a6/src/test/ui/half-open-range-patterns), as well as [generic pattern tests that test the `exclusive_range_pattern` feature](https://github.com/rust-lang/rust/blob/673d0db5e393e9c64897005b470bfeb6d5aec61b/src/test/ui/pattern/usefulness/integer-ranges/reachability.rs), many dating back to the feature's introduction and remaining standing to this day. However, this stabilization comes with some additional tests to explore the... sometimes interesting behavior of interactions with other patterns. e.g. There is, at least, a mild diagnostic improvement in some edge cases, because before now, the pattern `0..=(5+1)` encounters the `half_open_range_patterns` feature gate and can thus emit the request to enable the feature flag, while also emitting the "inclusive range with no end" diagnostic. There is no intent to allow an `X..=` pattern that I am aware of, so removing the flag request is a strict improvement. The arrival of the `J | K` "or" pattern also enables some odd formations. Some of the behavior tested for here is derived from experiments in this [Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=58777b3c715c85165ac4a70d93efeefc) example, linked at https://github.com/rust-lang/rust/issues/67264#issuecomment-812770692, which may be useful to reference to observe the current behavior more closely. In addition tests constituting an explanation of the "slicing range patterns" syntax issue are included in this PR. ## Desiderata The exclusive range patterns and half-open range patterns are fairly strongly requested by many authors, as they make some patterns much more natural to write, but there is disagreement regarding the "closed" exclusive range pattern or the "RangeTo" pattern, especially where it creates "off by one" gaps in the presence of a "catch-all" wildcard case. Also, there are obviously no range analyses in place that will force diagnostics for e.g. highly overlapping matches. I believe these should be warned on, ideally, and I think it would be reasonable to consider such a blocker to stabilizing this feature, but there is no technical issue with the feature as-is from the purely syntactic perspective as such overlapping or missed matches can already be generated today with such a catch-all case. And part of the "point" of the feature, at least from my view, is to make it easier to omit wildcard matches: a pattern with such an "open" match produces an irrefutable match and does not need the wild card case, making it easier to benefit from exhaustiveness checking. ## History - Implemented: - Partially via exclusive ranges: https://github.com/rust-lang/rust/pull/35712 - Fully with half-open ranges: https://github.com/rust-lang/rust/pull/67258 - Unresolved Questions: - The precedence concerns of https://github.com/rust-lang/rust/pull/48501 were considered as likely requiring adjustment but probably wanting a uniform consistent change across all pattern styles, given https://github.com/rust-lang/rust/issues/67264#issuecomment-720711656, but it is still unknown what changes might be desired - How we want to handle slice patterns in ranges seems to be an open question still, as witnessed in the discussion of this PR! I checked but I couldn't actually find an RFC for this, and given "approved provisionally by lang team without an RFC", I believe this might require an RFC before it can land? Unsure of procedure here, on account of this being stabilizing a subset of a feature of syntax. r? `@scottmcm`
2021-07-11Auto merge of #86416 - Amanieu:asm_clobber_only, r=nagisabors-0/+10
Add clobber-only register classes for asm! These are needed to properly express a function call ABI using a clobber list, even though we don't support passing actual values into/out of these registers.
2021-07-10Update reference.mdManuel Drehwald-1/+1
Apparently the Rust reference has moved again, so the link gave a 404 error.
2021-07-10Add clobber-only register classes for asm!Amanieu d'Antras-0/+10
These are needed to properly express a function call ABI using a clobber list, even though we don't support passing actual values into/out of these registers.
2021-07-08Minor capitalization fix (#1170)Eric Holk-1/+1
2021-07-06Update booksEric Huss-0/+0
2021-07-06Add flag to configure `large_assignments` lintTomasz Miąsko-0/+10
The `large_assignments` lints detects moves over specified limit. The limit is configured through `move_size_limit = "N"` attribute placed at the root of a crate. When attribute is absent, the lint is disabled. Make it possible to enable the lint without making any changes to the source code, through a new flag `-Zmove-size-limit=N`. For example, to detect moves exceeding 1023 bytes in a cargo crate, including all dependencies one could use: ``` $ env RUSTFLAGS=-Zmove-size-limit=1024 cargo build -vv ```
2021-07-05Fixed typos in inline codeYoh Deadfall-2/+2
2021-07-05Auto merge of #86663 - fee1-dead:use-rustdoc-css, r=GuillaumeGomezbors-132/+8
Use rustdoc.css for error index Closes #86512.
2021-07-05Document lang items (#1119)Joshua Nelson-0/+68
* Document lang items * Apply suggestions from code review Co-authored-by: Camelid <camelidcamel@gmail.com> * Add an example of retrieving lang items * Add two missing words * Fix line lengths Co-authored-by: Mikail Bagishov <bagishov.mikail@yandex.ru> Co-authored-by: Camelid <camelidcamel@gmail.com>
2021-07-04More specifics on what future-incompatible lints are used forRyan Levick-5/+19
2021-07-04Fix line lensRyan Levick-5/+7
2021-07-04Update information on lints particularly on future-incompatibleRyan Levick-22/+38
2021-07-04Update section of lint storeRyan Levick-27/+34
2021-07-02Update around half of the January 2021 date references (#1155)Ryan Levick-20/+11
2021-07-02Create issues for many TODOs (#1163)Ryan Levick-13/+15
* Create issues for many TODOs * Update src/crates-io.md Co-authored-by: Joshua Nelson <github@jyn.dev> * Update src/backend/inline-asm.md Co-authored-by: Yuki Okushi <jtitor@2k36.org> Co-authored-by: Joshua Nelson <github@jyn.dev> Co-authored-by: Yuki Okushi <jtitor@2k36.org>
2021-07-01Links from rustc-dev-guide to std-dev-guide (#1152)Josh Triplett-0/+5
2021-06-29Document how to mark features as incomplete (#1151)Smittyvb-0/+9
* Document how to mark features as incomplete This was changed in https://github.com/rust-lang/rust/pull/86446 so that incompleteness is included in the delcaration. * Footerify link
2021-06-29override rustdoc.css {webkit,moz} box-sizing:unsetDeadbeef-0/+3
2021-06-28Update to new bootstrap compilerMark Rousskov-50/+0
2021-06-28Make every standalone doc use rustdoc.cssDeadbeef-0/+5
2021-06-27Add Website features page to rustdoc bookJean-Luc Thumm-0/+26
2021-06-27Use rustdoc.css for error indexDeadbeef-138/+6
2021-06-25Auto merge of #86599 - Amanieu:asm_raw, r=nagisabors-1/+2
Add a "raw" option for asm! which ignores format string specifiers This is useful when including raw assembly snippets using `include_str!`.
2021-06-24Add a "raw" option for asm! which ignores format string specifiersAmanieu d'Antras-1/+2
2021-06-25Remove requests or suggestions about rebase and fixup contradictory to ↵Jesús Hernández-2/+1
rust-highfive bot comment (#1111)
2021-06-24Generate glossary table correctly (#1146)Smittyvb-89/+90
Co-authored-by: Yuki Okushi <yuki.okushi@huawei.com>
2021-06-23Correct the wrong serial number (#1147)二手掉包工程师-13/+13
2021-06-22Update booksEric Huss-0/+0
2021-06-21Update "Inference variables" section (#1145)Yuki Okushi-2/+3
2021-06-20Fix rust.css fonts.Eric Huss-10/+33
2021-06-17Document how to run unit tests (#1141)Yuki Okushi-0/+14
2021-06-17Auto merge of #83572 - pkubaj:patch-1, r=nagisabors-0/+1
Add support for powerpc64le-unknown-freebsd
2021-06-15We stopped using allow_internal_unstable a while ago (#1142)Oli Scherer-13/+21
Co-authored-by: Ralf Jung <post@ralfj.de> Co-authored-by: Yuki Okushi <jtitor@2k36.org> Co-authored-by: Noah Lev <camelidcamel@gmail.com>
2021-06-15Change the feature used as an example of stabilizing lib features (#1143)Jade-1/+4
2021-06-14We use HIR to do type inference, trait solving and type checking (#1139)Santiago Pastorino-4/+10
* We use HIR to do type inference, trait solving and type checking * Update src/overview.md Co-authored-by: Yuki Okushi <jtitor@2k36.org> * Update src/overview.md Co-authored-by: Yuki Okushi <jtitor@2k36.org> * Update src/overview.md Co-authored-by: Noah Lev <camelidcamel@gmail.com> * Fix type checking brief explanation Co-authored-by: Yuki Okushi <jtitor@2k36.org> Co-authored-by: Noah Lev <camelidcamel@gmail.com>