about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src
AgeCommit message (Collapse)AuthorLines
2021-02-09Update compiler/rustc_error_codes/src/error_codes/E0547.mdJesús Rubio-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2021-02-09Lost text re-addedJesus Rubio-0/+10
2021-02-08Add long explanation for E0547Jesus Rubio-1/+28
2021-02-07Auto merge of #80652 - calebzulawski:simd-lanes, r=nagisabors-5/+5
Improve SIMD type element count validation Resolves rust-lang/stdsimd#53. These changes are motivated by `stdsimd` moving in the direction of const generic vectors, e.g.: ```rust #[repr(simd)] struct SimdF32<const N: usize>([f32; N]); ``` This makes a few changes: * Establishes a maximum SIMD lane count of 2^16 (65536). This value is arbitrary, but attempts to validate lane count before hitting potential errors in the backend. It's not clear what LLVM's maximum lane count is, but cranelift's appears to be much less than `usize::MAX`, at least. * Expands some SIMD intrinsics to support arbitrary lane counts. This resolves the ICE in the linked issue. * Attempts to catch invalid-sized vectors during typeck when possible. Unresolved questions: * Generic-length vectors can't be validated in typeck and are only validated after monomorphization while computing layout. This "works", but the errors simply bail out with no context beyond the name of the type. Should these errors instead return `LayoutError` or otherwise provide context in some way? As it stands, users of `stdsimd` could trivially produce monomorphization errors by making zero-length vectors. cc `@bjorn3`
2021-02-07Rollup merge of #81835 - jesusprubio:improve-long-eplanation-e0546, ↵Guillaume Gomez-2/+9
r=GuillaumeGomez Improve long explanation for E0546 Helps with #61137
2021-02-06Typo fixJesus Rubio-2/+2
2021-02-06References addedJesus Rubio-2/+9
2021-02-06Comments updated to keep the consistencyJesus Rubio-5/+5
2021-02-06Improve long explanation for E0546Jesus Rubio-4/+4
2021-02-06Format fixesJesus Rubio-2/+1
2021-02-06Update compiler/rustc_error_codes/src/error_codes/E0542.mdJesús Rubio-1/+2
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2021-02-06Add long error explanation for E0542Jesus Rubio-1/+48
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-24Update docs with powers-of-twoCaleb Zulawski-5/+5
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); } ```