about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2020-05-05Rollup merge of #71897 - alexcrichton:embed-bitcode-docs, r=nnethercoteDylan DPC-8/+36
Improve docs for embed-bitcode and linker-plugin-lto Follow-up from #71716 I wasn't able to add in time.
2020-05-04Improve docs for embed-bitcode and linker-plugin-ltoAlex Crichton-8/+36
Follow-up from #71716 I wasn't able to add in time.
2020-05-04Add Option to Force Unwind TablesSam Elliott-0/+12
When panic != unwind, `nounwind` is added to all functions for a target. This can cause issues when a panic happens with RUST_BACKTRACE=1, as there needs to be a way to reconstruct the backtrace. There are three possible sources of this information: forcing frame pointers (for which an option exists already), debug info (for which an option exists), or unwind tables. Especially for embedded devices, forcing frame pointers can have code size overheads (RISC-V sees ~10% overheads, ARM sees ~2-3% overheads). In code, it can be the case that debug info is not kept, so it is useful to provide this third option, unwind tables, that users can use to reconstruct the call stack. Reconstructing this stack is harder than with frame pointers, but it is still possible. This commit adds a compiler option which allows a user to force the addition of unwind tables. Unwind tables cannot be disabled on targets that require them for correctness, or when using `-C panic=unwind`.
2020-05-03Implement RFC 2523, `#[cfg(version(..))]`mibac138-0/+34
2020-05-01Rename `bitcode-in-rlib` option to `embed-bitcode`Alex Crichton-33/+27
This commit finishes work first pioneered in #70458 and started in #71528. The `-C bitcode-in-rlib` option, which has not yet reached stable, is renamed to `-C embed-bitcode` since that more accurately reflects what it does now anyway. Various tests and such are updated along the way as well. This'll also need to be backported to the beta channel to ensure we don't accidentally stabilize `-Cbitcode-in-rlib` as well.
2020-04-29Auto merge of #71528 - alexcrichton:no-more-bitcode, r=nnethercotebors-20/+26
Store LLVM bitcode in object files, not compressed This commit is an attempted resurrection of #70458 where LLVM bitcode emitted by rustc into rlibs is stored into object file sections rather than in a separate file. The main rationale for doing this is that when rustc emits bitcode it will no longer use a custom compression scheme which makes it both easier to interoperate with existing tools and also cuts down on compile time since this compression isn't happening. The blocker for this in #70458 turned out to be that native linkers didn't handle the new sections well, causing the sections to either trigger bugs in the linker or actually end up in the final linked artifact. This commit attempts to address these issues by ensuring that native linkers ignore the new sections by inserting custom flags with module-level inline assembly. Note that this does not currently change the API of the compiler at all. The pre-existing `-C bitcode-in-rlib` flag is co-opted to indicate whether the bitcode should be present in the object file or not. Finally, note that an important consequence of this commit, which is also one of its primary purposes, is to enable rustc's `-Clto` bitcode loading to load rlibs produced with `-Clinker-plugin-lto`. The goal here is that when you're building with LTO Cargo will tell rustc to skip codegen of all intermediate crates and only generate LLVM IR. Today rustc will generate both object code and LLVM IR, but the object code is later simply thrown away, wastefully.
2020-04-29Store LLVM bitcode in object files, not compressedAlex Crichton-20/+26
This commit is an attempted resurrection of #70458 where LLVM bitcode emitted by rustc into rlibs is stored into object file sections rather than in a separate file. The main rationale for doing this is that when rustc emits bitcode it will no longer use a custom compression scheme which makes it both easier to interoperate with existing tools and also cuts down on compile time since this compression isn't happening. The blocker for this in #70458 turned out to be that native linkers didn't handle the new sections well, causing the sections to either trigger bugs in the linker or actually end up in the final linked artifact. This commit attempts to address these issues by ensuring that native linkers ignore the new sections by inserting custom flags with module-level inline assembly. Note that this does not currently change the API of the compiler at all. The pre-existing `-C bitcode-in-rlib` flag is co-opted to indicate whether the bitcode should be present in the object file or not. Finally, note that an important consequence of this commit, which is also one of its primary purposes, is to enable rustc's `-Clto` bitcode loading to load rlibs produced with `-Clinker-plugin-lto`. The goal here is that when you're building with LTO Cargo will tell rustc to skip codegen of all intermediate crates and only generate LLVM IR. Today rustc will generate both object code and LLVM IR, but the object code is later simply thrown away, wastefully.
2020-04-28Rollup merge of #71641 - ehuss:update-books, r=ehussDylan DPC-0/+0
Update books ## nomicon 5 commits in 6eb24d6e9c0773d4aee68ed5fca121ce3cdf676a..4d2d275997746d35eabfc4d992dfbdcce2f626ed 2020-04-06 02:21:15 +0200 to 2020-04-27 10:24:52 -0400 - Fix example in FFI, section NPO - Update implementation code of `split_at_mut` - Use rust-lang/rust linkchecker on CI. - Use just `std::_` instead of `::std::_` - Remove illegal space. ## reference 2 commits in 3ce94caed4cf967106c51ae86be5e098f7875f11..ed22e6fbfcb6ce436e9ea3b4bb4a55b2fb50a57e 2020-04-11 17:00:27 +0200 to 2020-04-24 12:46:22 -0700 - Fix grammer for tuple patterns and tuple struct patterns (rust-lang-nursery/reference#794) - Document drop scopes (rust-lang-nursery/reference#514) ## book 2 commits in f5db319e0b19c22964398d56bc63103d669e1bba..e37c0e84e2ef73d3a4ebffda8011db6814a3b02d 2020-04-13 08:06:03 -0500 to 2020-04-26 09:31:36 -0500 - Mention short-circuiting in Appendix 02 (rust-lang/book#2318) - Increase HTTP buffer size and add 'Content-Length' header (rust-lang/book#2246) ## rust-by-example 8 commits in c106d1683c3a2b0960f0f0fb01728cbb19807332..ffc99581689fe2455908aaef5f5cf50dd03bb8f5 2020-04-09 09:14:39 -0300 to 2020-04-24 15:05:04 -0300 - Fix Example -> Examples (rust-lang/rust-by-example#1340) - Make unsuffixed literal plural (rust-lang/rust-by-example#1335) - Ensure example error matches the comment (rust-lang/rust-by-example#1336) - Add missing triple backticks (rust-lang/rust-by-example#1339) - Clarify conditional compilation (rust-lang/rust-by-example#1338) - Clarifies how to customize lib crate name (rust-lang/rust-by-example#1337) - Fix bytes of youkoso in shiftjis (rust-lang/rust-by-example#1333) - Fix possible typo (rust-lang/rust-by-example#1334) ## embedded-book 4 commits in 668fb07b6160b9c468f598e839c1e044db65de30..40beccdf1bb8eb9184a2e3b42db8b8c6e394247f 2020-04-13 12:38:16 +0000 to 2020-04-26 17:44:14 +0000 - Add hint on memory config to GDB debugging section (rust-embedded/book#215) - Adds cargo-generate to installation instructions (rust-embedded/book#213) - collections: Fix example allocator (rust-embedded/book#206) - Flip111/patch 8 (rust-embedded/book#233)
2020-04-28Rollup merge of #71637 - mibac138:cfg-sanitize, r=petrochenkovDylan DPC-10/+8
Minor formatting changes in `cfg-sanitize.md`
2020-04-28Update booksEric Huss-0/+0
2020-04-26unstable-book: Document `-Z tls-model`Vadim Petrochenkov-0/+25
2020-04-26rustc-book: Document `-C relocation-model`Vadim Petrochenkov-4/+39
2020-04-24Minor formatting changes in `cfg-sanitize.md`mibac138-10/+8
2020-04-22Alphabetize the `-C` and `-Z` options.Nicholas Nethercote-215/+215
In the code, test, and docs, because it makes it much easier to find things. Other than adding the comments about alphabetical order, this commit only moves things around.
2020-04-22Add a new option `-Cbitcode-in-rlib`.Nicholas Nethercote-0/+20
It defaults to true, but Cargo will set this to false whenever it can to reduce compile times.
2020-04-19Disallow values for `-C no-*` and `-Z no-*` options again.Nicholas Nethercote-17/+6
With the exception of `-C no-redzone`, because that could take a value before this PR. This partially undoes one of the earlier commits in this PR, which added the ability to take a value to all boolean options that lacked it. The help output for these options looks like this: ``` -C no-vectorize-slp=val -- disable LLVM's SLP vectorization pass ``` The "=val" part is a lie, but hopefully this will be fixed in the future.
2020-04-19Improve codegen option docs.Nicholas Nethercote-84/+101
This commit: - Adds "following values" indicators for all the options that are missing them. - Tweaks some wording and punctuation for consistency. - Rewords some things for clarity. - Removes the `no-integrated-as` entry, because that option was removed in #70345.
2020-04-14Update booksEric Huss-0/+0
2020-04-12Auto merge of #70873 - mark-i-m:update-rdg, r=JohnTitorbors-0/+0
Update rustc-dev-guide This should finally fix toolstate r? @JohnTitor
2020-04-09Fix JSON file_name documentation for macros.Eric Huss-2/+5
2020-04-09Rollup merge of #70918 - tobithiel:fix_forbid_override, r=davidtwcoMazdak Farrokhzad-1/+1
rustc_session: forbid lints override regardless of position Addresses the regression reported in #70819 for command line arguments, but does not address the source code flag regression.
2020-04-08update rusct-dev-guidemark-0/+0
2020-04-07rustc_session: forbid lints override regardless of positionTobias Thiel-1/+1
2020-04-07Corrects a typo in rustdoc documentation.Theo Sandstrom-3/+3
Fixes rust-lang#70856
2020-04-06update rustc-dev-guidemark-0/+0
2020-04-06Bump rust-by-example submoduleLinus Färnstrand-0/+0
2020-04-06Bump nomicon submoduleLinus Färnstrand-0/+0
2020-04-04Auto merge of #69898 - spastorino:rename-rustc-guide2, r=Xanewokbors-0/+0
Move rustc-guide submodule to rustc-dev-guide r? @pietroalbini
2020-04-04Auto merge of #69718 - arlosi:debughash, r=eddybbors-0/+11
Add hash of source files in debug info LLVM supports placing the hash of source files inside the debug info. This information can be used by a debugger to verify that the source code matches the executable. This change adds support for both hash algorithms supported by LLVM, MD5 and SHA1, controlled by a target option. * DWARF only supports MD5 * LLVM IR supports MD5 and SHA1 (and SHA256 in LLVM 11). * CodeView (.PDB) supports MD5, SHA1, and SHA256. Fixes #68980. Tracking issue: #70401 rustc dev guide PR with further details: https://github.com/rust-lang/rustc-dev-guide/pull/623
2020-04-03Auto merge of #70156 - michaelwoerister:incr-cgus, r=nikomatsakisbors-3/+2
Make the rustc respect the `-C codegen-units` flag in incremental mode. This PR implements (the as of yet unapproved) major change proposal at https://github.com/rust-lang/compiler-team/issues/245. See the description there for background and rationale. The changes are pretty straightforward and should be easy to rebase if the proposal gets accepted at some point. r? @nikomatsakis cc @pnkfelix
2020-04-02remove confusing about lvalues term@ßd€łw@ħ@ß-1/+1
2020-04-02Add hash of source files in debug infoArlo Siemsen-0/+11
* Adds either an MD5 or SHA1 hash to the debug info. * Adds new unstable option `-Z src-hash-algorithm` to control the hashing algorithm.
2020-04-02fix type in operands section@ßd€łw@ħ@ß-1/+1
2020-04-02Add missing markdown rust annotationlzutao-2/+2
2020-04-01Update -Ccodegen-units docs wrt incr. comp. in rustc book.Michael Woerister-3/+2
2020-04-01Add git repo address to unstable booklzutao-0/+3
2020-04-01Rollup merge of #70630 - ehuss:update-books, r=ehussDylan DPC-0/+0
Update books. ## reference 2 commits in e2f11fe4d6a5ecb471c70323197da43c70cb96b6..89dd146154474559536d5d4049a03831c501deea 2020-03-10 06:59:24 +0100 to 2020-03-31 09:42:10 -0700 - Clarify rule for end-of-line backslashes in strings (rust-lang-nursery/reference#784) - Fix and clarify section on re-export (rust-lang-nursery/reference#780) ## book 1 commits in 6fb3705e5230311b096d47f7e2c91f9ce24393d0..c8841f2841a2d26124319ddadd1b6a245f9a1856 2020-02-12 13:48:57 -0500 to 2020-03-22 09:07:01 -0500 - Fix broken front_of_house.rs test on nightly. (rust-lang/book#2289) ## rust-by-example 7 commits in cb369ae95ca36b841960182d26f6d5d9b2e3cc18..edd2a7e687358712608896730c083cb76c7b401a 2020-03-14 12:13:22 -0500 to 2020-03-30 09:37:29 -0300 - feat: add doc attributes section to documentation (rust-lang/rust-by-example#1323) - feat: add playpen topic (rust-lang/rust-by-example#1324) - feat: add sentence about rustdoc & std library (rust-lang/rust-by-example#1322) - fix: make spelling/style of rustdoc consistent (rust-lang/rust-by-example#1321) - Rewrite section on 'static lifetime. (rust-lang/rust-by-example#1320) - Remove deprecated `std::error::Error` functions and other minor changes (rust-lang/rust-by-example#1319) - Remove mdbook version flags from README (rust-lang/rust-by-example#1318) ## nomicon 1 commits in 9f797e65e6bcc79419975b17aff8e21c9adc039f..411197b0e77590c967e37e8f6ec681abd359afe8 2020-03-04 03:45:13 +0100 to 2020-03-31 20:46:09 +0200 - Fix negative_impls feature. (rust-lang-nursery/nomicon#205)
2020-03-31Update books.Eric Huss-0/+0
2020-03-30Document ThreadSanitizer in unstable-bookTomasz Miąsko-86/+150
2020-03-26Rename asm! to llvm_asm!Amanieu d'Antras-23/+23
asm! is left as a wrapper around llvm_asm! to maintain compatibility.
2020-03-26create a tracking issue and link to itNiko Matsakis-2/+2
2020-03-26introduce `negative_impls` feature gate and documentNiko Matsakis-1/+120
They used to be covered by `optin_builtin_traits` but negative impls are now applicable to all traits, not just auto traits. This also adds docs in the unstable book for the current state of auto traits.
2020-03-24Move rustc-guide submodule to rustc-dev-guideSantiago Pastorino-0/+0
2020-03-24Rollup merge of #69788 - ArekPiekarz:unstable_book_optin_builtin_traits, ↵Mazdak Farrokhzad-1/+1
r=Dylan-DPC Fix sequence of Type and Trait in optin-builtin-traits in Unstable Book A simple fix in docs - the sequence of words in basic example of negative trait implementation was reversed.
2020-03-23Rollup merge of #70300 - aleksator:66636_reword_unused_variable_warning, ↵Mazdak Farrokhzad-2/+2
r=Dylan-DPC Reword unused variable warning Fixes #66636
2020-03-23Rollup merge of #69494 - GuillaumeGomez:stabilize-crate-version, ↵Mazdak Farrokhzad-12/+12
r=ehuss,aleksator,ollie27 Stabilize --crate-version option in rustdoc I don't see any reason to not stabilize it anymore, so let's go! cc @kinnison @ehuss r? @ollie27
2020-03-23Reword unused variable warningAlex Tokarev-2/+2
2020-03-16Update booksEric Huss-0/+0
2020-03-16Rollup merge of #70014 - TimotheeGerber:small-fix-rustdoc-book, r=Dylan-DPCDylan DPC-7/+7
Small fixes in rustdoc book I read the `rustdoc` book today and noticed some small typos/problems. Mainly: - `# fn foo() {}` was displayed when not needed because fenced block code type was `text` instead of `rust`; - two path separators were missing and some Windows-style separators were not consistent with the rest of them (mainly Linux-style). Here are my proposed fixes. It is my first PR for the rust project. Don't hesitate to tell me if I am doing it wrong or if you need anything else. Have a nice day!
2020-03-14Fix punctuation in rustdoc bookTimothée Gerber-1/+1