about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src
AgeCommit message (Collapse)AuthorLines
2022-02-28Rollup merge of #94449 - GuillaumeGomez:explanation-e0726, r=UrgauMatthias Krüger-1/+47
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-28Add explanation for E0726Guillaume Gomez-1/+47
2022-02-24Remove in-band lifetimesMichael Goulet-2/+6
2022-02-17Revert "Auto merge of #91403 - cjgillot:inherit-async, r=oli-obk"Oli Scherer-3/+3
This reverts commit 3cfa4def7c87d571bd46d92fed608edf8fad236e, reversing changes made to 5d8767cb229b097fedb1dd4bd9420d463c37774f.
2022-02-12Auto merge of #91403 - cjgillot:inherit-async, r=oli-obkbors-3/+3
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-12Update error code documentation.Camille GILLOT-3/+3
2022-02-12Add missing E0192 in the error code listingGuillaume Gomez-3/+5
2022-02-06Rollup merge of #91939 - GKFX:feature-91866, r=cjgillotMatthias Krüger-3/+8
Clarify error on casting larger integers to char Closes #91836 with changes to E0604.md and a `span_help`.
2022-01-29Rollup merge of #88205 - danii:e0772, r=GuillaumeGomezMatthias Krüger-1/+90
Add Explanation For Error E0772 I've added an error explanation for the error code E0772. Assists with #61137
2022-01-28Add Explanation For Error E0772Daniel Conley-1/+90
2022-01-21Reject unsupported naked functionsTomasz Miąsko-0/+29
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-17Rollup merge of #92752 - jamestiotio:error-codes-typos, r=nagisaMatthias Krüger-6/+6
Correct minor typos in some long error code explanations Just a little nitpick to improve the long explanations of the error codes. 😊
2022-01-12Error codes specific to LLVM-style inline asssembly are no longer emittedTomasz Miąsko-32/+21
2022-01-11fix(compiler): correct minor typos in some long error code explanationsJames R T-6/+6
2021-12-28docs(error-codes): Add long error explanation for E0227TmLev-1/+34
2021-12-14#91836: Clarify error on casting larger integers to charGeorge Bateman-3/+8
2021-11-30Clarify and tidy up explanation of E0038Graydon Hoare-32/+65
2021-11-08Update Copy/Clone documentation WRT arraysbstrie-6/+3
2021-11-07Improve error when an .rlib can't be parsedJoshua Nelson-0/+15
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-05error_codes: uniformly comment error codesBen Boeckel-20/+19
2021-10-22Rollup merge of #89922 - JohnTitor:update-e0637, r=jackh726Yuki Okushi-10/+26
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-18Member constraints already covered all of E0482 already, so that error never ↵Oli Scherer-2/+4
occurred anymore
2021-10-16Update E0637 description to mention `&` w/o an explicit lifetime nameYuki Okushi-10/+26
2021-10-15Auto merge of #89903 - matthiaskrgr:rollup-s0c69xl, r=matthiaskrgrbors-1/+40
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-15Rollup merge of #89885 - cameron1024:long-explanation-E0183, r=GuillaumeGomezMatthias Krüger-1/+40
add long explanation for E0183 Addresses #61137
2021-10-14add long explanation for E0183cameron1024-1/+40
2021-10-14Revert "Stabilize `arbitrary_enum_discriminant`"Mark Rousskov-0/+4
This reverts commit 7a62f29f3171767090949778ce0f161e930706b9.
2021-10-12Add long explanation for E0464Noah Lev-1/+7
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-11Rollup merge of #89710 - sireliah:e0482, r=GuillaumeGomezMatthias Krüger-1/+74
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-11Clarify the error descriptionssireliah-17/+22
2021-10-09Add long explanation for error E0482sireliah-1/+69
2021-10-02Consistently use 'supertrait'.Bruce Mitchener-2/+2
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-09-19Rollup merge of #88855 - calebzulawski:feature/simd_shuffle, r=nagisaYuki Okushi-1/+3
Allow simd_shuffle to accept vectors of any length cc ``@rust-lang/project-portable-simd`` ``@workingjubilee``
2021-09-12Do not issue E0071 if a type error has already been reportedFabian Wolff-7/+7
2021-09-11Allow simd_shuffle to accept vectors of any lengthCaleb Zulawski-1/+3
2021-08-30Update E0785.mdMichael Howell-1/+1
2021-08-30fix(rustc_typeck): produce better errors for dyn auto traitMichael Howell-0/+31
Fixes #85026
2021-08-30`feature(const_param_types)` -> `feature(adt_const_params)`lcnr-4/+4
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-7/+4
2021-08-23Detect incorrect number of lang item genericsasquared31415-1/+1
2021-08-21Auto merge of #88134 - rylev:force-warn-improvements, r=nikomatsakisbors-1/+1
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-20Change example and tests for E0161.Anton Golov-5/+21
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-18Error when warnings lint group is used with force-warnRyan Levick-1/+1
2021-08-18Auto merge of #86860 - fee1-dead:stabilize, r=LeSeulArtichautbors-4/+0
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-11Rollup merge of #87700 - kornelski:e530text, r=oli-obkYuki Okushi-14/+39
Expand explanation of E0530 The explanation didn't cover a puzzling case of enum variants missing fields.
2021-08-08Auto merge of #87697 - GuillaumeGomez:add-e0784, r=nagisabors-1/+34
Assign E0784 error code for union expression errors
2021-08-06Rollup merge of #87715 - bhgomes:long-explanation-E0625, r=GuillaumeGomezYuki Okushi-1/+29
Add long error explanation for E0625 For #61137.
2021-08-04move full explanation to after erroneous exampleBrandon H. Gomes-4/+5
2021-08-03rustc: Fill out remaining parts of C-unwind ABIAlex Crichton-1/+3
This commit intends to fill out some of the remaining pieces of the C-unwind ABI. This has a number of other changes with it though to move this design space forward a bit. Notably contained within here is: * On `panic=unwind`, the `extern "C"` ABI is now considered as "may unwind". This fixes a longstanding soundness issue where if you `panic!()` in an `extern "C"` function defined in Rust that's actually UB because the LLVM representation for the function has the `nounwind` attribute, but then you unwind. * Whether or not a function unwinds now mainly considers the ABI of the function instead of first checking the panic strategy. This fixes a miscompile of `extern "C-unwind"` with `panic=abort` because that ABI can still unwind. * The aborting stub for non-unwinding ABIs with `panic=unwind` has been reimplemented. Previously this was done as a small tweak during MIR generation, but this has been moved to a separate and dedicated MIR pass. This new pass will, for appropriate functions and function calls, insert a `cleanup` landing pad for any function call that may unwind within a function that is itself not allowed to unwind. Note that this subtly changes some behavior from before where previously on an unwind which was caught-to-abort it would run active destructors in the function, and now it simply immediately aborts the process. * The `#[unwind]` attribute has been removed and all users in tests and such are now using `C-unwind` and `#![feature(c_unwind)]`. I think this is largely the last piece of the RFC to implement. Unfortunately I believe this is still not stabilizable as-is because activating the feature gate changes the behavior of the existing `extern "C"` ABI in a way that has no replacement. My thinking for how to enable this is that we add support for the `C-unwind` ABI on stable Rust first, and then after it hits stable we change the behavior of the `C` ABI. That way anyone straddling stable/beta/nightly can switch to `C-unwind` safely.
2021-08-03remove trailing newlineBrandon H. Gomes-1/+0