-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add lint for never type regressions #68350
Closed
Closed
Commits on Jan 17, 2020
-
Configuration menu - View commit details
-
Copy full SHA for da33dc0 - Browse repository at this point
Copy the full SHA da33dc0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c49893 - Browse repository at this point
Copy the full SHA 0c49893View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a22be9 - Browse repository at this point
Copy the full SHA 3a22be9View commit details -
Configuration menu - View commit details
-
Copy full SHA for d0dc1e3 - Browse repository at this point
Copy the full SHA d0dc1e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for ebf1918 - Browse repository at this point
Copy the full SHA ebf1918View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5253bb6 - Browse repository at this point
Copy the full SHA 5253bb6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 087af85 - Browse repository at this point
Copy the full SHA 087af85View commit details -
Configuration menu - View commit details
-
Copy full SHA for 932d7c2 - Browse repository at this point
Copy the full SHA 932d7c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 10cd2e3 - Browse repository at this point
Copy the full SHA 10cd2e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for a8ce823 - Browse repository at this point
Copy the full SHA a8ce823View commit details -
Configuration menu - View commit details
-
Copy full SHA for 65318da - Browse repository at this point
Copy the full SHA 65318daView commit details -
Configuration menu - View commit details
-
Copy full SHA for 61b879c - Browse repository at this point
Copy the full SHA 61b879cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c5691a8 - Browse repository at this point
Copy the full SHA c5691a8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ed39bc - Browse repository at this point
Copy the full SHA 1ed39bcView commit details
Commits on Jan 18, 2020
-
Configuration menu - View commit details
-
Copy full SHA for d4bd422 - Browse repository at this point
Copy the full SHA d4bd422View commit details -
Configuration menu - View commit details
-
Copy full SHA for f1961b5 - Browse repository at this point
Copy the full SHA f1961b5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 643a708 - Browse repository at this point
Copy the full SHA 643a708View commit details
Commits on Jan 19, 2020
-
Configuration menu - View commit details
-
Copy full SHA for a81c513 - Browse repository at this point
Copy the full SHA a81c513View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9eb803a - Browse repository at this point
Copy the full SHA 9eb803aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 78a831f - Browse repository at this point
Copy the full SHA 78a831fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3aefe61 - Browse repository at this point
Copy the full SHA 3aefe61View commit details -
Configuration menu - View commit details
-
Copy full SHA for 409e8d7 - Browse repository at this point
Copy the full SHA 409e8d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 39af896 - Browse repository at this point
Copy the full SHA 39af896View commit details -
Add explicit type annotations for
vec.push(break)
testThis code was being correctly matched by the never-type fallback lint. In this case, the fallback is actually safe - constructing a `Vec<!>` is perfectly fine. However, the lint doesn't know that - without knowing about the inner details of `Vec`, there's no way of knowing that changing `Vec::<()>::new()` to `Vec::<!>::new()` is safe. I think this should be sufficiently rare in practice as to not be an issue. If a Vec<_> gets inferred to Vec<!> due to fallback, you must have never pushed anything to it (or else fallback would not have run due to the type variable being constrained). If the error does come up, adding type annotations is sufficient to fix the problem - using `Vec<()>`, `Vec<!> or (before the `!` type is stabilized) `Vec<std::convert::Infallible`, or really any type, will work. Alternatively, we might consider special-casing some (or all) safe methods in `libcore` and `libstd`, as fallback should never cause an issue with them.
Configuration menu - View commit details
-
Copy full SHA for c82ea60 - Browse repository at this point
Copy the full SHA c82ea60View commit details
Commits on Jan 26, 2020
-
Configuration menu - View commit details
-
Copy full SHA for fe77a00 - Browse repository at this point
Copy the full SHA fe77a00View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.