-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 17 pull requests #73475
Rollup of 17 pull requests #73475
Commits on May 20, 2020
-
Implement partial error recovery for
let
withBinOpEq
When parsing `let x: i8 += 1` the compiler interprets `i8` as a trait which makes it more complicated to do error recovery. More advanced error recovery is not implemented in this commit.
Configuration menu - View commit details
-
Copy full SHA for d4fe955 - Browse repository at this point
Copy the full SHA d4fe955View commit details -
Configuration menu - View commit details
-
Copy full SHA for 48ff12a - Browse repository at this point
Copy the full SHA 48ff12aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 05d6531 - Browse repository at this point
Copy the full SHA 05d6531View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6ad24ba - Browse repository at this point
Copy the full SHA 6ad24baView commit details
Commits on May 21, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 98532a3 - Browse repository at this point
Copy the full SHA 98532a3View commit details
Commits on May 26, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 591584e - Browse repository at this point
Copy the full SHA 591584eView commit details
Commits on May 28, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 3313bf6 - Browse repository at this point
Copy the full SHA 3313bf6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 358dc1d - Browse repository at this point
Copy the full SHA 358dc1dView commit details
Commits on May 30, 2020
-
Configuration menu - View commit details
-
Copy full SHA for f7d745f - Browse repository at this point
Copy the full SHA f7d745fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a6d03c - Browse repository at this point
Copy the full SHA 7a6d03cView commit details
Commits on Jun 4, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 1bc4e45 - Browse repository at this point
Copy the full SHA 1bc4e45View commit details
Commits on Jun 13, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 724dfba - Browse repository at this point
Copy the full SHA 724dfbaView commit details -
Make new type param suggestion more targetted
Do not suggest new type param when encountering a missing type in an ADT field with generic parameters. Fix rust-lang#72640.
Configuration menu - View commit details
-
Copy full SHA for 4606168 - Browse repository at this point
Copy the full SHA 4606168View commit details -
Note numeric literals that can never fit in an expected type
re rust-lang#72380 (comment) Given the toy code ```rust fn is_positive(n: usize) { n > -1_isize; } ``` We currently get a type mismatch error like the following: ``` error[E0308]: mismatched types --> src/main.rs:2:9 | 2 | n > -1_isize; | ^^^^^^^^ expected `usize`, found `isize` | help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit | 2 | n > (-1_isize).try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` But clearly, `-1` can never fit into a `usize`, so the suggestion will always panic. A more useful message would tell the user that the value can never fit in the expected type: ``` error[E0308]: mismatched types --> test.rs:2:9 | 2 | n > -1_isize; | ^^^^^^^^ expected `usize`, found `isize` | note: `-1_isize` can never fit into `usize` --> test.rs:2:9 | 2 | n > -1_isize; | ^^^^^^^^ ``` Which is what this commit implements. I only added this check for negative literals because - Currently we can only perform such a check for literals (constant value propagation is outside the scope of the typechecker at this point) - A lint error for out-of-range numeric literals is already emitted IMO it makes more sense to put this check in librustc_lint, but as far as I can tell the typecheck pass happens before the lint pass, so I've added it here. r? @estebank
Configuration menu - View commit details
-
Copy full SHA for afbbd38 - Browse repository at this point
Copy the full SHA afbbd38View commit details
Commits on Jun 14, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 2b936bb - Browse repository at this point
Copy the full SHA 2b936bbView commit details -
Add rust features to print target features
`crt-static` is a rust specific target feature that's absent from llvm feature table, adding it there.
Configuration menu - View commit details
-
Copy full SHA for e32db84 - Browse repository at this point
Copy the full SHA e32db84View commit details
Commits on Jun 15, 2020
-
Configuration menu - View commit details
-
Copy full SHA for f62903b - Browse repository at this point
Copy the full SHA f62903bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b7cacb - Browse repository at this point
Copy the full SHA 6b7cacbView commit details -
Configuration menu - View commit details
-
Copy full SHA for d23bedd - Browse repository at this point
Copy the full SHA d23beddView commit details -
Configuration menu - View commit details
-
Copy full SHA for ee810a7 - Browse repository at this point
Copy the full SHA ee810a7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 11b56fb - Browse repository at this point
Copy the full SHA 11b56fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for babda94 - Browse repository at this point
Copy the full SHA babda94View commit details -
Configuration menu - View commit details
-
Copy full SHA for e8e0a0e - Browse repository at this point
Copy the full SHA e8e0a0eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e51008 - Browse repository at this point
Copy the full SHA 9e51008View commit details -
Configuration menu - View commit details
-
Copy full SHA for 81c9094 - Browse repository at this point
Copy the full SHA 81c9094View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4e90f17 - Browse repository at this point
Copy the full SHA 4e90f17View commit details -
Configuration menu - View commit details
-
Copy full SHA for 921f35f - Browse repository at this point
Copy the full SHA 921f35fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e755889 - Browse repository at this point
Copy the full SHA e755889View commit details -
Configuration menu - View commit details
-
Copy full SHA for bc15790 - Browse repository at this point
Copy the full SHA bc15790View commit details -
Configuration menu - View commit details
-
Copy full SHA for 539e978 - Browse repository at this point
Copy the full SHA 539e978View commit details -
Configuration menu - View commit details
-
Copy full SHA for 31ea589 - Browse repository at this point
Copy the full SHA 31ea589View commit details -
Configuration menu - View commit details
-
Copy full SHA for 10d9bf1 - Browse repository at this point
Copy the full SHA 10d9bf1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 34d8692 - Browse repository at this point
Copy the full SHA 34d8692View commit details -
Configuration menu - View commit details
-
Copy full SHA for e31367d - Browse repository at this point
Copy the full SHA e31367dView commit details -
Configuration menu - View commit details
-
Copy full SHA for f7a1f97 - Browse repository at this point
Copy the full SHA f7a1f97View commit details -
Configuration menu - View commit details
-
Copy full SHA for bfe1434 - Browse repository at this point
Copy the full SHA bfe1434View commit details -
Configuration menu - View commit details
-
Copy full SHA for 10c8d2a - Browse repository at this point
Copy the full SHA 10c8d2aView commit details -
Expand "recursive opaque type" diagnostic
Fix rust-lang#70968, partially address rust-lang#66523.
Configuration menu - View commit details
-
Copy full SHA for 96f5584 - Browse repository at this point
Copy the full SHA 96f5584View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f12485 - Browse repository at this point
Copy the full SHA 8f12485View commit details -
Configuration menu - View commit details
-
Copy full SHA for 268decb - Browse repository at this point
Copy the full SHA 268decbView commit details -
Configuration menu - View commit details
-
Copy full SHA for e855b90 - Browse repository at this point
Copy the full SHA e855b90View commit details
Commits on Jun 16, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 0bcefd9 - Browse repository at this point
Copy the full SHA 0bcefd9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 302fb50 - Browse repository at this point
Copy the full SHA 302fb50View commit details -
Configuration menu - View commit details
-
Copy full SHA for 046165a - Browse repository at this point
Copy the full SHA 046165aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c5345f - Browse repository at this point
Copy the full SHA 6c5345fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 827ccf7 - Browse repository at this point
Copy the full SHA 827ccf7View commit details -
Configuration menu - View commit details
-
Copy full SHA for f0d3689 - Browse repository at this point
Copy the full SHA f0d3689View commit details -
Configuration menu - View commit details
-
Copy full SHA for cfdbbb5 - Browse repository at this point
Copy the full SHA cfdbbb5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4506a35 - Browse repository at this point
Copy the full SHA 4506a35View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f50f84 - Browse repository at this point
Copy the full SHA 9f50f84View commit details -
Configuration menu - View commit details
-
Copy full SHA for 457acbd - Browse repository at this point
Copy the full SHA 457acbdView commit details
Commits on Jun 17, 2020
-
Suggest new type param on single char ident
Suggest new type parameter on single char uppercase ident even if it doesn't appear in a field's type parameter. Address comment in rust-lang#72641.
Configuration menu - View commit details
-
Copy full SHA for af45d8a - Browse repository at this point
Copy the full SHA af45d8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for d7277df - Browse repository at this point
Copy the full SHA d7277dfView commit details -
Separate target features from rust ones with a blank line Co-authored-by: Josh Stone <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for caffb28 - Browse repository at this point
Copy the full SHA caffb28View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a89a33 - Browse repository at this point
Copy the full SHA 7a89a33View commit details -
Configuration menu - View commit details
-
Copy full SHA for b60cefe - Browse repository at this point
Copy the full SHA b60cefeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d1a380 - Browse repository at this point
Copy the full SHA 8d1a380View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14d385b - Browse repository at this point
Copy the full SHA 14d385bView commit details
Commits on Jun 18, 2020
-
Configuration menu - View commit details
-
Copy full SHA for e5c5df8 - Browse repository at this point
Copy the full SHA e5c5df8View commit details -
Configuration menu - View commit details
-
Copy full SHA for d134870 - Browse repository at this point
Copy the full SHA d134870View commit details -
Rollup merge of rust-lang#70551 - mark-i-m:ty-err-2, r=varkor
Make all uses of ty::Error delay a span bug r? @eddyb A second attempt at rust-lang#70245 resolves rust-lang#70866
Configuration menu - View commit details
-
Copy full SHA for d176448 - Browse repository at this point
Copy the full SHA d176448View commit details -
Rollup merge of rust-lang#71338 - estebank:recursive-impl-trait, r=ni…
…komatsakis Expand "recursive opaque type" diagnostic Fix rust-lang#70968, partially address rust-lang#66523.
Configuration menu - View commit details
-
Copy full SHA for 2e9e434 - Browse repository at this point
Copy the full SHA 2e9e434View commit details -
Rollup merge of rust-lang#71976 - mibac138:let-recovery, r=estebank
Improve diagnostics for `let x += 1` Fixes(?) rust-lang#66736 The code responsible for the `E0404` errors is [here](https://github.com/rust-lang/rust/blob/master/src/librustc_parse/parser/ty.rs#L399-L424) which I don't think can be easily modified to prevent emitting an error in one specific case. Because of this I couldn't get rid of `E0404` and instead added `E0067` along with a help message which will fix the problem. r? @estebank
Configuration menu - View commit details
-
Copy full SHA for 09ca6a4 - Browse repository at this point
Copy the full SHA 09ca6a4View commit details -
Rollup merge of rust-lang#72497 - RalfJung:tag-term, r=oli-obk
tag/niche terminology cleanup The term "discriminant" was used in two ways throughout the compiler: * every enum variant has a corresponding discriminant, that can be given explicitly with `Variant = N`. * that discriminant is then encoded in memory to store which variant is active -- but this encoded form of the discriminant was also often called "discriminant", even though it is conceptually quite different (e.g., it can be smaller in size, or even use niche-filling). After discussion with @eddyb, this renames the second term to "tag". The way the tag is encoded can be either `TagEncoding::Direct` (formerly `DiscriminantKind::Tag`) or `TagEncoding::Niche` (formerly `DiscrimianntKind::Niche`). This finally resolves some long-standing confusion I had about the handling of variant indices and discriminants, which surfaced in rust-lang#72419. (There is also a `DiscriminantKind` type in libcore, it remains unaffected. I think this corresponds to the discriminant, not the tag, so that seems all right.) r? @eddyb
Configuration menu - View commit details
-
Copy full SHA for 0a9ad17 - Browse repository at this point
Copy the full SHA 0a9ad17View commit details -
Rollup merge of rust-lang#72628 - MikailBag:array-default-tests, r=sh…
…epmaster Add tests for 'impl Default for [T; N]' Related: rust-lang#71690. This pull request adds two tests: - Even it T::default() panics, no leaks occur. - [T; 0] is Default even if T is not. I believe at some moment `Default` impl for arrays will be rewritten to use const generics instead of macros, and these tests will help to prevent behavior changes.
Configuration menu - View commit details
-
Copy full SHA for 538671b - Browse repository at this point
Copy the full SHA 538671bView commit details -
Rollup merge of rust-lang#72705 - Lucretiel:stdio-forwarding, r=Amanieu
Added io forwarding methods to the stdio structs Added methods to forward the `io::Read` and `io::Write` methods of the myriad wrapper structs in `stdio.rs` to their underlying readers / writers. This is especially important for the structs on the outside of a locking boundary, to ensure that the lock isn't being dropped and re-acquired in a loop.
Configuration menu - View commit details
-
Copy full SHA for 90a2403 - Browse repository at this point
Copy the full SHA 90a2403View commit details -
Rollup merge of rust-lang#72804 - estebank:opaque-missing-lts-in-fn-2…
…, r=nikomatsakis Further tweak lifetime errors involving `dyn Trait` and `impl Trait` in return position * Suggest substituting `'static` lifetime in impl/dyn `Trait + 'static` instead of `Trait + 'static + '_` * When `'static` is explicit, also suggest constraining argument with it * Reduce verbosity of suggestion message and mention lifetime in label * Tweak output for overlapping required/captured spans * Give these errors an error code Follow up to rust-lang#72543. r? @nikomatsakis
Configuration menu - View commit details
-
Copy full SHA for 32b4084 - Browse repository at this point
Copy the full SHA 32b4084View commit details -
Rollup merge of rust-lang#72814 - RalfJung:mir-visir-terminator, r=ol…
…i-obk remove visit_terminator_kind from MIR visitor For some reason, we had both `visit_terminator` and `visit_terminator_kind`. In contrast, for `Statement` we just have `visit_statement`. So this cleans things up by removing `visit_terminator_kind` and porting its users to `visit_terminator`.
Configuration menu - View commit details
-
Copy full SHA for be8fe77 - Browse repository at this point
Copy the full SHA be8fe77View commit details -
Rollup merge of rust-lang#72836 - poliorcetics:std-time-os-specificit…
…ies, r=shepmaster Complete the std::time documentation to warn about the inconsistencies between OS Fixes rust-lang#48980. I put the new documentation in `src/libstd/time.rs` at the module-level because it affects all types, even the one that are not directly system dependents if they are used with affected types, but there may be a better place for it.
Configuration menu - View commit details
-
Copy full SHA for f419606 - Browse repository at this point
Copy the full SHA f419606View commit details -
Rollup merge of rust-lang#72968 - integer32llc:docs-arrow-keys, r=Gui…
…llaumeGomez Only highlight doc search results via mouseover if mouse has moved ## What happens - Go to https://doc.rust-lang.org/stable/std/index.html - Put your mouse cursor somewhere in the middle where search results will appear and then don't move the mouse - Press 's' to focus the search box - Type a query that brings up enough search results to go under where your mouse cursor is - Press the down arrow - The search result that is one below where your mouse cursor is will be highlighted. ## What I expected When not currently using the mouse, I expect doing a search and then pressing the down arrow to always highlight the first search result immediately below the search box. ## The fix This feels a bit hacky to me; I'm open to other solutions. This introduces a global JS var that keeps track of whether the person searching has moved their mouse after doing a search or not, and only uses the mouse position to highlight search results if the person HAS moved the mouse AFTER doing a search.
Configuration menu - View commit details
-
Copy full SHA for 4641943 - Browse repository at this point
Copy the full SHA 4641943View commit details -
Rollup merge of rust-lang#73034 - doctorn:nomangle-inline-linkage, r=…
…matthewjasper Export `#[inline]` fns with extern indicators In ancient history (rust-lang#36280) we stopped `#[inline]` fns being codegened if they weren't used. However, - rust-lang#72944 - rust-lang#72463 observe that when writing something like ```rust #![crate_type = "cdylib"] #[no_mangle] #[inline] pub extern "C" fn foo() { // ... } ``` we really _do_ want `foo` to be codegened. This change makes this the case. Resolves rust-lang#72944, resolves rust-lang#72463 (and maybe some more)
Configuration menu - View commit details
-
Copy full SHA for 89825e2 - Browse repository at this point
Copy the full SHA 89825e2View commit details -
Rollup merge of rust-lang#73315 - GuillaumeGomez:clean-up-config-strs…
…, r=kinnison Clean up some weird command strings r? @kinnison
Configuration menu - View commit details
-
Copy full SHA for d315db4 - Browse repository at this point
Copy the full SHA d315db4View commit details -
Rollup merge of rust-lang#73320 - estebank:type-param-sugg-more, r=da…
…vidtwco Make new type param suggestion more targetted Do not suggest new type param when encountering a missing type in an ADT field with generic parameters. Fix rust-lang#72640.
Configuration menu - View commit details
-
Copy full SHA for 6717409 - Browse repository at this point
Copy the full SHA 6717409View commit details -
Rollup merge of rust-lang#73334 - ayazhafiz:err/num-type-cannot-fit, …
…r=estebank Note numeric literals that can never fit in an expected type re rust-lang#72380 (comment) Given the toy code ```rust fn is_positive(n: usize) { n > -1_isize; } ``` We currently get a type mismatch error like the following: ``` error[E0308]: mismatched types --> src/main.rs:2:9 | 2 | n > -1_isize; | ^^^^^^^^ expected `usize`, found `isize` | help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit | 2 | n > (-1_isize).try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` But clearly, `-1` can never fit into a `usize`, so the suggestion will always panic. A more useful message would tell the user that the value can never fit in the expected type: ``` error[E0308]: mismatched types --> test.rs:2:9 | 2 | n > -1_isize; | ^^^^^^^^ expected `usize`, found `isize` | note: `-1_isize` can never fit into `usize` --> test.rs:2:9 | 2 | n > -1_isize; | ^^^^^^^^ ``` Which is what this commit implements. I only added this check for negative literals because - Currently we can only perform such a check for literals (constant value propagation is outside the scope of the typechecker at this point) - A lint error for out-of-range numeric literals is already emitted IMO it makes more sense to put this check in librustc_lint, but as far as I can tell the typecheck pass happens before the lint pass, so I've added it here. r? @estebank
Configuration menu - View commit details
-
Copy full SHA for a2125e5 - Browse repository at this point
Copy the full SHA a2125e5View commit details -
Rollup merge of rust-lang#73346 - aszenz:patch-1, r=cuviper
Add rust specific features to print target features Fixes rust-lang#71583 `crt-static` is a rust specific target feature that's absent from llvm feature table, adding it there so that it shows under `rustc --print target-features`. Probably the most native implementation I could think of, would love to get feedback.
Configuration menu - View commit details
-
Copy full SHA for 8fa2f09 - Browse repository at this point
Copy the full SHA 8fa2f09View commit details -
Rollup merge of rust-lang#73464 - qy3u:fs-document-format-correction,…
… r=jonas-schievink Document format correction Minor amendments to the document. r? @steveklabnik
Configuration menu - View commit details
-
Copy full SHA for d8f6804 - Browse repository at this point
Copy the full SHA d8f6804View commit details -
Rollup merge of rust-lang#73465 - lzutao:spec-char-tostring, r=sfackler
Add specialization of `ToString for char` Closes rust-lang#73462
Configuration menu - View commit details
-
Copy full SHA for 67d5f65 - Browse repository at this point
Copy the full SHA 67d5f65View commit details