Commit Graph

183 Commits

Author SHA1 Message Date
Eric Huss 845ec5df7a Remove docs on --extern metadata precedence. 2019-11-07 06:43:07 -08:00
Eric Huss b54e8ecc2e Update extern linking documentation. 2019-11-07 06:43:07 -08:00
Eric Huss b47e3d8fe4 Stabilize --extern flag without a path. 2019-11-07 05:51:17 -08:00
Mazdak Farrokhzad 574d2b83a1 patterns_in_fns_without_body -> deny 2019-11-06 11:10:37 +01:00
Mazdak Farrokhzad b54c5781b8 parenthesized_params_in_types_and_modules -> error 2019-11-06 11:10:37 +01:00
Mazdak Farrokhzad 98d2c510dd safe_extern_static -> error 2019-11-06 11:10:36 +01:00
Mazdak Farrokhzad 79b35e90f1 legacy_directory_ownership -> error 2019-11-06 11:08:23 +01:00
Mazdak Farrokhzad c0056c04f6 legacy_ctor_visibility -> error 2019-11-06 11:08:23 +01:00
Eric Huss 9b9d651288 Attempt to clarify LTO and codegen-units. 2019-11-03 06:00:58 -08:00
Eric Huss c6bfe28b95 Be more specific with -C inline-threshold. 2019-10-26 09:06:34 -07:00
Eric Huss bd70c03227 Apply suggestions from kinnison
Co-Authored-By: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-10-26 09:06:34 -07:00
Eric Huss f3e8c2e4a9 Update codegen option documentation. 2019-10-26 09:06:34 -07:00
togiberlin de3fd021f5 Target-feature documented as unsafe. rustc book and rustc -C help have been modified. 2019-10-22 17:16:45 +02:00
Mazdak Farrokhzad aba84894d1
Rollup merge of #62330 - SimonSapin:no-drop-in-union-fields, r=RalfJung
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-21 22:00:45 +02:00
bors 518deda77f Auto merge of #64925 - ehuss:document-json, r=Mark-Simulacrum
Document JSON message output.

This documents the JSON messages in the rustc book.
2019-10-18 10:15:26 +00:00
Michael Woerister f81b1548dd Add troubleshooting section to PGO chapter in rustc book. 2019-10-14 10:34:21 +02:00
Mazdak Farrokhzad d0f8bd6e26
Rollup merge of #65039 - HeroicKatora:deny-by-default-book, r=GuillaumeGomez
Document missing deny by default lints
2019-10-13 13:34:27 +02:00
Simon Sapin fe13bbd064 Remove unions_with_drop_fields lint
Cases where it would trigger are now hard errors.
2019-10-11 10:43:54 +02:00
Andreas Molzer 334bafebc9 Document current deny by default lints 2019-10-03 04:46:24 +02:00
Robin Kruppe 8e9f635a70
rustc book: nitpick SLP vectorization
SLP vectorization (in general and as implemented in LLVM) is not limited to loops.
2019-10-02 14:41:49 +02:00
Eric Huss f04ea6c7e1 Document JSON message output. 2019-09-30 13:00:43 -07:00
Michael Woerister b0bb3017c1 Update xLTO compatibility table in rustc book. 2019-09-02 13:50:44 +02:00
Naja Melan 98bd60c281
Update single-use-lifetimes
When using this, rustc emits a warning that the lint has been renamed (to having an 's' at the end)
2019-08-22 22:39:21 +00:00
Jeremy Fitzhardinge d2219c2e2e rustc: implement argsfiles for command line
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-08-19 19:06:46 -07:00
Alex Crichton 17312337a9 rustc: Stabilize options for pipelined compilation
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-26 07:46:35 -07:00
Samy Kacimi ca8420c61f
Normalize use of backticks in compiler messages for doc
https://github.com/rust-lang/rust/issues/60532
2019-07-23 20:06:00 +02:00
Eric Huss 04538c680c Update mdbook, cargo, books
This updates the last of the books using mdbook 0.1, finally
removing it from the build.
2019-07-17 12:46:36 -07:00
bors 0beb2ba16a Auto merge of #61268 - michaelwoerister:stabilize-pgo, r=alexcrichton
Stabilize support for Profile-guided Optimization

This PR makes profile-guided optimization available via the `-C profile-generate` / `-C profile-use` pair of commandline flags and adds end-user documentation for the feature to the [rustc book](https://doc.rust-lang.org/rustc/). The PR thus ticks the last two remaining checkboxes of the [stabilization tracking issue](https://github.com/rust-lang/rust/issues/59913).

From the tracking issue:
> Profile-guided optimization (PGO) is a common optimization technique for ahead-of-time compilers. It works by collecting data about a program's typical execution (e.g. probability of branches taken, typical runtime values of variables, etc) and then uses this information during program optimization for things like inlining decisions, machine code layout, or indirect call promotion.

If you are curious about how this can be used, there is a rendered version of the documentation this PR adds available [here](
https://github.com/michaelwoerister/rust/blob/stabilize-pgo/src/doc/rustc/src/profile-guided-optimization.md).

r? @alexcrichton
cc @rust-lang/compiler
2019-07-02 20:00:29 +00:00
Mazdak Farrokhzad 653b44dbf7
Rollup merge of #61267 - michaelwoerister:update-xlto-table, r=alexcrichton
rustc-book: Update the rustc/clang compatibility table for xLTO.

Firefox is using these combinations successfully.
2019-06-22 01:42:33 +02:00
Michael Woerister 314194ef17 rustc-book: Add documentation on how to use PGO. 2019-06-21 09:48:43 +02:00
Vadim Petrochenkov 6a66491883 Remove some more `#![feature(custom_attribute)]`s 2019-06-08 23:55:25 +03:00
Michael Woerister f65b6a8786 rustc-book: Update the rustc/clang compatibility table for xLTO. 2019-05-28 16:26:41 +02:00
Cerberuser 9be8b7edc9
Fixed type-alias-bounds lint doc
The example code under type-alias-bounds lint produced two warnings - one from the lint itself and another from the dead_code lint, and only the second one was in the doc. This looked like an error, so I've added `#[allow(dead_code)]` and replaced the example output with the expected one.
[Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&code=%23%5Ballow(dead_code)%5D%0Atype%20SendVec%3CT%3A%20Send%3E%20%3D%20Vec%3CT%3E%3B)
2019-05-24 12:09:33 +07:00
bors a614cee22e Auto merge of #49799 - hdhoang:46205_deny_incoherent_fundamental_impls, r=nikomatsakis
lint: convert incoherent_fundamental_impls into hard error

*Summary for affected authors:* If your crate depends on one of the following crates, please upgrade to a newer version:
- gtk-rs: upgrade to at least 0.4
- rusqlite: upgrade to at least 0.14
- nalgebra: upgrade to at least 0.15, or the last patch version of 0.14
- spade: upgrade or refresh the Cargo.lock file to use version 1.7
- imageproc: upgrade to at least 0.16 (newer versions no longer use nalgebra)

implement #46205

r? @nikomatsakis
2019-05-17 23:06:51 +00:00
Eric Huss e392db6cd4 Update rustc book CLI docs. 2019-05-12 14:16:50 -07:00
Hoàng Đức Hiếu 9982e7d407 lint: convert incoherent_fundamental_impls into hard error
Also remove it from lint listings.
2019-04-16 08:12:14 +07:00
Christian cdeb7455ea Updated the description of -Z in the rustc book. 2019-04-10 12:20:47 +02:00
Christian 5c7a94459c Add documentation on the -Z flag on the command-line arguments section in the rustc book. 2019-04-03 22:20:18 +02:00
Mazdak Farrokhzad 554aed6c7d
Rollup merge of #55632 - ollie27:deny_overflowing_literals, r=Centril
Deny the `overflowing_literals` lint for all editions

The `overflowing_literals` was made deny by default for the 2018 edition by #54507, however I'm not aware of any reason it can't be made deny by default for the 2015 edition as well.
2019-02-25 11:42:18 +01:00
kennytm 717aa46178
Rollup merge of #58544 - TheBiggerGuy:rustc-doc-cli-args, r=TimNN
Fix doc for rustc "-g" flag

The rustc `-g` CLI flag was miss documented to be a synonym of `-C debug-level=2` and not `-C debuglevel=2`. Also add links to the codegen docs for each synonym.

I am unsure of this will conflict with work on #52938
2019-02-20 11:58:58 +08:00
Guy Taylor 88e462bf7f Add links to codegen docs for rustc synonym flags
The rustc "-g" and "-o" fags are synonyms of the "-c" codegen flags.
This adds a link to the codegen docs for each synonym.
2019-02-17 19:45:13 +00:00
Guy Taylor 55c25f8c8d Fix doc for rustc "-g" flag
The rustc "-g" CLI flag was miss documented to be a synonym of "-C
debug-level=2" and not the correct "-C debuginfo=2".
2019-02-17 19:44:45 +00:00
Dale Wijnand 8fbb013c1c
Mention capping forbid lints
I felt the description of forbid was misleading/incomplete without
mentioning how --cap-lints interacts with it.
2019-02-17 10:24:25 +00:00
Michael Woerister 3733b3267d Add documentation about -Clinker-plugin-lto to rustc book. 2019-02-12 15:42:04 +01:00
Mazdak Farrokhzad bb683b9f3a
Rollup merge of #57212 - phansch:improve_rustc_book_contributing, r=steveklabnik
docs(rustc): Link to the book's source in rustc

This makes the source of [the rustc book](https://doc.rust-lang.org/rustc/what-is-rustc.html) book a bit more discoverable.
2019-01-18 22:56:37 +01:00
Mazdak Farrokhzad 04a2cbd1c8
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
Document that `-C opt-level=0` implies `-C debug-assertions`.

I couldn't find it stated anywhere else (https://doc.rust-lang.org/nightly/rustc/codegen-options/index.html#opt-level).
It was a problem before here: https://github.com/rust-lang/rust/issues/39449, it got lost in the migration to the new documentation I assume.

On a sidenote: I think that `-C opt-level=0` having a sideeffect on another flag should be changed. Having compiler flags affecting others doesn't make much sense to me, they are used to fine tune anyway.
In any case, this plays no role in this PR.
2019-01-18 22:56:35 +01:00
Oliver Middleton c654968100 Deny the `overflowing_literals` lint for all editions 2019-01-17 09:22:52 +00:00
Wiktor Kuchta 190d139f3a Fix repeated word typos
Found with `git grep -P '\b([a-z]+)\s+\1\b'`
2019-01-03 21:33:37 +01:00
Philipp Hansch 11b0fa21a6
docs(rustc): Link to the book's source in rustc 2018-12-30 12:23:24 +01:00
daxpedda 284f0d3645
Document that `-C opt-level=0` implies `-C debug-assertions`. 2018-12-26 18:19:46 +01:00
bors 37551e9396 Auto merge of #56770 - satyarohith:patch-1, r=Centril
docs(rustc): make hello() public

Running the example code [here](https://doc.rust-lang.org/rustc/what-is-rustc.html#basic-usage) throws error:
```
error[E0603]: function `hello` is private
 --> src/main.rs:4:10
  |
4 |     foo::hello();
  |          ^^^^^
```
Making  `hello()` public fixes the problem.
2018-12-24 16:16:07 +00:00
Roberto Vidal b6b278e552 Fixes broken links 2018-12-14 10:40:08 +01:00
Satya Rohith 9da1dd74c0
fix: make hello public 2018-12-13 15:07:10 +05:30
David Wood 9536d04a2d
Stabilize `linker-flavor` flag.
This commit moves the linker-flavor flag from a debugging option to a
codegen option, thus stabilizing it. There are no feature flags
associated with this flag.
2018-12-13 09:41:46 +01:00
Mark Mansi 6494f1e60e rustc-guide has moved 2018-11-26 15:03:13 -06:00
Havvy (Ryan Scheel) 8c186af538 [Rustc Book] Quotes around value in --cfg example 2018-10-16 00:13:05 -07:00
Havvy (Ryan Scheel) 8e10ea6829 [Rustc Book] Explain --cfg's arguments 2018-10-15 21:38:32 -07:00
varkor f5b89062f6 Unused result warning: "X which must" ↦ "X that must" 2018-10-14 18:25:30 +01:00
Behnam Esfahbod 88fe8acd89 docs: Use dollar sign for all bash prompts
Making it consistent across the board, as most of them already use `$`.

Also split one continues bash run into two, to make it easier see
different runs: one with warning and another with error.
2018-09-08 21:22:00 -07:00
kennytm 1805f3c2fb
Rollup merge of #53550 - brson:recurring, r=estebank
librustc_lint: In recursion warning, change 'recurring' to 'recursing'

The existing wording seems incorrect.

Aside: This warning, 'function cannot return without recursing' is not perfectly clear - it implies that the function _can_ return, it's just got to recurse. But really the fn cannot return period. Clearer wording: 'function recurses infinitely; it cannot return'; or 'function is infinitely self-recursive; it cannot return, and this is probably an error'. I like that.
2018-09-07 15:26:40 +08:00
Brian Anderson f4d6362518 librustc_lint: In recursion warning, change 'recurring' to 'recursing' 2018-08-20 23:09:15 -07:00
Matthias Krüger 71120ef1e5 Fix typos found by codespell. 2018-08-19 17:41:28 +02:00
Vadim Petrochenkov e60eaf59df Fix naming conventions for new lints 2018-05-25 02:35:07 +03:00
Vadim Petrochenkov d1b027421e Turn deprecation lint `legacy_imports` into a hard error 2018-05-15 02:25:04 +03:00
Hoàng Đức Hiếu cabbe50c55 ignore erroneous example 2018-05-03 08:17:21 +07:00
Hoàng Đức Hiếu 8e4072cb4b fix error text 2018-05-03 08:16:34 +07:00
Hoàng Đức Hiếu 2fce5b34f6 doc: move incoherent_fundamental_impls to deny-by-default listing 2018-05-03 07:52:36 +07:00
steveklabnik 36475d947b more nits 2018-04-24 12:21:08 -04:00
steveklabnik ac79c41edc review nits 2018-04-23 11:58:11 -04:00
steveklabnik 00c860e8a9 write docs for targets 2018-04-16 12:57:16 -04:00
steveklabnik b204968239 fill out contributing 2018-04-16 12:57:09 -04:00
steveklabnik cd3f6cf3fe fill out command line arguments 2018-04-16 12:57:01 -04:00
steveklabnik cb6a19925a add codegen options section 2018-04-10 16:35:28 -04:00
steveklabnik 142c52f4a3 fix tests 2018-04-09 14:04:58 -04:00
steveklabnik 758a77d46c more lints 2018-04-09 14:04:58 -04:00
steveklabnik df81ca3764 document deny by default lints 2018-04-09 14:04:58 -04:00
steveklabnik 50b3a3d121 add a lot of text about lints 2018-04-09 14:04:58 -04:00
steveklabnik 78b076dadb add targets to TOC 2018-04-09 14:04:58 -04:00
steveklabnik cd55364248 write 'what is rustc' 2018-04-09 14:04:58 -04:00
steveklabnik 5424dc46b7 write headings for command line arguments 2018-04-09 14:04:57 -04:00
steveklabnik 4f6ed513d1 fix authorship in book.toml 2018-04-09 14:04:57 -04:00
steveklabnik c942bf42fc Add a TOC 2018-04-09 14:04:57 -04:00
steveklabnik 0dd0a5bc03 initialize the rustc book 2018-04-09 14:04:10 -04:00