about summary refs log tree commit diff
path: root/compiler/rustc_session/src
AgeCommit message (Collapse)AuthorLines
2023-02-16Add feature gate for non_lifetime_bindersMichael Goulet-9/+19
2023-02-14Add `kernel-address` sanitizer support for freestanding targetsWesley Norris-4/+11
2023-02-13Rollup merge of #107838 - estebank:terminal_hyperlinks, r=nagisaMatthias Krüger-1/+33
Introduce `-Zterminal-urls` to use OSC8 for error codes Terminals supporting the OSC8 Hyperlink Extension can support inline anchors where the text is user defineable but clicking on it opens a browser to a specified URLs, just like `<a href="URL">` does in HTML. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
2023-02-12Rollup merge of #107748 - tshepang:renamed, r=cuviperMatthias Krüger-1/+1
refer to new home The module has since been made its own crate... see 2d75a339ca9e7cd11338b165311927e6eb73cca4.
2023-02-11Auto merge of #94857 - petrochenkov:doclink2, r=oli-obkbors-2/+29
Resolve documentation links in rustc and store the results in metadata This PR implements MCP https://github.com/rust-lang/compiler-team/issues/584. Doc links are now resolved in rustc and stored into metadata, so rustdoc simply retrieves them through a query (local or extern), Code that is no longer used is removed, and some code that no longer needs to be public is privatized. The removed code includes resolver cloning, so this PR fixes https://github.com/rust-lang/rust/issues/83761.
2023-02-10Skip doc link resolution for some crate types and non-exported itemsVadim Petrochenkov-2/+29
2023-02-10Rollup merge of #107043 - Nilstrieb:true-and-false-is-false, r=wesleywiserMatthias Krüger-5/+5
Support `true` and `false` as boolean flag params Implements [MCP 577](https://github.com/rust-lang/compiler-team/issues/577).
2023-02-10Auto merge of #102963 - ilammy:xray-basic, r=estebankbors-3/+106
Add `-Z instrument-xray` flag Implement MCP https://github.com/rust-lang/compiler-team/issues/561, adding `-Z instrument-xray` flag which enables XRay instrumentation in LLVM.
2023-02-09Introduce `-Zterminal-urls` to use OSC8 for error codesEsteban Küber-1/+33
Terminals supporting the OSC8 Hyperlink Extension can support inline anchors where the text is user defineable but clicking on it opens a browser to a specified URLs, just like `<a href="URL">` does in HTML. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
2023-02-09Emit an error if -Z instrument-xray is not supportedOleksii Lozovskyi-0/+10
This is somewhat important because LLVM enables the pass based on target architecture, but support by the target OS also matters. For example, XRay attributes are processed by codegen for macOS targets, but Apple linker fails to process relocations in XRay data sections, so the feature as a whole is not supported there for the time being.
2023-02-09Parse "-Z instrument-xray" codegen optionOleksii Lozovskyi-3/+96
Recognize all bells and whistles that LLVM's XRay pass is capable of. The always/never settings are a bit dumb without attributes but they're still there. The default instruction count is chosen by the compiler, not LLVM pass. We'll do it later.
2023-02-07Replace a command line flag with an env var to allow tools to initialize the ↵Oli Scherer-2/+0
tracing loggers at their own discretion
2023-02-07refer to new homeTshepang Mbambo-1/+1
The module has since been made its own crate... see 2d75a339ca9e7cd11338b165311927e6eb73cca4.
2023-02-05Sort Generator `print-type-sizes` according to their yield pointsArpad Borsos-1/+5
Especially when trying to diagnose runaway future sizes, it might be more intuitive to sort the variants according to the control flow (aka their yield points) rather than the size of the variants.
2023-02-05rustc_session: remove huge error importsest31-29/+23
2023-02-02Rename `rust_2015` => `is_rust_2015`Maybe Waffle-2/+2
2023-02-01Rollup merge of #107533 - ↵Matthias Krüger-5/+23
pnkfelix:distinguish-generator-state-in-print-type-sizes, r=compiler-errors Extend `-Z print-type-sizes` to distinguish generator upvars+locals from "normal" fields. For example, for this code: ```rust async fn wait() {} async fn test(arg: [u8; 8192]) { wait().await; drop(arg); } async fn test_ideal(_rg: [u8; 8192]) { wait().await; // drop(arg); } fn main() { let gen_t = test([0; 8192]); let gen_i = test_ideal([0; 8192]); println!("expect {}, got: {}", std::mem::size_of_val(&gen_i), std::mem::size_of_val(&gen_t)); } ``` the `-Z print-type-sizes` output used to start with: ``` print-type-size type: `[async fn body@issue-62958-a.rs:3:32: 6:2]`: 16386 bytes, alignment: 1 bytes print-type-size discriminant: 1 bytes print-type-size variant `Suspend0`: 16385 bytes print-type-size field `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes print-type-size field `.arg`: 8192 bytes print-type-size field `.__awaitee`: 1 bytes ... print-type-size type: `std::mem::ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes print-type-size field `.value`: 8192 bytes ... ``` but with this change, it now instead prints: ``` print-type-size type: `[async fn body@issue-62958-a.rs:3:32: 6:2]`: 16386 bytes, alignment: 1 bytes print-type-size discriminant: 1 bytes print-type-size variant `Suspend0`: 16385 bytes print-type-size upvar `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes print-type-size local `.arg`: 8192 bytes print-type-size local `.__awaitee`: 1 bytes ... print-type-size type: `std::mem::ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes print-type-size field `.value`: 8192 bytes ``` (spawned off of investigation of https://github.com/rust-lang/rust/issues/62958 )
2023-01-31Rollup merge of #107508 - WaffleLapkin:uneq'15, r=oli-obkGuillaume Gomez-4/+5
`Edition` micro refactor r? ``@oli-obk``
2023-01-31placate tidy.Felix S. Klock II-3/+3
2023-01-31Extend `-Z print-type-sizes` to distinguish generator upvars and locals from ↵Felix S. Klock II-5/+23
"normal" ADT fields.
2023-01-31Document `rust_2015` methodsMaybe Waffle-0/+1
2023-01-31Use `Edition` methods a bit moreMaybe Waffle-4/+4
2023-01-30session: diagnostic migration lint on more fnsDavid Wood-4/+29
Apply the diagnostic migration lint to more functions on `Session`. Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-30session: impl `IntoDiagnosticArg` for `CrateType`David Wood-1/+7
Forward the `Display` implementation for `CrateType` to `IntoDiagnosticArg` so that it can be used in diagnostic structs. Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-29Rollup merge of #107006 - b-naber:thir-tree, r=jackh726Matthias Krüger-3/+8
Output tree representation on thir-tree The current output of `-Zunpretty=thir-tree` is really cumbersome to work with, using an actual tree representation should make it easier to see what the thir looks like.
2023-01-29Auto merge of #106227 - bryangarza:ctfe-limit, r=oli-obkbors-0/+2
Use stable metric for const eval limit instead of current terminator-based logic This patch adds a `MirPass` that inserts a new MIR instruction `ConstEvalCounter` to any loops and function calls in the CFG. This instruction is used during Const Eval to count against the `const_eval_limit`, and emit the `StepLimitReached` error, replacing the current logic which uses Terminators only. The new method of counting loops and function calls should be more stable across compiler versions (i.e., not cause crates that compiled successfully before, to no longer compile when changes to the MIR generation/optimization are made). Also see: #103877
2023-01-27Add `drop_tracking_mir` option.Camille GILLOT-0/+2
2023-01-27Rollup merge of #106856 - vadorovsky:fix-atomic-annotations, r=joshtriplettYuki Okushi-0/+8
core: Support variety of atomic widths in width-agnostic functions Before this change, the following functions and macros were annotated with `#[cfg(target_has_atomic = "8")]` or `#[cfg(target_has_atomic_load_store = "8")]`: * `atomic_int` * `strongest_failure_ordering` * `atomic_swap` * `atomic_add` * `atomic_sub` * `atomic_compare_exchange` * `atomic_compare_exchange_weak` * `atomic_and` * `atomic_nand` * `atomic_or` * `atomic_xor` * `atomic_max` * `atomic_min` * `atomic_umax` * `atomic_umin` However, none of those functions and macros actually depend on 8-bit width and they are needed for all atomic widths (16-bit, 32-bit, 64-bit etc.). Some targets might not support 8-bit atomics (i.e. BPF, if we would enable atomic CAS for it). This change fixes that by removing the `"8"` argument from annotations, which results in accepting the whole variety of widths. Fixes #106845 Fixes #106795 Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2023-01-26previous thir unpretty output through thir-flatb-naber-3/+8
2023-01-26Rollup merge of #106904 - khuey:preserve_debuginfo_for_rlibs, r=davidtwcoMatthias Krüger-12/+0
Preserve split DWARF files when building archives. r? ```@davidtwco```
2023-01-25Add `target_has_atomic*` symbols if any atomic width is supportedMichal Rostecki-0/+8
Atomic operations for different widths (8-bit, 16-bit, 32-bit etc.) are guarded by `target_has_atomic = "value"` symbol (i.e. `target_has_atomic = "8"`) (and the other derivatives), but before this change, there was no width-agnostic symbol indicating a general availability of atomic operations. This change introduces: * `target_has_atomic_load_store` symbol when atomics for any integer width are supported by the target. * `target_has_atomic` symbol when also CAS is supported. Fixes #106845 Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
2023-01-23Replace terminator-based const eval limitBryan Garza-0/+2
- Remove logic that limits const eval based on terminators, and use the stable metric instead (back edges + fn calls) - Add unstable flag `tiny-const-eval-limit` to add UI tests that do not have to go up to the regular 2M step limit
2023-01-19Auto merge of #106810 - oli-obk:resolver_reverse_plumbing, r=petrochenkovbors-16/+41
Various cleanups around pre-TyCtxt queries and functions part of #105462 based on https://github.com/rust-lang/rust/pull/106776 (everything starting at [0e2b39f](https://github.com/rust-lang/rust/pull/106810/commits/0e2b39fd1ffde51b50d45ccbe41de52b85136b8b) is new in this PR) r? `@petrochenkov` I think this should be most of the uncontroversial part of #105462.
2023-01-18Support `true` and `false` as boolean flag paramsNilstrieb-5/+5
Implements MCP 577.
2023-01-17Rollup merge of #104505 - WaffleLapkin:no-double-spaces-in-comments, r=jackh726Matthias Krüger-7/+7
Remove double spaces after dots in comments Most of the comments do not have double spaces, so I assume these are typos.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-7/+7
2023-01-16Avoid an unnecessary allocationOli Scherer-9/+9
2023-01-16Move compiler input and ouput paths into sessionOli Scherer-12/+19
2023-01-16check -Z query-dep-graph is enabled if -Z dump-dep-graph (#106736)gftea-0/+5
2023-01-16Remove redundant `input_path` field from `Config`Oli Scherer-0/+18
2023-01-15Preserve split DWARF files when building archives.Kyle Huey-12/+0
The optimization that removes artifacts when building libraries is correct from the compiler's perspective but not from a debugger's perspective. Unpacked split debuginfo is referred to by filename and debuggers need the artifact that contains debuginfo to continue to exist at that path. Ironically the test expects the correct behavior but it was not running.
2023-01-14Removed various double spaces in compiler source comments.André Vennberg-1/+1
2023-01-11Rollup merge of #106709 - khuey:disable_split_dwarf_inlining_by_default, ↵nils-1/+1
r=davidtwco Disable "split dwarf inlining" by default. This matches clang's behavior and makes split-debuginfo behave as expected (i.e. actually split the debug info). Fixes #106592
2023-01-12Add log-backtrace option to show backtraces along with loggingYuki Omoto-0/+2
2023-01-10Disable "split dwarf inlining" by default.Kyle Huey-1/+1
This matches clang's behavior and makes split-debuginfo behave as expected (i.e. actually split the debug info). Fixes #106592
2023-01-11Rollup merge of #106671 - tmiasko:opt-bool, r=wesleywiserYuki Okushi-2/+2
Change flags with a fixed default value from Option<bool> to bool
2023-01-10Change type of box_noalias to boolTomasz Miąsko-1/+1
2023-01-10Change type of mutable_noalias to boolTomasz Miąsko-1/+1
2023-01-09Fix help docs for -Zallow-featuresEric Huss-1/+1
2023-01-06Rollup merge of #106542 - sigaloid:master, r=bjorn3Matthias Krüger-2/+8
Add default and latest stable edition to --edition in rustc (attempt 2) Fixes #106041 No longer leaks string like my first attempt PR, #106094 - uses LazyLock to construct a `&'static str` It will now output the default edition and latest stable edition in the help message for the `--edition` flag. Going to request the same reviewer as the first attempt for continuity - r? `@Nilstrieb`