about summary refs log tree commit diff
path: root/compiler/rustc_session/src
AgeCommit message (Collapse)AuthorLines
2022-09-21UPDATE - rename DiagnosticHandler macro to DiagnosticJhonny Bill Mena-4/+4
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-29/+29
2022-09-21UPDATE - move SessionDiagnostic from rustc_session to rustc_errorsJhonny Bill Mena-12/+2
2022-09-18Remove -Znew-llvm-pass-managerJosh Stone-2/+0
2022-09-15Only enable the let_else feature on bootstrapest31-1/+1
On later stages, the feature is already stable. Result of running: rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"
2022-09-14make `mk_attr_id` part of `ParseSess`SparrowLii-0/+4
2022-09-13Rollup merge of #101266 - LuisCardosoOliveira:translation-rustcsession-pt3, ↵Matthias Krüger-25/+107
r=davidtwco translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Final # Description This is the final part of the rustc_session https://github.com/rust-lang/rust/issues/100717#issuecomment-1220279883. Please only review this [commit](https://github.com/rust-lang/rust/pull/101266/commits/a54534703774bfb9fc344f61d511760a7c43fe94). The other ones are from the PR https://github.com/rust-lang/rust/pull/101041# that is not yet merged. In this PR, we migrate the file `output.rs`
2022-09-13Rollup merge of #101690 - kadiwa4:avoid_iterator_last, r=oli-obkDylan DPC-4/+2
Avoid `Iterator::last` Adapters like `Filter` and `Map` use the default implementation of `Iterator::last` which is not short-circuiting (and so does `core::str::Split`). The predicate function will be run for every single item of the underlying iterator. I hope that removing those calls to `last` results in slight performance improvements.
2022-09-13Auto merge of #100101 - BelovDV:issue-99429, r=petrochenkovbors-0/+4
change rlib format to distinguish native dependencies Another one method to solve problem mentioned in #99429. Changed .rlib format, it contains all bundled native libraries as archieves. At link time rlib is unpacked and native dependencies linked separately. New behavior hidden under separate_native_rlib_dependencies flag.
2022-09-12change rlib format to discern native dependenciesDaniil Belov-0/+4
2022-09-12Rollup merge of #100293 - yanchen4791:add-inline-llvm-option, r=nnethercoteDylan DPC-0/+2
Add inline-llvm option for disabling/enabling LLVM inlining In this PR, a new -Z option `inline-llvm` is added in order to be able to turn on/off LLVM inlining. The capability of turning on/off inlining in LLVM backend is needed for testing performance implications of using recently enabled inlining in rustc's frontend (with -Z inline-mir=yes option, #91743). It would be interesting to see the performance effect using rustc's frontend inlining only without LLVM inlining enabled. Currently LLVM is still doing inlining no mater what value inline-mir is set to. With the option `inline-llvm` being added in this PR, user can turn off LLVM inlining by using `-Z inline-llvm=no` option (the default of inline-llvm is 'yes', LLVM inlining enabled).
2022-09-11Avoid `Iterator::last`KaDiWa-4/+2
2022-09-10translations(rustc_session): migrate output.rsLuis Cardoso-27/+108
2022-09-09Add inline-llvm option for disabling/enabling LLVM inliningYan Chen-0/+2
2022-09-09translations(rustc_session): migrates session.rs and config.rsLuis Cardoso-1/+2
2022-09-08translations(rustc_session): migrates two diagnostics in session.rsLuis Cardoso-10/+22
2022-09-08translations(rustc_session): remove lint allow rule to the methods marked ↵Luis Cardoso-55/+7
with rustc_lint_diagnostic This commit removes the allows rules for the SessionDiagnostic lint that were being used in the session.rs file. Thanks to the PR #101230 we do not need to annotate the methods with the allow rule as they are part of the diagnostic machinery.
2022-09-08translations(rustc_session): migrate TargetDataLayout::parseLuis Cardoso-5/+56
2022-09-08translations(rustc_session): migrates session.rs and config.rsLuis Cardoso-38/+148
2022-09-05UPDATE - into_diagnostic to take a Handler instead of a ParseSessJhonny Bill Mena-6/+6
Suggested by the team in this Zulip Topic https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20SessionDiagnostic.20on.20Handler Handler already has almost all the capabilities of ParseSess when it comes to diagnostic emission, in this migration we only needed to add the ability to access source_map from the emitter in order to get a Snippet and the start_point. Not sure if this is the best way to address this gap
2022-09-03Auto merge of #100574 - Urgau:check-cfg-warn-cfg, r=petrochenkovbors-4/+4
Add warning against unexpected --cfg with --check-cfg This PR adds a warning when an unexpected `--cfg` is specified but not in the specified list of `--check-cfg`. This is the follow-up PR I mentioned in https://github.com/rust-lang/rust/pull/99519. r? `@petrochenkov`
2022-09-02Auto merge of #97802 - Enselic:add-no_ignore_sigkill-feature, r=joshtriplettbors-1/+33
Support `#[unix_sigpipe = "inherit|sig_dfl"]` on `fn main()` to prevent ignoring `SIGPIPE` When enabled, programs don't have to explicitly handle `ErrorKind::BrokenPipe` any longer. Currently, the program ```rust fn main() { loop { println!("hello world"); } } ``` will print an error if used with a short-lived pipe, e.g. % ./main | head -n 1 hello world thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', library/std/src/io/stdio.rs:1016:9 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace by enabling `#[unix_sigpipe = "sig_dfl"]` like this ```rust #![feature(unix_sigpipe)] #[unix_sigpipe = "sig_dfl"] fn main() { loop { println!("hello world"); } } ``` there is no error, because `SIGPIPE` will not be ignored and thus the program will be killed appropriately: % ./main | head -n 1 hello world The current libstd behaviour of ignoring `SIGPIPE` before `fn main()` can be explicitly requested by using `#[unix_sigpipe = "sig_ign"]`. With `#[unix_sigpipe = "inherit"]`, no change at all is made to `SIGPIPE`, which typically means the behaviour will be the same as `#[unix_sigpipe = "sig_dfl"]`. See https://github.com/rust-lang/rust/issues/62569 and referenced issues for discussions regarding the `SIGPIPE` problem itself See the [this](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Proposal.3A.20First.20step.20towards.20solving.20the.20SIGPIPE.20problem) Zulip topic for more discussions, including about this PR. Tracking issue: https://github.com/rust-lang/rust/issues/97889
2022-09-02Rollup merge of #100814 - gabrielBusta:port_trait_selection_diagnostics, ↵Matthias Krüger-0/+6
r=davidtwco Porting 'compiler/rustc_trait_selection' to translatable diagnostics - Part 1 ``@rustbot`` label +A-translation r? rust-lang/diagnostics cc #100717
2022-09-02Make CrateConfig make order depended for linting purposeUrgau-4/+4
2022-09-02Rollup merge of #100552 - petrochenkov:flavorcompat, r=lqdGuillaume Gomez-17/+7
rustc_target: Add a compatibility layer to separate internal and user-facing linker flavors I want to do some refactorings in `rustc_target` - merge `lld_flavor` and `linker_is_gnu` into `linker_flavor`, support combination gcc+lld (https://github.com/rust-lang/rust/pull/96827). This PR adds some compatibility infra that makes that possible without making any changes to user-facing interfaces - `-Clinker-flavor` values and json target specs. (For json target specs this infra may eventually go away since they are not very stable.) The second commit does some light refactoring of internal linker flavors (applies changes from https://github.com/petrochenkov/rust/commit/53eca42973b7e379b9fa0469c33f08680b57c35f that don't require mass-editing target specs).
2022-09-01Porting 'compiler/rustc_trait_selection' to translatable diagnostics - Part 1Gabriel Bustamante-0/+6
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-3/+4
by module
2022-09-01rustc_target: Refactor internal linker flavors slightlyVadim Petrochenkov-12/+2
Remove one unstable user-facing linker flavor (l4-bender)
2022-09-01rustc_target: Add a compatibility layer to separate internal and user-facing ↵Vadim Petrochenkov-7/+7
linker flavors
2022-08-31unix_sigpipe: Inline compiler sigpipe constants in stdMartin Nordholts-0/+2
2022-08-31Rollup merge of #100753 - LuisCardosoOliveira:translation-migrate-session, ↵Ralf Jung-18/+92
r=davidtwco translations(rustc_session): migrates `rustc_session` to use `SessionDiagnostic` - Pt. 1 ## Description This is the first PR for the migration of the module `rustc_session`. You can follow my progress [here](https://github.com/rust-lang/rust/issues/100717#issuecomment-1220279883). The PR migrates the files `cgu_reuse_tracker` and `parse.rs` to use `SessionDiagnostic `.
2022-08-29Revert let_chains stabilizationNilstrieb-0/+1
This reverts commit 326646074940222d602f3683d0559088690830f4. This is the revert against master, the beta revert was already done in #100538.
2022-08-28Support `#[unix_sigpipe = "inherit|sig_dfl|sig_ign"]` on `fn main()`Martin Nordholts-1/+31
This makes it possible to instruct libstd to never touch the signal handler for `SIGPIPE`, which makes programs pipeable by default (e.g. with `./your-program | head -n 1`) without `ErrorKind::BrokenPipe` errors.
2022-08-27Auto merge of #100732 - dpaoliello:import_name_type, r=wesleywiserbors-1/+32
Implementation of import_name_type Fixes #96534 by implementing https://github.com/rust-lang/compiler-team/issues/525 Symbols that are exported or imported from a binary on 32bit x86 Windows can be named in four separate ways, corresponding to the [import name types](https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#import-name-type) from the PE-COFF spec. The exporting and importing binaries must use the same name encoding, otherwise mismatches can lead to link failures due to "missing symbols" or to 0xc0000139 (`STATUS_ENTRYPOINT_NOT_FOUND`) errors when the executable/library is loaded. For details, see the comments on the raw-dylib feature's https://github.com/rust-lang/rust/issues/58713. To generate the correct import libraries for these DLLs, therefore, rustc must know the import name type for each `extern` function, and there is currently no way for users to provide this information. This change adds a new `MetaNameValueStr` key to the `#[link]` attribute called `import_name_type`, and which accepts one of three values: `decorated`, `noprefix`, and `undecorated`. A single DLL is likely to export all its functions using the same import type name, hence `import_name_type` is a parameter of `#[link]` rather than being its own attribute that is applied per-function. It is possible to have a single DLL that exports different functions using different import name types, but users could express such cases by providing multiple export blocks for the same DLL, each with a different import name type. Note: there is a fourth import name type defined in the PE-COFF spec, `IMPORT_ORDINAL`. This case is already handled by the `#[link_ordinal]` attribute. While it could be merged into `import_type_name`, that would not make sense as `#[link_ordinal]` provides per-function information (namely the ordinal itself). Design decisions (these match the MCP linked above): * For GNU, `decorated` matches the PE Spec and MSVC rather than the default behavior of `dlltool` (i.e., there will be a leading `_` for `stdcall`). * If `import_name_type` is not present, we will keep our current behavior of matching the environment (MSVC vs GNU) default for decorating. * Using `import_name_type` on architectures other than 32bit x86 will result in an error. * Using `import_name_type` with link kinds other than `"raw-dylib"` will result in an error.
2022-08-26Rollup merge of #100738 - nidnogg:diagnostics_migr_const_eval, r=davidtwcoMichael Goulet-2/+5
Diagnostics migr const eval This PR should eventually contain all diagnostic migrations for the `rustc_const_eval` crate. r? `@davidtwco` `@rustbot` label +A-translation
2022-08-26Implementation of import_name_typeDaniel Paoliello-1/+32
2022-08-26Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiserbors-9/+12
session: stabilize split debuginfo on linux Stabilize the `-Csplit-debuginfo` flag... - ...on Linux for all values of the flag. Split DWARF has been implemented for a few months, hasn't had any bug reports and has had some promising benchmarking for incremental debug build performance. - ..on other platforms for the default value. It doesn't make any sense that `-Csplit-debuginfo=packed` is unstable on Windows MSVC when that's the default behaviour, but keep the other values unstable.
2022-08-26translations(rustc_session): migrate check_expected_reuseLuis Cardoso-20/+12
This commit migrates the errors in the function check_expected_reuse to use the new SessionDiagnostic. It also does some small refactor for the IncorrectCguReuseType to include the 'at least' word in the fluent translation file
2022-08-26translations(rustc_session): migrate 80% of the file parse.rsLuis Cardoso-11/+44
This commit migrates around 80% of the parse file to use SsessionDiagnostic We still have to migrate struct_err and struct_warn.
2022-08-26translations(rustc_session): migrate the file cgu_reuse_trackerLuis Cardoso-5/+54
This commit migrates the errors that indicates an incorrect CGU type and the fatal error that indicates that a CGU has not been correctly recorded
2022-08-21Hotfix ftl err name, added check for err.code in create_feature_errnidnogg-1/+3
2022-08-21Fixed failing tests (missing labels), added automatic error code in ↵nidnogg-2/+3
create_feature_err() builder
2022-08-22Fix incorrect return type of emit_fatalPark Jaeon [파차]-1/+1
Co-authored-by: Giacomo Stevanato <giaco.stevanato@gmail.com>
2022-08-22Support #[fatal(..)]finalchild-0/+25
2022-08-21Add Handler::struct_diagnostic()Xiretza-1/+9
This unifies the struct_{warn,error,fatal}() methods in one generic method.
2022-08-18session: stabilize split debuginfo on linuxDavid Wood-9/+12
Stabilize the `-Csplit-debuginfo` flag... - ...on Linux for all values of the flag. Split DWARF has been implemented for a few months, hasn't had any bug reports and has had some promising benchmarking for incremental debug build performance. - ..on other platforms for the default value. It doesn't make any sense that `-Csplit-debuginfo=packed` is unstable on Windows MSVC when that's the default behaviour, but keep the other values unstable. Signed-off-by: David Wood <david.wood@huawei.com>
2022-08-17Reenable early feature-gates as future-compat warningsChristopher Durham-3/+52
2022-08-15Revert "Revert "Remove num_cpus dependency from bootstrap, build-manifest ↵The 8472-1/+1
and rustc_session"" This reverts commit 1ae4b258267462da0b1aae1badcf83578153c799.
2022-08-12Adjust cfgsMark Rousskov-43/+42
2022-08-07add -Zextra-const-ub-checks to enable more UB checking in const-evalRalf Jung-0/+2