about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2021-07-27Rollup merge of #86450 - tmiasko:move-size-limit, r=pnkfelixYuki Okushi-0/+10
Add flag to configure `large_assignments` lint 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 ``` Lint tracking issue #83518.
2021-07-26Update booksEric Huss-0/+0
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-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-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-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-05Auto merge of #86663 - fee1-dead:use-rustdoc-css, r=GuillaumeGomezbors-132/+8
Use rustdoc.css for error index Closes #86512.
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-22Update booksEric Huss-0/+0
2021-06-20Fix rust.css fonts.Eric Huss-10/+33
2021-06-17Auto merge of #83572 - pkubaj:patch-1, r=nagisabors-0/+1
Add support for powerpc64le-unknown-freebsd
2021-06-10Add support for using qualified paths with structs in expression and patternRyan Levick-0/+29
position.
2021-06-08Update booksEric Huss-0/+0
2021-06-08Rollup merge of #85951 - hyd-dev:force-unwind-tables, r=steveklabnikYuki Okushi-2/+1
Update the documentation of `-C force-unwind-tables` for #83482 `panic=unwind` does not require `force-unwind-tables` to be "yes" anymore. I forgot to update this in #83482.
2021-06-06Auto merge of #79608 - alessandrod:bpf, r=nagisabors-0/+10
BPF target support This adds `bpfel-unknown-none` and `bpfeb-unknown-none`, two new no_std targets that generate little and big endian BPF. The approach taken is very similar to the cuda target, where `TargetOptions::obj_is_bitcode` is enabled and code generation is done by the linker. I added the targets to `dist-various-2`. There are [some tests](https://github.com/alessandrod/bpf-linker/tree/main/tests/assembly) in bpf-linker and I'm planning to add more. Those are currently not ran as part of rust CI.
2021-06-05Auto merge of #85457 - jyn514:remove-doc-include, r=GuillaumeGomezbors-59/+1
Remove `doc(include)` This nightly feature is redundant now that `extended_key_value_attributes` is stable (https://github.com/rust-lang/rust/pull/83366). `@rust-lang/rustdoc` not sure if you think this needs FCP; there was already an FCP in #82539, but technically it was for deprecating, not removing the feature altogether. This should not be merged before #83366. cc `@petrochenkov`
2021-06-04Auto merge of #85788 - rylev:force-warns, r=nikomatsakisbors-0/+21
Support for force-warns Implements https://github.com/rust-lang/rust/issues/85512. This PR adds a new command line option `force-warns` which will force the provided lints to warn even if they are allowed by some other mechanism such as `#![allow(warnings)]`. Some remaining issues: * https://github.com/rust-lang/rust/issues/85512 mentions that `force-warns` should also be capable of taking lint groups instead of individual lints. This is not implemented. * If a lint has a higher warning level than `warn`, this will cause that lint to warn instead. We probably want to allow the lint to error if it is set to a higher lint and is not allowed somewhere else. * One test is currently ignored because it's not working - when a deny-by-default lint is allowed, it does not currently warn under `force-warns`. I'm not sure why, but I wanted to get this in before the weekend. r? `@nikomatsakis`
2021-06-04Remove `doc(include)`Joshua Nelson-59/+1
2021-06-03Satisfy unstable book lintJubilee Young-2/+5
2021-06-03Add run-make test testing flag stabilityRyan Levick-1/+1
2021-06-03Update the documentation of `-C force-unwind-tables`hyd-dev-2/+1
2021-06-02Add a page on force-warns in unstable bookRyan Levick-0/+21
2021-05-30Rollup merge of #85781 - badboy:document-aarch-ios-sim-support, r=AmanieuGuillaume Gomez-1/+58
Add documentation for aarch64-apple-ios-sim target Documentation as requested for [MCP 428](https://github.com/rust-lang/compiler-team/issues/428) to promote this target to Tier 2. Currently it calls out that it's Tier 3. That should be changed if this target is promoted, but this PR could also land before that. Note: probably should get signoff from the compiler team based on that MCP.
2021-05-29Add documentation for aarch64-apple-ios-sim targetJan-Erik Rediger-1/+58
2021-05-29BPF: misc minor review fixesAlessandro Decina-3/+3
2021-05-28Fix typo on nvptx supportEric Huss-1/+1
2021-05-26stabilize member constraintsNiko Matsakis-29/+0
2021-05-26Rollup merge of #85699 - ehuss:update-books, r=ehussYuki Okushi-0/+0
Update books ## reference 4 commits in 5aa457bf1b54bd2cd5d4cf49797f29299bdf89a7..9c68af3ce6ccca2395e1868addef26a0542e9ddd 2021-05-05 08:39:22 -0700 to 2021-05-24 09:53:32 -0700 - missing parameter name in Trait Implementations (rust-lang-nursery/reference#1030) - Add more content to impl-trait.md (rust-lang-nursery/reference#1017) - Document extended key-value attributes (rust-lang-nursery/reference#1029) - Document raw pointer <-> usize casts. (rust-lang-nursery/reference#970) ## rust-by-example 1 commits in 5f8c6da200ada77760a2fe1096938ef58151c9a6..805e016c5792ad2adabb66e348233067d5ea9f10 2021-04-29 08:08:01 -0300 to 2021-05-20 17:08:34 -0300 - Update structs.md (rust-lang/rust-by-example#1440) ## rustc-dev-guide 4 commits in 1e6c7fbda4c45e85adf63ff3f82fa9c870b1447f..50de7f0682adc5d95ce858fe6318d19b4b951553 2021-05-10 13:38:24 +0900 to 2021-05-20 15:02:20 +0200 - update rustfmt references to reflect change from submod to subtree (rust-lang/rustc-dev-guide#1129) - Remove `--stage 1` argument from `doc` invocations (rust-lang/rustc-dev-guide#1125) - Update coverage docs (rust-lang/rustc-dev-guide#1122) - Document -Zunpretty=thir-tree (rust-lang/rustc-dev-guide#1128) ## edition-guide 1 commits in 1da3c411f17adb1ba5de1683bb6acee83362b54a..302a115e8f71876dfc884aebb0ca5ccb02b8a962 2021-02-16 16:46:40 -0800 to 2021-05-21 10:46:11 -0400 - Minimize the edition guide (rust-lang/edition-guide#232) ## embedded-book 1 commits in 569c3391f5c0cc43433bc77831d17f8ff4d76602..7349d173fa28a0bb834cf0264a05286620ef0923 2021-04-07 08:32:11 +0000 to 2021-05-25 13:59:05 +0000 - Remove $ from cargo-binutils (rust-embedded/book#292)
2021-05-25Update booksEric Huss-0/+0
2021-05-25Fix tasklist example in rustdoc book.Eric Huss-6/+4
2021-05-23Add BPF target to platform-support.mdAlessandro Decina-0/+2