Commit Graph

536 Commits

Author SHA1 Message Date
Rejyr
6ffecd2059 migrate(wip): builtin.rs 2023-01-09 17:07:25 -05:00
Rejyr
0b19227524 migrate: internal.rs 2023-01-09 17:07:25 -05:00
Rejyr
e610047940 migrate: let_underscore.rs
fix: NonBindingLetSub
2023-01-09 17:07:25 -05:00
Rejyr
80df25e160 migrate: levels.rs 2023-01-09 17:07:25 -05:00
Rejyr
ab66ea61cf add: emit{,_spanned}_lint for LintLevelsBuilder
add: `emit_spanned_lint` and `emit_lint` for `LintLevelsBuilder`
migrate: `DeprecatedLintName`
2023-01-09 17:07:25 -05:00
Michael Goulet
49f849a3d2 Mention signature rather than fn pointers when comparing impl/trait methods 2023-01-08 03:49:24 +00:00
Matthias Krüger
771cfa5581
Rollup merge of #104543 - JhonnyBillM:migrate-codegen-ssa-to-diagnostics-structs-pt3, r=davidtwco
Migrate `codegen_ssa` to diagnostics structs - [Part 3]

Completes migrating `codegen_ssa` module except 2 outstanding errors that depend on other crates:
1. [`rustc_middle::mir::interpret::InterpError`](b6097f2e1b/compiler/rustc_middle/src/mir/interpret/error.rs (L475)): I saw `rustc_middle` is unassigned, I am open to take this work.

2.  `codegen_llvm`'s use of `fn span_invalid_monomorphization_error`, which I started to replace in the [last commit](9a31b3cdda) of this PR, but would like to know the team's preference on how we should keep replacing the other macros:
2.1. Update macros to expect a `Diagnostic`
2.2. Remove macros and expand the code on each use.
See [some examples of the different options in this experimental commit](64aee83e80)

_Part 2 - https://github.com/rust-lang/rust/pull/103792_

r? ``@davidtwco``
Cc ``@compiler-errors``
2023-01-07 20:43:19 +01:00
Matthias Krüger
405e48f1ac
Rollup merge of #101936 - IntQuant:issue-100717-infer-4, r=compiler-errors
Migrating rustc_infer to session diagnostics (part 3)

``@rustbot`` label +A-translation
r? rust-lang/diagnostics
cc https://github.com/rust-lang/rust/issues/100717

Seems like a part of static_impl_trait.rs emits suggestions in a loop, and note.rs needs to have two instances of the same subdiagnostic, so these will need to wait until we have eager translation/list support.
Other than that, there is only error_reporting/mod.rs left to migrate.
2023-01-07 20:43:18 +01:00
bors
d9e317a176 Auto merge of #106224 - bjorn3:staticlib_fixes, r=wesleywiser
Small fixes for --crate-type staticlib

The first commit doesn't have an effect until we start translating error messages. The second commit fixes potential linker errors when combining `--crate-type staticlib` with another crate type and I think `-Cprefer-dynamic`.
2023-01-04 21:35:15 +00:00
Matthias Krüger
11020b93b6
Rollup merge of #106361 - clubby789:int-literal-too-large, r=estebank
Note maximum integer literal for `IntLiteralTooLarge`

Closes #105908

`@rustbot` label +A-diagnostics
2023-01-04 07:28:56 +01:00
bors
3b1c8a94a4 Auto merge of #105609 - bjorn3:shrink_rustc_dev, r=jyn514
Only include metadata for non-dynamic libraries in rustc-dev

The actual object code should be linked from librustc_driver.so, which is still included in rustc-dev. This saves on download time and disk usage.

Fixes https://github.com/rust-lang/rust/issues/103538
2023-01-03 08:05:54 +00:00
clubby789
537c7f4fa9 Print correct base for too-large literals
Also update tests
2023-01-02 11:43:07 +00:00
clubby789
cafdd2f7bb Note maximum integer literal for IntLiteralTooLarge 2023-01-02 03:52:29 +00:00
bjorn3
7837058073 Add help for the error message when missing rustc_driver 2022-12-31 17:20:13 +00:00
Ezra Shaw
24b39ece2f
refactor: merge E0465 into E0464 2022-12-31 20:44:54 +13:00
bjorn3
0b54782cc8 Don't translate --print native-static-libs output
This breaks tools that depend on the prefix
2022-12-28 17:56:31 +00:00
Nikita Tomashevich
7ecd064bbe
Split infer_explicit_lifetime_required into several diags 2022-12-28 14:53:48 +03:00
Nikita Tomashevich
40b221814e
Rename subdiagnostic fields that do not need to be unique now 2022-12-28 14:53:48 +03:00
Nikita Tomashevich
eb7ce1703b
Use eager translation 2022-12-28 14:53:47 +03:00
Nikita Tomashevich
71d24da665
Split into several messages 2022-12-28 14:53:47 +03:00
Nikita Tomashevich
6c19c08140
More descriptive names for ActualImplExplNotes variants 2022-12-28 14:53:47 +03:00
Nikita Tomashevich
0634b0119c
Partial work on static_impl_trait.rs 2022-12-28 14:53:47 +03:00
Nikita Tomashevich
3935a81d47
Migrate trait_impl_difference.rs 2022-12-28 14:53:47 +03:00
Nikita Tomashevich
2118ff401f
Migrate placeholder_error.rs 2022-12-28 14:53:47 +03:00
Nikita Tomashevich
8360a40a8a
Migrate named_anon_conflict.rs 2022-12-28 14:53:47 +03:00
Jhonny Bill Mena
29d8c87fe8 DELETE - fn span_invalid_monomorphization_error and localize intrinsics macros 2022-12-27 20:59:22 -05:00
Jhonny Bill Mena
27744460e2 ADD - create and emit Bug support for Diagnostics
UPDATE - migrate constant span_bug to translatable diagnostic.
2022-12-27 20:59:22 -05:00
Jhonny Bill Mena
d1030fab22 UPDATE - migrate fn simd_simple_float_intrinsic error messages 2022-12-27 20:59:21 -05:00
Jhonny Bill Mena
e26366ad99 [WIP] UPDATE - migrate intrinsic.rs to new diagnostic infrastructure
WIP - replacing span_invalid_monomorphization_error function. Still in progress due to its use in codegen_llvm inside macros
2022-12-27 20:59:21 -05:00
Jhonny Bill Mena
d41112a8c5 UPDATE - migrate constant.rs to new diagnostics infrastructure 2022-12-27 20:59:21 -05:00
Jhonny Bill Mena
82cf6f204a UPDATE - migrate base.rs to new diagnostics infrastructure 2022-12-27 20:59:19 -05:00
Michael Goulet
aff403cf68 Recover fn keyword as Fn trait in bounds 2022-12-27 06:14:46 +00:00
Matthias Krüger
d23cb738d2
Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholk
rustc: Remove needless lifetimes
2022-12-24 00:31:41 +01:00
Matthias Krüger
da370fe25a
Rollup merge of #106057 - jyn514:trimmed-def-paths-ice, r=compiler-errors
Give a more helpful error for "trimmed_def_paths constructed"

cc https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/ice.20debugging/near/315928294, https://github.com/rust-lang/rust/pull/106056

`@mejrs` do you think this would have helped you figure out the problem faster?
2022-12-23 01:17:51 +01:00
Joshua Nelson
e4330295d9 Give a more helpful error for "trimmed_def_paths construted" 2022-12-22 13:12:15 -06:00
Bryan Garza
9650a4168f Improve code based on feedback.
This patch improves the readability of some of the code by using
if-let-chains. Also, make use of the `add_feature_diagnostics` function.
2022-12-21 03:47:27 +00:00
Bryan Garza
e28a07a0a1 update wording of lint 2022-12-21 03:30:46 +00:00
Bryan Garza
dc2c4ce578 Update code based on PR comments
This patch does the following:
- Refactor some repeated lines into a single one
- Split the `ungated_async_fn_caller` lint into multiple lines, and make
  one of those lines only print out on nightly
- Use test revisions instead of copying an existing test
2022-12-21 03:30:37 +00:00
Bryan Garza
04926e0534 Switch #[track_caller] back to a no-op unless feature gate is enabled
This patch fixes a regression, in which `#[track_caller]`, which was
previously a no-op, was changed to actually turn on the behavior. This
should instead only happen behind the `closure_track_caller` feature
gate.

Also, add a warning for the user to understand how their code will
compile depending on the feature gate being turned on or not.

Fixes #104588
2022-12-21 03:23:08 +00:00
Jeremy Stucki
3dde32ca97
rustc: Remove needless lifetimes 2022-12-20 22:10:40 +01:00
mejrs
1bdf112529 Resolve various merge conflicts 2022-12-17 19:08:25 +01:00
TheOddGarlic
e71a722fa6 Migrate multiple mut borrows diagnostic 2022-12-17 19:08:25 +01:00
TheOddGarlic
3a9a06311d Migrate borrow of moved value diagnostic 2022-12-17 19:08:25 +01:00
TheOddGarlic
eeef05b318 Migrate irrefutable let pattern diagnostics 2022-12-17 19:08:25 +01:00
TheOddGarlic
e1c5073c07 Migrate pattern bindings with variant name lint 2022-12-17 19:08:25 +01:00
TheOddGarlic
6f82a00aa1 Migrate leading/trailing irrefutable let pattern diagnostics 2022-12-17 19:08:24 +01:00
TheOddGarlic
4b70784176 Migrate lower range bound diagnostics 2022-12-17 19:08:24 +01:00
TheOddGarlic
513e3995e0 Migrate "could not evaluate const pattern" diagnostic 2022-12-17 19:08:24 +01:00
TheOddGarlic
d5f821eeb0 Migrate "constant pattern depends on generic parameter" diagnostic 2022-12-17 19:08:24 +01:00
TheOddGarlic
b694e6649e Migrate unreachable pattern diagnostic 2022-12-17 19:08:24 +01:00