Commit Graph

422 Commits

Author SHA1 Message Date
SLASHLogin
185ef7b6de Port MissingFeatures and TargetFeatureDisableOrEnable 2022-11-09 14:56:21 +01:00
SLASHLogin
33ef16f291 Port UnknownArchiveKind 2022-11-09 14:56:21 +01:00
SLASHLogin
c01546fcd6 Port DlltoolFailImportLibrary and implement IntoDiagnosticArg for Cow<'a, str> 2022-11-09 14:56:21 +01:00
SLASHLogin
81f7a8d7f1 Port ErrorCallingDllTool 2022-11-09 14:56:21 +01:00
SLASHLogin
ddbb650289 Import ErrorWritingDEFFile 2022-11-09 14:56:21 +01:00
SLASHLogin
d32caf9ced Port ArchiveBuildFailure 2022-11-09 14:56:21 +01:00
SLASHLogin
978b5f73e4 Port SanitizerMemtagRequiresMte 2022-11-09 14:56:21 +01:00
SLASHLogin
60ee496c74 Port LinkageConstOrMutType error 2022-11-09 14:56:20 +01:00
SLASHLogin
5d79d3c4bb Port InvalidMinimumAlignment 2022-11-09 14:56:20 +01:00
SLASHLogin
39d363fd58 Port layout size overflow 2022-11-09 14:56:20 +01:00
SLASHLogin
f031823ecd Formatting 2022-11-09 14:56:20 +01:00
SLASHLogin
59b8aedf0e Port branch protection on aarch64 2022-11-09 14:56:20 +01:00
SLASHLogin
9f0c16576b Port symbol_already_defined error 2022-11-09 14:56:20 +01:00
SLASHLogin
4c625dc682 Port Instrument coverage requires llvm 12 to the new struct 2022-11-09 14:56:20 +01:00
SLASHLogin
05ae7ecb74 Import error creating import library 2022-11-09 14:56:20 +01:00
SLASHLogin
21b04265c1 Trailing whitespaces 2022-11-09 14:56:20 +01:00
SLASHLogin
1c4bd835ec locales formatting 2022-11-09 14:56:20 +01:00
SLASHLogin
575f6098da Port unknown feature diagnostic to the new framework 2022-11-09 14:56:20 +01:00
Manish Goregaokar
7dfe1e1664
Rollup merge of #103559 - AndyJado:var_span_label, r=davidtwco
first move on a nested span_label

trying not to be smart this time.
2022-11-08 21:03:53 -05:00
Matthias Krüger
58f5d57b5d
Rollup merge of #103012 - chenyukang:fix-102806, r=davidtwco,compiler-errors
Suggest use .. to fill in the rest of the fields of Struct

Fixes #102806
2022-11-06 08:35:26 +01:00
AndyJado
e49d10db14 first move on a nested span_label
Apply suggestions from code review

Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
2022-11-05 19:43:48 +08:00
clubby789
2f882c014f Specify that break cannot be used outside of loop *or* labeled block 2022-11-05 01:12:58 +00:00
Matthias Krüger
1cb8684dde
Rollup merge of #103792 - JhonnyBillM:migrate-codegen-ssa-to-diagnostics-structs-pt2, r=davidtwco
Migrate `codegen_ssa` to diagnostics structs - [Part 2]

Completes migrating `link.rs` in `codegen_ssa` module.

_Part 1 - https://github.com/rust-lang/rust/pull/102612_

r? `@davidtwco`
2022-11-04 18:52:27 +01:00
Matthias Krüger
612bb7890c
Rollup merge of #103397 - crlf0710:port_dead_code_lint, r=davidtwco
Port `dead_code` lints to be translatable.

This adds an additional comma to lists with three or more items, to be consistent with list formatters like `icu4x`.

r? `@davidtwco`
2022-11-04 18:52:26 +01:00
Jhonny Bill Mena
2678765d08 FIX - Migrate missing errors in link.rs 2022-11-04 01:17:02 -04:00
Jhonny Bill Mena
1f4c5a624f ADD - ExtractBundledLibsError. Migrated extract_bundled_libs to translatable diagnostics 2022-11-04 01:17:02 -04:00
Jhonny Bill Mena
4c80f50fc6 UPDATE - Complete link.rs migration to new diagnostics infraestructure 2022-11-04 01:17:02 -04:00
yukang
1e25882944 fix #102806, suggest use .. to fill in the rest of the fields of Struct 2022-11-04 10:35:36 +08:00
Charles Lew
a777c46dff Use derive(Subdiagnostic) for ChangeFieldsToBeOfUnitType. 2022-11-04 03:02:09 +08:00
Dylan DPC
43634675f6
Rollup merge of #103061 - Amanieu:rewrite_alloc_error_handler, r=bjorn3
Rewrite implementation of `#[alloc_error_handler]`

The new implementation doesn't use weak lang items and instead changes `#[alloc_error_handler]` to an attribute macro just like `#[global_allocator]`.

The attribute will generate the `__rg_oom` function which is called by the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom` function is defined in any crate then the compiler shim will call `__rdl_oom` in the alloc crate which will simply panic.

This also fixes link errors with `-C link-dead-code` with `default_alloc_error_handler`: `__rg_oom` was previously defined in the alloc crate and would attempt to reference the `oom` lang item, even if it didn't exist. This worked as long as `__rg_oom` was excluded from linking since it was not called.

This is a prerequisite for the stabilization of `default_alloc_error_handler` (#102318).
2022-11-01 14:12:25 +05:30
Yuki Okushi
5bf9d617cb
Rollup merge of #103772 - compiler-errors:better-strict-coherence-err, r=davidtwco
better error for `rustc_strict_coherence` misuse

Fixes #103753
2022-11-01 12:03:42 +09:00
Amanieu d'Antras
56074b5231 Rewrite implementation of #[alloc_error_handler]
The new implementation doesn't use weak lang items and instead changes
`#[alloc_error_handler]` to an attribute macro just like
`#[global_allocator]`.

The attribute will generate the `__rg_oom` function which is called by
the compiler-generated `__rust_alloc_error_handler`. If no `__rg_oom`
function is defined in any crate then the compiler shim will call
`__rdl_oom` in the alloc crate which will simply panic.

This also fixes link errors with `-C link-dead-code` with
`default_alloc_error_handler`: `__rg_oom` was previously defined in the
alloc crate and would attempt to reference the `oom` lang item, even if
it didn't exist. This worked as long as `__rg_oom` was excluded from
linking since it was not called.

This is a prerequisite for the stabilization of
`default_alloc_error_handler` (#102318).
2022-10-31 16:32:57 +00:00
Michael Goulet
953727f574 better error for rustc_strict_coherence misuse 2022-10-30 19:11:55 +00:00
Cameron Steffen
88d71504dd Use tcx.require_lang_item 2022-10-29 16:09:15 -05:00
Matthias Krüger
790a716420
Rollup merge of #103383 - compiler-errors:tait-scope, r=oli-obk
Note scope of TAIT more accurately

This maybe explains why the person was confused in #101897, since we say "same module" but really should've said "same impl".

r? ``@oli-obk``
2022-10-29 08:57:35 +02:00
Boxy
b3425587a6 tidy + move logic to fn 2022-10-27 22:29:16 +01:00
Boxy
ca5a6e43dd use proper spans 2022-10-27 22:18:26 +01:00
Boxy
c00ff9c4d0 DoIt 2022-10-27 21:48:47 +01:00
Oli Scherer
1c26a278f3 Split diagnostic details out into a separate function and fluent files 2022-10-25 18:28:04 +00:00
Charles Lew
113e8dfb72 Port dead_code lints to be translatable. 2022-10-24 17:02:31 +08:00
Jakub Beránek
c5c86806c8
Introduce dedicated -Zdylib-lto flag for enabling LTO on dylibs 2022-10-23 13:48:03 +02:00
Michael Goulet
4accf838f6 Note scope of TAIT more accurately 2022-10-22 03:09:49 +00:00
Dylan DPC
e11511dfa6
Rollup merge of #103051 - davidtwco:translation-tidying-up, r=compiler-errors
translation: doc comments with derives, subdiagnostic-less enum variants, more derive use

- Adds support for `doc` attributes in the diagnostic derives so that documentation comments don't result in the derive failing.
- Adds support for enum variants in the subdiagnostic derive to not actually correspond to an addition to a diagnostic.
- Made use of the derive in more places in the `rustc_ast_lowering`, `rustc_ast_passes`, `rustc_lint`, `rustc_session`, `rustc_infer` - taking advantage of recent additions like eager subdiagnostics, multispan suggestions, etc.

cc #100717
2022-10-21 17:29:58 +05:30
Matthias Krüger
66de34b035
Rollup merge of #102454 - chenyukang:fix-102396-missing-parentheses, r=lcnr
Suggest parentheses for possible range method calling

Fixes #102396
2022-10-17 17:15:49 +02:00
David Wood
913f597402 infer: use derive more
Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-17 09:54:24 +01:00
David Wood
f8b628bce4 session: use derive more
Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-17 09:54:24 +01:00
yukang
151001c1cb trivial fix for comments feedback 2022-10-17 08:32:08 +08:00
Guillaume Gomez
f528414e40 Add missing checks for doc(cfg_hide(...)) attribute 2022-10-14 11:29:54 +02:00
bors
1755c85302 Auto merge of #102684 - JhonnyBillM:delete-target-data-layout-errors-wrapper, r=davidtwco
Move `IntoDiagnostic` conformance for `TargetDataLayoutErrors` into `rustc_errors`

Addressed this suggestion https://github.com/rust-lang/rust/pull/101558#issuecomment-1243830009.

This way we comply with the Coherence rule given that `IntoDiagnostic` trait is defined in `rustc_errors`, and almost all other crates depend on it.
2022-10-14 04:35:22 +00:00
Wesley Wiser
097b6d3baf Add suggestion to the "missing native library" error
If we fail to locate a native library that we are linking with, it could
be the case the user entered a complete file name like `foo.lib` or
`libfoo.a` when we expect them to simply provide `foo`.

In this situation, we now detect that case and suggest the user only
provide the library name itself.
2022-10-13 07:35:36 -04:00