Commit Graph

27 Commits

Author SHA1 Message Date
Ben Kimock
a7d57aa7c8 Let InstCombine remove Clone shims inside Clone shims
Co-authored-by: scottmcm <scottmcm@users.noreply.github.com>
2024-07-25 15:14:42 -04:00
Zalathar
9aaa0c5867 Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
yukang
f46c4129e0 show unit output when there is only output diff in diagnostics 2024-07-06 21:00:30 +08:00
Ralf Jung
8b35be741f consistency rename: language item -> lang item 2024-04-17 13:00:43 +02:00
许杰友 Jieyou Xu (Joe)
ec2cc761bc
[AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
Matthias Krüger
7fa99bfb71
Rollup merge of #120556 - fmease:improve-unused-generic-param-diags, r=oli-obk
Improve the diagnostics for unused generic parameters

* Don't emit two errors (namely E0091 *and* E0392) for unused type parameters on *lazy* type aliases
* Fix the diagnostic help message of E0392 for *lazy* type aliases: Don't talk about the “fields” of lazy type aliases (use the term “body” instead) and don't suggest `PhantomData` for them, it doesn't make much sense
* Consolidate the diagnostics for E0091 (unused type parameters in type aliases) and E0392 (unused generic parameters due to bivariance) and make it translatable
  * Still keep the error codes distinct (for now)
  * Naturally leads to better diagnostics for E0091

r? ```@oli-obk``` (to ballast your review load :P) or compiler
2024-02-04 19:42:12 +01:00
León Orell Valerian Liehr
02320b502d
Improve the diagnostics for unused generic parameters 2024-02-01 16:18:03 +01:00
Nadrieril
032596e34c
Rollup merge of #120472 - Nilstrieb:die, r=compiler-errors
Make duplicate lang items fatal

Prevents terminal spam.
2024-01-31 12:10:52 +01:00
Michael Goulet
b4efe07006 Remove some unnecessary check logic for lang items in HIR typeck 2024-01-29 19:48:44 +00:00
Nilstrieb
1f89e90073 Add test for duplicate lang items 2024-01-29 20:37:06 +01:00
George-lewis
d56cdd48cb Bless tests
Update tests
2024-01-13 12:46:58 -05:00
Nilstrieb
da26317a8a Stop mentioning internal lang items in no_std binary errors
When writing a no_std binary, you'll be greeted with nonsensical errors
mentioning lang items like eh_personality and start. That's pretty bad
because it makes you think that you need to define them somewhere! But
oh no, now you're getting the `internal_features` lint telling you that
you shouldn't use them! But you need a no_std binary! What now?

No problem! Writing a no_std binary is super easy. Just use panic=abort
and supply your own platform specific entrypoint symbol (like `main`)
and you're good to go. Would be nice if the compiler told you that,
right?

This makes it so that it does do that.
2024-01-10 21:18:54 +01:00
Oli Scherer
0978f6e010 Avoid silencing relevant follow-up errors 2024-01-09 21:08:16 +00:00
Michael Goulet
ad00641b74 Collect lang items from AST 2023-12-15 16:12:27 +00:00
Nilstrieb
41e8d152dc Show number in error message even for one error
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-24 19:15:52 +01:00
Esteban Küber
bd8b46800d Tweak wording of type errors involving type params
Fix #78206.
2023-10-18 23:53:18 +00:00
Michael Goulet
137b6d0b01 Point to where missing return type should go 2023-10-04 21:09:54 +00:00
bors
aace2dfa37 Auto merge of #115910 - eduardosm:lang-fns-target-features, r=cjgillot
Prevent using `#[target_feature]` on lang item functions

Fixes https://github.com/rust-lang/rust/issues/109411 and also prevents from using `#[target_feature]` on other `fn` lang items to mitigate the concerns from https://github.com/rust-lang/rust/issues/109411#issuecomment-1477030273.
2023-09-22 05:07:45 +00:00
Eduardo Sánchez Muñoz
c599761140 rustc_hir_analysis: add a helper to check function the signature mismatches
This function is now used to check `#[panic_handler]`, `start` lang item, `main`, `#[start]` and intrinsic functions.

The diagnosis produced are now closer to the ones produced by trait/impl method signature mismatch.
2023-09-19 18:15:23 +02:00
Eduardo Sánchez Muñoz
9102816bc4 Prevent using #[target_feature] on lang item functions 2023-09-18 20:11:01 +02:00
clubby789
dd7df04e16 Remove uses of box_syntax in rustc and tools 2023-03-12 13:19:46 +00:00
Michael Goulet
2a700d47f5 Add ICE test for bad Add::add impl item type 2023-02-16 20:58:48 +00:00
Michael Goulet
ff9c5db03c Tweak wording 2023-02-16 20:52:29 +00:00
Michael Goulet
3dd638fe6c Move call trait lang item malformed check to typeck 2023-02-16 20:37:33 +00:00
Michael Goulet
7892cc3c5f Do not depend on Generator trait when deducing closure signature 2023-01-31 02:59:36 +00:00
asquared31415
337a97d374
add checks for the signature of the lang item 2023-01-11 14:35:08 -08:00
Albert Larsan
cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00