Commit Graph

41 Commits

Author SHA1 Message Date
Vadim Petrochenkov abfb7c1daf rustc_middle: Fix opt_item_ident for non-local def ids 2023-05-03 20:09:10 +03:00
Michael Goulet 3904557b47 Don't use implied trait predicates in gather_explicit_predicates_of 2023-05-01 15:45:28 +00:00
Josh Soref 5a69bc9fd0 Spelling - compiler
* account
* achieved
* advising
* always
* ambiguous
* analysis
* annotations
* appropriate
* build
* candidates
* cascading
* category
* character
* clarification
* compound
* conceptually
* constituent
* consts
* convenience
* corresponds
* debruijn
* debug
* debugable
* debuggable
* deterministic
* discriminant
* display
* documentation
* doesn't
* ellipsis
* erroneous
* evaluability
* evaluate
* evaluation
* explicitly
* fallible
* fulfill
* getting
* has
* highlighting
* illustrative
* imported
* incompatible
* infringing
* initialized
* into
* intrinsic
* introduced
* javascript
* liveness
* metadata
* monomorphization
* nonexistent
* nontrivial
* obligation
* obligations
* offset
* opaque
* opportunities
* opt-in
* outlive
* overlapping
* paragraph
* parentheses
* poisson
* precisely
* predecessors
* predicates
* preexisting
* propagated
* really
* reentrant
* referent
* responsibility
* rustonomicon
* shortcircuit
* simplifiable
* simplifications
* specify
* stabilized
* structurally
* suggestibility
* translatable
* transmuting
* two
* unclosed
* uninhabited
* visibility
* volatile
* workaround

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-17 16:09:18 -04:00
Esteban Küber 1343237b2d Tweak output for 'add line' suggestion 2023-04-12 22:50:10 +00:00
Yuki Okushi da08f53481 Rollup merge of #109923 - ElectrifyPro:visibility, r=wesleywiser
Update `error [E0449]: unnecessary visibility qualifier` to be more clear

This updates the error message `error[E0449]: unnecessary visibility qualifier` by clearly indicating that visibility qualifiers already inherit their visibility from a parent item. The error message previously implied that the qualifiers were permitted, which is not the case anymore.

Resolves #109822.
2023-04-11 12:18:50 +09:00
Tam Pham 66e029b0d1 Update ui tests involving invalid visibility qualifiers 2023-04-03 22:28:55 -05:00
Camille GILLOT b6ccedde88 Perform match checking on THIR. 2023-04-03 15:59:21 +00:00
lcnr ea4d91b9b9 evaluate: improve and fix recursion depth handling 2023-03-21 09:57:22 +01:00
clubby789 b2a37c4b05 Remove uses of box_syntax in rustc and tools 2023-03-12 13:19:46 +00:00
Michael Goulet 01a4e9bb49 may not => cannot 2023-03-08 00:00:18 +00:00
Ezra Shaw 12df6d4fe2 docs/test: add UI test and docs for E0476 2023-02-25 19:31:02 +13:00
Michael Howell c9289896f0 diagnostics: remove inconsistent English article "this" from E0107
Consider `tests/ui/const-generics/generic_const_exprs/issue-102768.stderr`,
the error message where it gives additional notes about where the associated
type is defined, and how the dead code lint doesn't have an article,
like in `tests/ui/lint/dead-code/issue-85255.stderr`. They don't have
articles, so it seems unnecessary to have one here.
2023-02-23 10:27:06 -07:00
Michael Howell 399992d3b6 diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
Matthias Krüger 6fb4c020c6 Rollup merge of #106347 - estebank:removal-suggestion, r=TaKO8Ki
More accurate spans for arg removal suggestion

Partially address #106304.
2023-02-16 17:51:24 +01:00
Camille GILLOT d6c110f555 Fetch less HIR in signature check. 2023-02-14 20:26:03 +00:00
Esteban Küber a26a4256c0 Make removal suggestion not verbose 2023-02-14 20:22:10 +00:00
Esteban Küber 90f91b567c rebase and review comments 2023-02-14 20:22:10 +00:00
Esteban Küber eb7108bd60 More accurate spans for arg removal suggestion 2023-02-14 20:22:09 +00:00
Michael Goulet d7f4c49ab4 Tighter spans for bad inherent impl types 2023-02-13 18:41:18 +00:00
Matthew Kelly 75fc3ee6dd Add extended error message for E0523
Adds the extended error documentation for E0523 to indicate that the
error is no longer produced by the compiler.

Update the E0464 documentation to include example code that produces the
error.

Remove the error message E0523 from the compiler and replace it with an
internal compiler error.
2023-02-06 06:58:30 -05:00
Esteban Küber 5eb6468cef Modify primary span label for E0308
The previous output was unintuitive to users.
2023-01-30 20:12:19 +00:00
Ali MJ Al-Nasrawy 1dbcbe427c internally change regions to be covariant 2023-01-27 04:04:22 +03:00
Matthias Krüger 75d1d276bd Rollup merge of #106897 - estebank:issue-99430, r=davidtwco
Tweak E0597

CC #99430
2023-01-25 22:19:52 +01:00
Ezra Shaw 47187f4380 add UI test + docs for E0789 2023-01-23 20:38:14 +13:00
Guillaume Gomez 71f9fc050a Rollup merge of #106931 - Ezrashaw:docs-e0208, r=compiler-errors
document + UI test `E0208` and make its output more user-friendly

Cleans up `E0208`'s output a lot. It could actually be useful for someone learning about variance now. I also added a UI test for it in `tests/ui/error-codes/` and wrote some docs for it.

r? `@GuillaumeGomez` another error code, can't be bothered to find the issue :P. Obviously there's some compiler stuff, so you'll have to hand it off.

Part of https://github.com/rust-lang/rust/issues/61137.
2023-01-19 11:19:35 +01:00
Ezra Shaw e455178b09 remove error code from #[rustc_variance] and document its remains 2023-01-18 21:10:27 +13:00
Ezra Shaw 0f1c56e7d3 special case removing & suggestion 2023-01-18 13:14:56 +13:00
Ezra Shaw ec55cad7e9 make CastError::NeedsDeref create a MachineApplicable suggestion + other misc fixes 2023-01-16 20:24:01 +13:00
Esteban Küber e775d95135 Tweak E0597
CC #99430
2023-01-15 19:46:20 +00:00
Matthias Krüger 622f461889 Rollup merge of #106585 - estebank:issue-46585, r=compiler-errors
When suggesting writing a fully qualified path probe for appropriate types

Address the more common part of #46585.
2023-01-13 19:16:42 +01:00
Michael Goulet 6e198d7f0c Point at impl self type for impl wf obligations 2023-01-12 20:44:47 +00:00
bors df23c76c36 Auto merge of #106760 - compiler-errors:rollup-0bogyco, r=compiler-errors
Rollup of 8 pull requests

Successful merges:

 - #103236 (doc: rewrite doc for signed int::{carrying_add,borrowing_sub})
 - #103800 (Stabilize `::{core,std}::pin::pin!`)
 - #106097 (Migrate mir_build diagnostics 2 of 3)
 - #106170 (Move autoderef to `rustc_hir_analysis`)
 - #106323 (Stabilize f16c_target_feature)
 - #106360 (Tweak E0277 `&`-removal suggestions)
 - #106524 (Label `struct/enum constructor` instead of `fn item`, mention that it should be called on type mismatch)
 - #106739 (Remove `<dyn AstConv<'tcx>>::fun(c, ...)` calls in favour of `c.astconv().fun(...)`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-12 10:46:19 +00:00
Michael Goulet 7799371ff3 Rollup merge of #106097 - mejrs:mir_build2, r=oli-obk
Migrate mir_build diagnostics 2 of 3

The first three commits are fairly boring, however I've made some changes to the output of the match checking diagnostics.
2023-01-11 22:25:47 -08:00
Matthias Krüger 05ecae7cff Rollup merge of #106167 - yanchen4791:issue-105544-fix, r=oli-obk
Fix invalid syntax and incomplete suggestion in impl Trait parameter type suggestions for E0311

Fixes #105544

The problems: The suggestion given for E0311 has invalid syntax when the synthetic type parameter is used for Trait type in function declaration:
```rust
fn foo(d: impl Sized) -> impl Sized
```
instead of explicitly specified like the following:
```rust
fn foo<T: Sized>(d: T) -> impl Sized
```
In addition to the syntax error, the suggestions given for E0311 are not complete when multiple elided lifetimes are involved in lifetime bounds, not all involved parameters are given the named lifetime in the suggestions. For the following test case:
```
fn foo(d: impl Sized, p: &mut ()) -> impl Sized + '_ {
    (d, p)
}
```
a good suggestion should add the lifetime 'a to both d and p, instead of d only:
```
fn foo<'a>(d: impl Sized + 'a, p: &'a mut ()) -> impl Sized + '_ {
    (d, p)
}
```

The Solution: Fix the syntax problem in the suggestions when synthetic type parameter is used, and also add lifetimes for all involved parameters.
2023-01-12 06:52:34 +01:00
yanchen4791 576d1058ee Fix invalid syntax in impl Trait parameter type suggestions for E0311 2023-01-11 14:49:55 -08:00
mejrs b67adfa326 Don't recommend if let if let else works 2023-01-11 14:40:07 -08:00
mejrs d09f21f498 Migrate pattern matching 2023-01-11 14:40:02 -08:00
Esteban Küber 22288fb081 When suggesting writing a fully qualified path probe for appropriate types
Fix #46585.
2023-01-11 21:30:10 +00:00
Michael Goulet 23c4d105e2 Note predicate span on ImplDerivedObligation 2023-01-11 19:46:45 +00:00
Albert Larsan 2872c3dbb8 Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00
Albert Larsan 8f6b5d4e26 Move /src/test to /tests 2023-01-11 09:32:08 +00:00