about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src
AgeCommit message (Collapse)AuthorLines
2021-02-05Rollup merge of #81676 - jyn514:crate-not-found, r=oli-obkMara Bos-0/+21
Add more information to the error code for 'crate not found' This comes up a lot when bootstrapping.
2021-02-03Add more information to the error code for 'crate not found'Joshua Nelson-0/+21
This comes up a lot when bootstrapping.
2021-02-03Auto merge of #81346 - hug-dev:nonsecure-call-abi, r=jonas-schievinkbors-0/+13
Add a new ABI to support cmse_nonsecure_call This adds support for the `cmse_nonsecure_call` feature to be able to perform non-secure function call. See the discussion on Zulip [here](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Support.20for.20callsite.20attributes/near/223054928). This is a followup to #75810 which added `cmse_nonsecure_entry`. As for that PR, I assume that the changes are small enough to not have to go through a RFC but I don't mind doing one if needed 😃 I did not yet create a tracking issue, but if most of it is fine, I can create one and update the various files accordingly (they refer to the other tracking issue now). On the Zulip chat, I believe `@jonas-schievink` volunteered to be a reviewer 💯
2021-02-02Add a new ABI to support cmse_nonsecure_callHugues de Valon-0/+13
This commit adds a new ABI to be selected via `extern "C-cmse-nonsecure-call"` on function pointers in order for the compiler to apply the corresponding cmse_nonsecure_call callsite attribute. For Armv8-M targets supporting TrustZone-M, this will perform a non-secure function call by saving, clearing and calling a non-secure function pointer using the BLXNS instruction. See the page on the unstable book for details. Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2021-02-01Add long error explanation for E0521Jesus Rubio-1/+29
2021-01-31Rollup merge of #81572 - pierwill:edit-error-codes-1, r=jonas-schievinkJonas Schievink-12/+14
Edit multiple error code Markdown files Makes small edits to several error code files. Fixes some missing punctuation. Changes some wording, grammar, and formatting for clarity and readability. Adds a link to the rustup book in E0658.
2021-01-30Edit multiple error code Markdown filespierwill-12/+14
Makes small edits to several error code files. Fixes some missing punctuation. Changes some wording, grammar, and formatting for clarity and readability. Adds a link to the rustup book in E0658.
2021-01-30Fix typo in E0759Steve Heindel-1/+1
2021-01-24Fix spelling in documentation for error E0207Joakim Ã…kerblom-1/+1
I have trouble parsing the the wording "type parameter parameter".
2021-01-16Rollup merge of #80614 - 1000teslas:issue-78938-fix, r=tmandryMara Bos-0/+21
Explain why borrows can't be held across yield point in async blocks For https://github.com/rust-lang/rust/issues/78938.
2021-01-15Simplify E0373 async code example1000teslas-22/+5
2021-01-14Fix E0373 code example1000teslas-1/+1
2021-01-14Fix error E0373 documentation1000teslas-7/+23
2021-01-14Fix whitespace1000teslas-2/+2
2021-01-13Update code to account for extern ABI requirementMark Rousskov-1/+1
2021-01-13Update tests for extern block lintingMark Rousskov-16/+16
2021-01-13Move help link to error index1000teslas-0/+22
2021-01-07Refine E0435 descriptionDaiki Ihara-0/+6
2021-01-01Reinstate the error-code error over the feature gate erroroli-2/+0
2021-01-01Allow references to interior mutable data behind a feature gateoli-2/+4
2020-12-31Auto merge of #80267 - 0urobor0s:ouro/61592, r=jyn514bors-0/+20
Rustdoc render public underscore_imports as Re-exports Fixes #61592
2020-12-31Rustdoc render public underscore_imports as Re-exportsbors-0/+20
Fixes #61592
2020-12-26update error codesBastian Kauschke-3/+0
2020-12-10Rollup merge of #79639 - sasurau4:feature/add-long-explanation-E0212, ↵Tyler Mandry-1/+36
r=GuillaumeGomez Add long explanation for E0212 Helps with #61137
2020-12-06smarter E0390Ethan Brierley-2/+3
2020-12-04Add long explanation for E0212Daiki Ihara-1/+36
Update compiler/rustc_error_codes/src/error_codes/E0212.md Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-12-03Auto merge of #79533 - sasurau4:feature/add-long-explanation-E0546, ↵bors-1/+28
r=GuillaumeGomez Add long explanation of E0546 Helps with #61137
2020-12-02Add long explanation of E0546Daiki Ihara-1/+28
2020-11-27Slightly improve code samples in E0591Camelid-7/+13
* Improve formatting * Don't hide `unsafe` block - it's important!
2020-11-23Rename `optin_builtin_traits` to `auto_traits`Camelid-6/+6
They were originally called "opt-in, built-in traits" (OIBITs), but people realized that the name was too confusing and a mouthful, and so they were renamed to just "auto traits". The feature flag's name wasn't updated, though, so that's what this PR does. There are some other spots in the compiler that still refer to OIBITs, but I don't think changing those now is worth it since they are internal and not particularly relevant to this PR. Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.
2020-11-16Update E0744 about control flow in `const` contexts to reflect the current ↵James-8/+11
status of `const fn`. This is a squash of these commits: - Update E0744 about control flow in `const` contexts to reflect current status of `const fn`. - E0744 isn't just about `for` loops or control flow - Fix formatting on E0744 cause my editor decided to not copy it well - Improve wording - Fix a markdown formatting error - Fix E0744's description as I interpreted some code wrong - Fix a minor wording issue again - Add a few more links to blocking issues - Improve links to tracking issues
2020-11-05`deny(invalid_codeblock_attributes)`Joshua Nelson-0/+1
2020-10-27Rollup merge of #78332 - PoignardAzur:doc_E0308, r=camelidYuki Okushi-12/+20
Update description for error E0308 Fixes #76462 r? @camelid
2020-10-25Update description for error E0308Olivier FAURE-12/+20
As per #76462
2020-10-17Rollup merge of #77971 - jyn514:broken-intra-doc-links, r=mark-simulacrumYuki Okushi-5/+5
Deny broken intra-doc links in linkchecker Since rustdoc isn't warning about these links, check for them manually. This also fixes the broken links that popped up from the lint.
2020-10-15Deny broken intra-doc links in linkcheckerJoshua Nelson-5/+5
Since rustdoc isn't warning about these links, check for them manually.
2020-10-16Rollup merge of #76119 - Amjad50:stabilizing-move_ref_pattern, r=nikomatsakisDylan DPC-2/+6
Stabilize move_ref_pattern # Implementation - Initially the rule was added in the run-up to 1.0. The AST-based borrow checker was having difficulty correctly enforcing match expressions that combined ref and move bindings, and so it was decided to simplify forbid the combination out right. - The move to MIR-based borrow checking made it possible to enforce the rules in a finer-grained level, but we kept the rule in place in an effort to be conservative in our changes. - In #68376, @Centril lifted the restriction but required a feature-gate. - This PR removes the feature-gate. Tracking issue: #68354. # Description This PR is to stabilize the feature `move_ref_pattern`, which allows patterns containing both `by-ref` and `by-move` bindings at the same time. For example: `Foo(ref x, y)`, where `x` is `by-ref`, and `y` is `by-move`. The rules of moving a variable also apply here when moving *part* of a variable, such as it can't be referenced or moved before. If this pattern is used, it would result in *partial move*, which means that part of the variable is moved. The variable that was partially moved from cannot be used as a whole in this case, only the parts that are still not moved can be used. ## Documentation - The reference (rust-lang/reference#881) - Rust by example (rust-lang/rust-by-example#1377) ## Tests There are many tests, but I think one of the comperhensive ones: - [borrowck-move-ref-pattern-pass.rs](https://github.com/Centril/rust/blob/85fbf49ce0e2274d0acf798f6e703747674feec3/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern-pass.rs) - [borrowck-move-ref-pattern.rs](https://github.com/Centril/rust/blob/85fbf49ce0e2274d0acf798f6e703747674feec3/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.rs) # Examples ```rust #[derive(PartialEq, Eq)] struct Finished {} #[derive(PartialEq, Eq)] struct Processing { status: ProcessStatus, } #[derive(PartialEq, Eq)] enum ProcessStatus { One, Two, Three, } #[derive(PartialEq, Eq)] enum Status { Finished(Finished), Processing(Processing), } fn check_result(_url: &str) -> Status { // fetch status from some server Status::Processing(Processing { status: ProcessStatus::One, }) } fn wait_for_result(url: &str) -> Finished { let mut previous_status = None; loop { match check_result(url) { Status::Finished(f) => return f, Status::Processing(p) => { match (&mut previous_status, p.status) { (None, status) => previous_status = Some(status), // first status (Some(previous), status) if *previous == status => {} // no change, ignore (Some(previous), status) => { // Now it can be used // new status *previous = status; } } } } } } ``` Before, we would have used: ```rust match (&previous_status, p.status) { (Some(previous), status) if *previous == status => {} // no change, ignore (_, status) => { // new status previous_status = Some(status); } } ``` Demonstrating *partial move* ```rust fn main() { #[derive(Debug)] struct Person { name: String, age: u8, } let person = Person { name: String::from("Alice"), age: 20, }; // `name` is moved out of person, but `age` is referenced let Person { name, ref age } = person; println!("The person's age is {}", age); println!("The person's name is {}", name); // Error! borrow of partially moved value: `person` partial move occurs //println!("The person struct is {:?}", person); // `person` cannot be used but `person.age` can be used as it is not moved println!("The person's age from person struct is {}", person.age); } ```
2020-10-10Fix typo in error code descriptionNaoki Hayama-1/+1
s/abitrary/arbitrary/
2020-10-08Implement the instruction_set attributexd009642-0/+69
2020-10-07Auto merge of #77464 - ecstatic-morse:const-fn-impl-trait, r=oli-obkbors-12/+4
Give `impl Trait` in a `const fn` its own feature gate ...previously it was gated under `#![feature(const_fn)]`. I think we actually want to do this in all const-contexts? If so, this should be `#![feature(const_impl_trait)]` instead. I don't think there's any way to make use of `impl Trait` within a `const` initializer. cc #77463 r? `@oli-obk`
2020-10-06Update error code pageDylan MacKenzie-12/+4
2020-10-06Don't immediately error for recursive projectionsMatthew Jasper-1/+1
2020-10-06Fix toolsMatthew Jasper-23/+15
2020-10-01Create E0777 error code for "invalid literal in derive"Guillaume Gomez-0/+20
2020-10-01Auto merge of #77354 - ecstatic-morse:const-checking-moar-errors, r=oli-obkbors-37/+1
Overhaul const-checking diagnostics The primary purpose of this PR was to remove `NonConstOp::STOPS_CONST_CHECKING`, which causes any additional errors found by the const-checker to be silenced. I used this flag to preserve diagnostic parity with `qualify_min_const_fn.rs`, which has since been removed. However, simply removing the flag caused a deluge of errors in some cases, since an error would be emitted any time a local or temporary had a wrong type. To remedy this, I added an alternative system (`DiagnosticImportance`) to silence additional error messages that were likely to distract the user from the underlying issue. When an error of the highest importance occurs, all less important errors are silenced. When no error of the highest importance occurs, all less important errors are emitted after checking is complete. Following the suggestions from the important error is usually enough to fix the less important errors, so this should lead to better UX most of the time. There's also some unrelated diagnostics improvements in this PR isolated in their own commits. Splitting them out would be possible, but a bit of a pain. This isn't as tidy as some of my other PRs, but it should *only* affect diagnostics, never whether or not something passes const-checking. Note that there are a few trivial exceptions to this, like banning `Yield` in all const-contexts, not just `const fn`. As always, meant to be reviewed commit-by-commit. r? `@oli-obk`
2020-09-30Remove E0019, use E0015 for inline assembly in a constDylan MacKenzie-39/+1
2020-09-30Add more tests and check for ABIHugues de Valon-1/+15
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2020-09-30Add support for cmse_nonsecure_entry attributeHugues de Valon-0/+18
This patch adds support for the LLVM cmse_nonsecure_entry attribute. This is a target-dependent attribute that only has sense for the thumbv8m Rust targets. You can find more information about this attribute here: https://developer.arm.com/documentation/ecm0359818/latest/ Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
2020-09-29Rewrite E0019 exampleDylan MacKenzie-4/+6
Inline assembly is now the only user of E0019. What is it doing that E0015 is not?
2020-09-25Rollup merge of #76973 - lzutao:unstably-const-assume, r=oli-obkJonas Schievink-4/+4
Unstably allow assume intrinsic in const contexts Not sure much about this usage because there are concerns about [blocking optimization][1] and [slowing down LLVM][2] when using `assme` intrinsic in inline functions. But since Oli suggested in https://github.com/rust-lang/rust/issues/76960#issuecomment-695772221, here we are. [1]: https://github.com/rust-lang/rust/pull/54995#issuecomment-429302709 [2]: https://github.com/rust-lang/rust/issues/49572#issuecomment-589615423