about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src
AgeCommit message (Collapse)AuthorLines
2021-07-05Rollup merge of #86477 - tlyu:e0716-clarification, r=JohnTitorYuki Okushi-2/+4
E0716: clarify that equivalent code example is erroneous In E0716, there is a code block that is equivalent to the erroneous code example. Especially when viewed with `rustc --explain`, it's not obvious that it is also erroneous, and some users have been confused when they try to change their code to match the erroneous equivalent. `@rustbot` label +A-diagnostics +D-newcomer-roadblock +T-compiler
2021-07-04E0716: clarify that equivalent code example is erroneousTaylor Yu-2/+4
In E0716, there is a code block that is equivalent to the erroneous code example. Especially when viewed with `rustc --explain`, it's not obvious that it is also erroneous, and some users have been confused when they try to change their code to match the erroneous equivalent.
2021-07-02Rollup merge of #86148 - FabianWolff:issue-85855, r=varkorYuki Okushi-1/+1
Check the number of generic lifetime and const parameters of intrinsics This pull request fixes #85855. The current code for type checking intrinsics only checks the number of generic _type_ parameters, but does not check for an incorrect number of lifetime or const parameters, which can cause problems later on, such as the ICE in #85855, where the code thought that it was looking at a type parameter but found a lifetime parameter: ``` error: internal compiler error: compiler/rustc_middle/src/ty/generics.rs:188:18: expected type parameter, but found another generic parameter ``` The changes in this PR add checks for the number of lifetime and const parameters, expand the scope of `E0094` to also apply to these cases, and improve the error message by properly pluralizing the number of expected generic parameters.
2021-07-01Minor adjustments and refactoringFabian Wolff-2/+1
2021-06-29Fix typo and improve documentation for E0632Fabian Wolff-2/+26
2021-06-24Auto merge of #86279 - JohnTitor:transparent-zero-size-fields, r=nikomatsakisbors-5/+5
Permit zero non-zero-field on transparent types Fixes #77841 This makes the transparent fields meet the below: > * A `repr(transparent)` type `T` must meet the following rules: > * It may have any number of 1-ZST fields > * In addition, it may have at most one other field of type U r? `@nikomatsakis`
2021-06-23Remove unused error codes from error_codes.rs and from EXEMPTED_FROM_TEST ↵Guillaume Gomez-5/+4
constant
2021-06-22Add destructuring example of E0508mbartlett21-0/+13
This adds an example that destructures the array to move the value, instead of taking a reference or cloning.
2021-06-14Adjust documentationYuki Okushi-5/+5
2021-06-13Fix typo `with custom a custom` -> `with a custom`Shadlock0133-1/+1
2021-06-08Check the number of generic lifetime and const parameters of intrinsicsFabian Wolff-1/+2
2021-06-07Add E0316.mdFabian Wolff-1/+33
2021-06-07Comment out unused error codes in error_codes.rsFabian Wolff-15/+15
2021-06-06Fix corrected example in E0759.mdFabian Wolff-3/+3
2021-05-13swap function order for better read flowRafael Kraut-5/+5
When having the order ``` foo.bar(); // we can now use this method since i32 implements the Foo trait [...] impl Foo for i32 ``` the `// we can now use this method` comment is less clear to me.
2021-05-04Auto merge of #83213 - rylev:update-lints-to-errors, r=nikomatsakisbors-0/+50
Update BARE_TRAIT_OBJECT and ELLIPSIS_INCLUSIVE_RANGE_PATTERNS to errors in Rust 2021 This addresses https://github.com/rust-lang/rust/pull/81244 by updating two lints to errors in the Rust 2021 edition. r? `@estebank`
2021-04-29Implement RFC 1260 with feature_name `imported_main`.Charles Lew-1/+3
2021-04-25remove const_fn from some error_code descriptionsRalf Jung-4/+0
2021-04-24Auto merge of #84310 - RalfJung:const-fn-feature-flags, r=oli-obkbors-21/+1
further split up const_fn feature flag This continues the work on splitting up `const_fn` into separate feature flags: * `const_fn_trait_bound` for `const fn` with trait bounds * `const_fn_unsize` for unsizing coercions in `const fn` (looks like only `dyn` unsizing is still guarded here) I don't know if there are even any things left that `const_fn` guards... at least libcore and liballoc do not need it any more. `@oli-obk` are you currently able to do reviews?
2021-04-23Auto merge of #83729 - JohnTitor:issue-43913, r=estebankbors-6/+20
Add a suggestion when using a type alias instead of trait alias Fixes #43913 r? `@estebank`
2021-04-19remove E0723 error codeRalf Jung-21/+1
2021-04-18Auto merge of #83799 - crlf0710:stablize_non_ascii_idents, r=Manishearthbors-5/+2
Stablize `non-ascii-idents` This is the stablization PR for RFC 2457. Currently this is waiting on fcp in [tracking issue](https://github.com/rust-lang/rust/issues/55467). r? `@Manishearth`
2021-04-16Remove #[main] attribute.Charles Lew-2/+4
2021-04-13Add compatibility info to lintsRyan Levick-2/+2
2021-04-08Fix error code testsRyan Levick-2/+2
2021-04-08Improve errorRyan Levick-1/+1
2021-04-08Update error code docs even moreRyan Levick-12/+8
2021-04-08Proper format for error code explanationsRyan Levick-13/+30
2021-04-08Fix error code tests for nowRyan Levick-3/+3
2021-04-08Update BARE_TRAIT_OBJECT and ELLIPSIS_INCLUSIVE_RANGE_PATTERNS to errors in ↵Ryan Levick-0/+37
Rust 2021
2021-04-08Stablize `non_ascii_idents` feature.Charles Lew-5/+2
2021-04-04Bump cfgsMark Rousskov-2/+1
2021-04-02Mention trait alias on the E0404 noteYuki Okushi-6/+20
2021-03-23progress, stuff compiles nowlcnr-1/+1
2021-03-04Rollup merge of #80527 - jyn514:rustdoc-lints, r=GuillaumeGomezYuki Okushi-1/+2
Make rustdoc lints a tool lint instead of built-in - Rename `broken_intra_doc_links` to `rustdoc::broken_intra_doc_links` (and similar for other rustdoc lints; I don't expect any others to be used frequently, though). - Ensure that the old lint names still work and give deprecation errors - Register lints even when running doctests - Move lint machinery into a separate file - Add `declare_rustdoc_lint!` macro Unblocks https://github.com/rust-lang/rust/pull/80300, https://github.com/rust-lang/rust/pull/79816, https://github.com/rust-lang/rust/pull/80965. Makes the strangeness in https://github.com/rust-lang/rust/pull/77364 more apparent to the end user (note that `missing_docs` is *not* moved to rustdoc in this PR). Closes https://github.com/rust-lang/rust/issues/78786. ## Current status This is blocked on #82620 (see https://github.com/rust-lang/rust/pull/80527#issuecomment-787401519)
2021-03-02Rollup merge of #82516 - PoignardAzur:inherent-impl-ty, r=oli-obkYuki Okushi-16/+0
Add incomplete feature gate for inherent associate types. Mentored by ``````@oli-obk`````` So far the only change is that instead of giving an automatic error, the following code compiles: ```rust struct Foo; impl Foo { type Bar = isize; } ``` The backend work to make it actually usable isn't there yet. In particular, this: ```rust let x : Foo::Bar; ``` will give you: ```sh error[E0223]: ambiguous associated type --> /$RUSTC_DIR/src/test/ui/assoc-inherent.rs:15:13 | LL | let x : Foo::Bar; | ^^^^^^^^ help: use fully-qualified syntax: `<Foo as Trait>::Bar` ```
2021-03-01Rename rustdoc lints to be a tool lint instead of built-in.Joshua Nelson-1/+2
- Rename `broken_intra_doc_links` to `rustdoc::broken_intra_doc_links` - Ensure that the old lint names still work and give deprecation errors - Register lints even when running doctests Otherwise, all `rustdoc::` lints would be ignored. - Register all existing lints as removed This unfortunately doesn't work with `register_renamed` because tool lints have not yet been registered when rustc is running. For similar reasons, `check_backwards_compat` doesn't work either. Call `register_removed` directly instead. - Fix fallout + Rustdoc lints for compiler/ + Rustdoc lints for library/ Note that this does *not* suggest `rustdoc::broken_intra_doc_links` for `rustdoc::intra_doc_link_resolution_failure`, since there was no time when the latter was valid.
2021-02-26Auto merge of #78429 - casey:doctest-attribute-splitting, r=jyn514bors-1/+1
[librustdoc] Only split lang string on `,`, ` `, and `\t` Split markdown lang strings into tokens on `,`. The previous behavior was to split lang strings into tokens on any character that wasn't a `_`, `_`, or alphanumeric. This is a potentially breaking change, so please scrutinize! See discussion in #78344. I noticed some test cases that made me wonder if there might have been some reason for the original behavior: ``` t("{.no_run .example}", false, true, Ignore::None, true, false, false, false, v(), None); t("{.sh .should_panic}", true, false, Ignore::None, false, false, false, false, v(), None); t("{.example .rust}", false, false, Ignore::None, true, false, false, false, v(), None); t("{.test_harness .rust}", false, false, Ignore::None, true, true, false, false, v(), None); ``` It seemed pretty peculiar to specifically test lang strings in braces, with all the tokens prefixed by `.`. I did some digging, and it looks like the test cases were added way back in [this commit from 2014](https://github.com/rust-lang/rust/commit/3fef7a74ca9a) by `@skade.` It looks like they were added just to make sure that the splitting was permissive, and aren't testing that those strings in particular are accepted. Closes https://github.com/rust-lang/rust/issues/78344.
2021-02-25Add feature gate for inherent associate types.Olivier FAURE-16/+0
2021-02-18Rollup merge of #82246 - jesusprubio:add-long-explanation-e0549, ↵Dylan DPC-3/+38
r=GuillaumeGomez Add long explanation for E0549 Helps with #61137
2021-02-18Rollup merge of #82215 - TaKO8Ki:replace-if-let-while-let, r=varkorDylan DPC-2/+2
Replace if-let and while-let with `if let` and `while let` This pull request replaces if-let and while-let with `if let` and `while let`. closes https://github.com/rust-lang/rust/issues/82205
2021-02-18Update compiler/rustc_error_codes/src/error_codes/E0549.mdJesús Rubio-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2021-02-18Update compiler/rustc_error_codes/src/error_codes/E0549.mdJesús Rubio-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2021-02-18Update compiler/rustc_error_codes/src/error_codes/E0549.mdJesús Rubio-2/+2
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2021-02-18Add long explanation for E0549Jesus Rubio-3/+38
2021-02-17Add long explanation for E0543Jesus Rubio-1/+36
2021-02-17replace if-let and while-let with `if let` and `while let`Takayuki Maeda-2/+2
2021-02-15Add long explanation for E0545Jesus Rubio-1/+36
2021-02-12[librustdoc] Reform lang string token splittingCasey Rodarmor-1/+1
Only split doctest lang strings on `,`, ` `, and `\t`. Additionally, to preserve backwards compatibility with pandoc-style langstrings, strip a surrounding `{}`, and remove leading `.`s from each token. Prior to this change, doctest lang strings were split on all non-alphanumeric characters except `-` or `_`, which limited future extensions to doctest lang string tokens, for example using `=` for key-value tokens. This is a breaking change, although it is not expected to be disruptive, because lang strings using separators other than `,` and ` ` are not very common
2021-02-11Improve long explanation for E0542 and E0546Jesus Rubio-2/+2