about summary refs log tree commit diff
path: root/src/doc/rustc
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-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-26rustc-book: Document `-C relocation-model`Vadim Petrochenkov-4/+39
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-09Fix JSON file_name documentation for macros.Eric Huss-2/+5
2020-04-07rustc_session: forbid lints override regardless of positionTobias Thiel-1/+1
2020-04-01Update -Ccodegen-units docs wrt incr. comp. in rustc book.Michael Woerister-3/+2
2020-03-23Reword unused variable warningAlex Tokarev-2/+2
2020-03-12Rollup merge of #69747 - spastorino:rename-rustc-guide, r=pietroalbiniMazdak Farrokhzad-2/+2
Rename rustc guide This is in preparation for https://github.com/rust-lang/rustc-guide/issues/470 Needs to be merged after we actually rename the guide. Have used this to rename: `git grep -l 'rustc_guide' | xargs sed -i 's/rustc_guide/rustc_dev_guide/g'` `git grep -l 'rustc-guide' | xargs sed -i 's/rustc-guide/rustc-dev-guide/g'` `git grep -l 'rustc guide' | xargs sed -i 's/rustc guide/rustc dev guide/g'`
2020-03-10rust-lang.github.io/rustc-dev-guide -> rustc-dev-guide.rust-lang.orgSantiago Pastorino-1/+1
2020-03-10Rename rustc_guide to rustc_dev_guideSantiago Pastorino-2/+2
2020-03-10Rename rustc-guide to rustc-dev-guideSantiago Pastorino-1/+1
2020-03-07Add new option to the documentation.O01eg-0/+1
2020-01-13rustc: add lint level cli ordering into the documentationTobias Thiel-0/+20
2019-12-01rustc_lint: Remove lint `plugin_as_library`Vadim Petrochenkov-12/+0
2019-11-23docs: fix lint name for `unused_variables`Ivan Kozik-1/+1
2019-11-08Rollup merge of #65785 - Centril:compat-to-error-2, r=oli-obkMazdak Farrokhzad-104/+27
Transition future compat lints to {ERROR, DENY} - Take 2 Follow up to https://github.com/rust-lang/rust/pull/63247 implementing https://github.com/rust-lang/rust/pull/63247#issuecomment-536295992. - `legacy_ctor_visibility` (ERROR) -- closes #39207 - `legacy_directory_ownership` (ERROR) -- closes #37872 - `safe_extern_static` (ERROR) -- closes #36247 - `parenthesized_params_in_types_and_modules` (ERROR) -- closes #42238 - `duplicate_macro_exports` (ERROR) - `nested_impl_trait` (ERROR) -- closes #59014 - `ill_formed_attribute_input` (DENY) -- transitions #57571 - `patterns_in_fns_without_body` (DENY) -- transitions #35203 r? @varkor cc @petrochenkov
2019-11-07Remove docs on --extern metadata precedence.Eric Huss-3/+2
2019-11-07Update extern linking documentation.Eric Huss-7/+27
2019-11-07Stabilize --extern flag without a path.Eric Huss-1/+6
2019-11-06patterns_in_fns_without_body -> denyMazdak Farrokhzad-40/+40
2019-11-06parenthesized_params_in_types_and_modules -> errorMazdak Farrokhzad-25/+0
2019-11-06safe_extern_static -> errorMazdak Farrokhzad-5/+0
2019-11-06legacy_directory_ownership -> errorMazdak Farrokhzad-12/+0
2019-11-06legacy_ctor_visibility -> errorMazdak Farrokhzad-35/+0
2019-11-03Attempt to clarify LTO and codegen-units.Eric Huss-10/+21
2019-10-26Be more specific with -C inline-threshold.Eric Huss-6/+14
2019-10-26Apply suggestions from kinnisonEric Huss-5/+5
Co-Authored-By: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-10-26Update codegen option documentation.Eric Huss-68/+235
2019-10-22Target-feature documented as unsafe. rustc book and rustc -C help have been ↵togiberlin-1/+23
modified.
2019-10-21Rollup merge of #62330 - SimonSapin:no-drop-in-union-fields, r=RalfJungMazdak Farrokhzad-24/+0
Change untagged_unions to not allow union fields with drop This is a rebase of #56440, massaged to solve merge conflicts and make the test suite pass. Change untagged_unions to not allow union fields with drop Union fields may now never have a type with attached destructor. This for example allows unions to use arbitrary field types only by wrapping them in `ManuallyDrop` (or similar). The stable rule remains, that union fields must be `Copy`. We use the new rule for the `untagged_union` feature. Tracking issue: https://github.com/rust-lang/rust/issues/55149
2019-10-18Auto merge of #64925 - ehuss:document-json, r=Mark-Simulacrumbors-1/+240
Document JSON message output. This documents the JSON messages in the rustc book.
2019-10-14Add troubleshooting section to PGO chapter in rustc book.Michael Woerister-0/+11
2019-10-13Rollup merge of #65039 - HeroicKatora:deny-by-default-book, r=GuillaumeGomezMazdak Farrokhzad-0/+25
Document missing deny by default lints
2019-10-11Remove unions_with_drop_fields lintSimon Sapin-24/+0
Cases where it would trigger are now hard errors.
2019-10-03Document current deny by default lintsAndreas Molzer-0/+25
2019-10-02rustc book: nitpick SLP vectorizationRobin Kruppe-1/+1
SLP vectorization (in general and as implemented in LLVM) is not limited to loops.
2019-09-30Document JSON message output.Eric Huss-1/+240
2019-09-02Update xLTO compatibility table in rustc book.Michael Woerister-0/+1
2019-08-22Update single-use-lifetimesNaja Melan-1/+1
When using this, rustc emits a warning that the lint has been renamed (to having an 's' at the end)
2019-08-19rustc: implement argsfiles for command lineJeremy Fitzhardinge-0/+7
This makes `rustc` support `@path` arguments on the command line. The `path` is opened and the file is interpreted as new command line options which are logically inserted at that point in the command-line. The options in the file are one per line. The file is UTF-8 encoded, and may have either Unix or Windows line endings. It does not support recursive use of `@path`. This is useful for very large command lines, or when command-lines are being generated into files by other tooling.
2019-07-26rustc: Stabilize options for pipelined compilationAlex Crichton-0/+33
This commit stabilizes options in the compiler necessary for Cargo to enable "pipelined compilation" by default. The concept of pipelined compilation, how it's implemented, and what it means for rustc are documented in #60988. This PR is coupled with a PR against Cargo (rust-lang/cargo#7143) which updates Cargo's support for pipelined compliation to rustc, and also enables support by default in Cargo. (note that the Cargo PR cannot land until this one against rustc lands). The technical changes performed here were to stabilize the functionality proposed in #60419 and #60987, the underlying pieces to enable pipelined compilation support in Cargo. The issues have had some discussion during stabilization, but the newly stabilized surface area here is: * A new `--json` flag was added to the compiler. * The `--json` flag can be passed multiple times. * The value of the `--json` flag is a comma-separated list of directives. * The `--json` flag cannot be combined with `--color` * The `--json` flag must be combined with `--error-format=json` * The acceptable list of directives to `--json` are: * `diagnostic-short` - the `rendered` field of diagnostics will have a "short" rendering matching `--error-format=short` * `diagnostic-rendered-ansi` - the `rendered` field of diagnostics will be colorized with ansi color codes embedded in the string field * `artifacts` - JSON blobs will be emitted for artifacts being emitted by the compiler The unstable `-Z emit-artifact-notifications` and `--json-rendered` flags have also been removed during this commit as well. Closes #60419 Closes #60987 Closes #60988
2019-07-23Normalize use of backticks in compiler messages for docSamy Kacimi-22/+22
https://github.com/rust-lang/rust/issues/60532