Commit Graph

215 Commits

Author SHA1 Message Date
lcnr a8b0278e96 rework error messages for incorrect inherent impls 2022-03-30 11:23:58 +02:00
Guillaume Gomez 18443fade3 Add long error explanation for E0667 2022-03-27 14:09:52 +02:00
Matthias Krüger ce7c24ebbe Rollup merge of #94555 - cuishuang:master, r=oli-obk
all: fix some typos

Signed-off-by: cuishuang <imcusg@gmail.com>
2022-03-03 20:01:48 +01:00
cuishuang 189a5418ca all: fix some typos
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-03-03 19:47:23 +08:00
Thiago Trannin eee5b73095 Remove out-of-context line at end of E0284 message 2022-03-02 10:09:02 -03:00
Matthias Krüger b8971b1d13 Rollup merge of #94449 - GuillaumeGomez:explanation-e0726, r=Urgau
Add long explanation for E0726

This is the cleaned up version of #87655 with the missing fixes.

Part of https://github.com/rust-lang/rust/issues/61137.

r? `@Urgau`
2022-02-28 20:05:18 +01:00
Guillaume Gomez 010b623195 Add explanation for E0726 2022-02-28 15:51:05 +01:00
Michael Goulet b74c3621ff Remove in-band lifetimes 2022-02-24 18:50:33 -08:00
Oli Scherer e5e7c6fe9a Revert "Auto merge of #91403 - cjgillot:inherit-async, r=oli-obk"
This reverts commit 3b107ae9ed, reversing
changes made to 3d8eed0fc2.
2022-02-17 16:00:04 +00:00
bors 3b107ae9ed Auto merge of #91403 - cjgillot:inherit-async, r=oli-obk
Inherit lifetimes for async fn instead of duplicating them.

The current desugaring of `async fn foo<'a>(&usize) -> &u8` is equivalent to
```rust
fn foo<'a, '0>(&'0 usize) -> foo<'static, 'static>::Opaque<'a, '0, '_>;
type foo<'_a, '_0>::Opaque<'a, '0, '1> = impl Future<Output = &'1 u8>;
```
following the RPIT model.

Duplicating all the inherited lifetime parameters and setting the inherited version to `'static` makes lowering more complex and causes issues like #61949. This PR removes the duplication of inherited lifetimes to directly use
```rust
fn foo<'a, '0>(&'0 usize) -> foo<'a, '0>::Opaque<'_>;
type foo<'a, '0>::Opaque<'1> = impl Future<Output = &'1 u8>;
```
following the TAIT model.

Fixes https://github.com/rust-lang/rust/issues/61949
2022-02-12 21:42:10 +00:00
Camille GILLOT 64555cce33 Update error code documentation. 2022-02-12 01:26:17 +01:00
Guillaume Gomez f7d9898e4c Add missing E0192 in the error code listing 2022-02-12 00:43:09 +01:00
Matthias Krüger 1b41722d6e Rollup merge of #91939 - GKFX:feature-91866, r=cjgillot
Clarify error on casting larger integers to char

Closes #91836 with changes to E0604.md and a `span_help`.
2022-02-06 04:13:29 +01:00
Matthias Krüger b0bd2ef080 Rollup merge of #88205 - danii:e0772, r=GuillaumeGomez
Add Explanation For Error E0772

I've added an error explanation for the error code E0772.

Assists with #61137
2022-01-29 14:46:29 +01:00
Daniel Conley bc21b06a69 Add Explanation For Error E0772 2022-01-28 11:00:56 -05:00
Tomasz Miąsko e1dec1316b Reject unsupported naked functions
Transition unsupported naked functions future incompatibility lint into
an error:

* Naked functions must contain a single inline assembly block.
  Introduced as future incompatibility lint in 1.50 #79653.
  Change into an error fixes a soundness issue described in #32489.

* Naked functions must not use any forms of inline attribute.
  Introduced as future incompatibility lint in 1.56 #87652.
2022-01-21 17:38:21 +01:00
Matthias Krüger 0440bbee20 Rollup merge of #92752 - jamestiotio:error-codes-typos, r=nagisa
Correct minor typos in some long error code explanations

Just a little nitpick to improve the long explanations of the error codes. 😊
2022-01-17 20:07:04 +01:00
Tomasz Miąsko ce60aacfb1 Error codes specific to LLVM-style inline asssembly are no longer emitted 2022-01-12 21:43:36 +01:00
James R T e5cfe0aa0c fix(compiler): correct minor typos in some long error code explanations 2022-01-11 10:42:51 +08:00
TmLev 1c0eccdc06 docs(error-codes): Add long error explanation for E0227 2021-12-28 15:46:20 +03:00
George Bateman 6c8807c1f3 #91836: Clarify error on casting larger integers to char 2021-12-14 21:49:49 +00:00
Graydon Hoare 8310ebf979 Clarify and tidy up explanation of E0038 2021-11-30 09:25:17 -08:00
bstrie b610ba6ef9 Update Copy/Clone documentation WRT arrays 2021-11-08 13:11:59 -05:00
Joshua Nelson ee70fb3396 Improve error when an .rlib can't be parsed
This usually describes either an error in the compiler itself or some
sort of IO error. Either way, we should report it to the user rather
than just saying "crate not found".

This only gives an error if the crate couldn't be loaded at all - if the
compiler finds another .rlib or .rmeta file which was valid, it will
continue to compile the crate.

Example output:
```
error[E0785]: found invalid metadata files for crate `foo`
 --> bar.rs:3:24
  |
3 |         println!("{}", foo::FOO_11_49[0]);
  |                        ^^^
  |
  = warning: failed to parse rlib '/home/joshua/test-rustdoc/libfoo.rlib': Invalid archive extended name offset
```
2021-11-07 15:03:40 +00:00
Ben Boeckel f49559b7d4 error_codes: uniformly comment error codes 2021-11-05 11:57:17 -04:00
Yuki Okushi 18ec23e381 Rollup merge of #89922 - JohnTitor:update-e0637, r=jackh726
Update E0637 description to mention `&` w/o an explicit lifetime name

Deal with https://github.com/rust-lang/rust/issues/89824#issuecomment-941598647. Another solution would be splitting the error code into two as (I think) it's a bit unclear to users why they have the same error code.
2021-10-22 19:42:46 +09:00
Oli Scherer fe55ecedd4 Member constraints already covered all of E0482 already, so that error never occurred anymore 2021-10-18 15:50:56 +00:00
Yuki Okushi 07b92efd4c Update E0637 description to mention & w/o an explicit lifetime name 2021-10-16 02:49:58 +09:00
bors 2309321d9e Auto merge of #89903 - matthiaskrgr:rollup-s0c69xl, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #86011 (move implicit `Sized` predicate to end of list)
 - #89821 (Add a strange test for `unsafe_code` lint.)
 - #89859 (add dedicated error variant for writing the discriminant of an uninhabited enum variant)
 - #89870 (Suggest Box::pin when Pin::new is used instead)
 - #89880 (Use non-checking TLS relocation in aarch64 asm! sym test.)
 - #89885 (add long explanation for E0183)
 - #89894 (Remove unused dependencies from rustc_const_eval)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-10-15 05:59:49 +00:00
Matthias Krüger 63a7c6c8a0 Rollup merge of #89885 - cameron1024:long-explanation-E0183, r=GuillaumeGomez
add long explanation for E0183

Addresses #61137
2021-10-15 07:44:49 +02:00
cameron1024 487a440f79 add long explanation for E0183 2021-10-14 17:44:04 +01:00
Mark Rousskov 95e2cf0083 Revert "Stabilize arbitrary_enum_discriminant"
This reverts commit 7e31666cb7.
2021-10-14 10:57:56 -04:00
Noah Lev c051d98354 Add long explanation for E0464
The test is copied from `src/test/ui/crate-loading/crateresolve1.rs` and
its auxiliary tests. I added it to the `compile_fail` code example check
exemption list since it's hard if not impossible to reproduce this error
in a standalone code example.
2021-10-12 13:10:12 -07:00
Matthias Krüger f5f4cc9a8f Rollup merge of #89710 - sireliah:e0482, r=GuillaumeGomez
Add long explanation for error E0482

This is longer explanation for error E0482 in the #61137.

Please take a look and leave some feedback!
2021-10-11 23:45:50 +02:00
sireliah 6ecc71c952 Clarify the error descriptions 2021-10-11 21:48:35 +02:00
sireliah 229b5764cd Add long explanation for error E0482 2021-10-09 21:49:09 +02:00
Bruce Mitchener 600e8704c3 Consistently use 'supertrait'.
A subset of places referred to 'super-trait', so this changes them
to all use 'supertrait'. This matches 'supertype' and some other
usages. An exception is 'auto-trait' which is consistently used
in that manner.
2021-10-02 08:05:44 +07:00
Mark Rousskov f5a19f35c1 Migrate to 2021 2021-09-20 22:21:42 -04:00
Yuki Okushi 17e6f7692c Rollup merge of #88855 - calebzulawski:feature/simd_shuffle, r=nagisa
Allow simd_shuffle to accept vectors of any length

cc ``@rust-lang/project-portable-simd`` ``@workingjubilee``
2021-09-19 17:31:29 +09:00
Fabian Wolff 0a1cb51744 Do not issue E0071 if a type error has already been reported 2021-09-12 23:07:23 +02:00
Caleb Zulawski 577c9379b7 Allow simd_shuffle to accept vectors of any length 2021-09-11 14:55:14 +00:00
Michael Howell 26df3ff3a1 Update E0785.md 2021-08-30 22:18:55 -07:00
Michael Howell 340e90545b fix(rustc_typeck): produce better errors for dyn auto trait
Fixes #85026
2021-08-30 22:15:11 -07:00
lcnr 867a365df7 feature(const_param_types) -> feature(adt_const_params) 2021-08-30 12:07:36 +02:00
lcnr 14bd6f329f feature(const_generics) -> feature(const_param_types) 2021-08-30 11:00:21 +02:00
asquared31415 d27dc5b9fe Detect incorrect number of lang item generics 2021-08-23 10:15:25 -04:00
bors f95354f9f8 Auto merge of #88134 - rylev:force-warn-improvements, r=nikomatsakis
Force warn improvements

As part of stablization of the `--force-warn` option (#86516) I've made the following changes:
* Error when the `warnings` lint group is based to the `--force-warn` option
* Tests have been updated to make it easier to understand the semantics of `--force-warn`

r? `@nikomatsakis`
2021-08-21 15:51:50 +00:00
Anton Golov d7a505fa49 Change example and tests for E0161.
The code will not emit this warning once box expressions require a sized
type (since that error is emitted earlier in the flow).
2021-08-20 15:59:42 +02:00
Ryan Levick b7c2c50c7a Error when warnings lint group is used with force-warn 2021-08-18 11:53:59 +02:00
bors 851a56d587 Auto merge of #86860 - fee1-dead:stabilize, r=LeSeulArtichaut
Stabilize `arbitrary_enum_discriminant`

Closes #60553.

----

## Stabilization Report

_copied from https://github.com/rust-lang/rust/issues/60553#issuecomment-865922311_

### Summary

Enables a user to specify *explicit* discriminants on arbitrary enums.

Previously, this was hard to achieve:

```rust
#[repr(u8)]
enum Foo {
    A(u8) = 0,
    B(i8) = 1,
    C(bool) = 42,
}
```

Someone would need to add 41 hidden variants in between as a workaround with implicit discriminants.

In conjunction with [RFC 2195](https://github.com/rust-lang/rfcs/blob/master/text/2195-really-tagged-unions.md), this feature would provide more flexibility for FFI and unsafe code involving enums.

### Test cases

Most tests are in [`src/test/ui/enum-discriminant`](https://github.com/rust-lang/rust/tree/master/src/test/ui/enum-discriminant), there are two [historical](https://github.com/rust-lang/rust/blob/master/src/test/ui/parser/tag-variant-disr-non-nullary.rs) [tests](https://github.com/rust-lang/rust/blob/master/src/test/ui/parser/issue-17383.rs) that are now covered by the feature (removed by this pr due to them being obsolete).

### Edge cases

The feature is well defined and does not have many edge cases.
One [edge case](https://github.com/rust-lang/rust/issues/70509) was related to another unstable feature named `repr128` and is resolved.

### Previous PRs

The [implementation PR](https://github.com/rust-lang/rust/pull/60732) added documentation to the Unstable Book, https://github.com/rust-lang/reference/pull/1055 was opened as a continuation of https://github.com/rust-lang/reference/pull/639.

### Resolution of unresolved questions

The questions are resolved in https://github.com/rust-lang/rust/issues/60553#issuecomment-511235271.

----

(someone please add `needs-fcp`)
2021-08-18 01:00:17 +00:00