-
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
Rollup of 8 pull requests #118652
Rollup of 8 pull requests #118652
Commits on Nov 13, 2023
-
Configuration menu - View commit details
-
Copy full SHA for e6b135a - Browse repository at this point
Copy the full SHA e6b135aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 52143ff - Browse repository at this point
Copy the full SHA 52143ffView commit details
Commits on Nov 16, 2023
-
Provide context when
?
can't be called because ofResult<_, E>
When a method chain ending in `?` causes an E0277 because the expression's `Result::Err` variant doesn't have a type that can be converted to the `Result<_, E>` type parameter in the return type, provide additional context of which parts of the chain can and can't support the `?` operator. ``` error[E0277]: `?` couldn't convert the error to `String` --> $DIR/question-mark-result-err-mismatch.rs:28:25 | LL | fn bar() -> Result<(), String> { | ------------------ expected `String` because of this LL | let x = foo(); | ----- this can be annotated with `?` because it has type `Result<String, String>` LL | let one = x LL | .map(|s| ()) | ----------- this can be annotated with `?` because it has type `Result<(), String>` LL | .map_err(|_| ())?; | ---------------^ the trait `From<()>` is not implemented for `String` | | | this can't be annotated with `?` because it has type `Result<(), ()>` | = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait = help: the following other types implement trait `From<T>`: <String as From<char>> <String as From<Box<str>>> <String as From<Cow<'a, str>>> <String as From<&str>> <String as From<&mut str>> <String as From<&String>> = note: required for `Result<(), String>` to implement `FromResidual<Result<Infallible, ()>>` ``` Fix rust-lang#72124.
Configuration menu - View commit details
-
Copy full SHA for 2faaea9 - Browse repository at this point
Copy the full SHA 2faaea9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 276b74d - Browse repository at this point
Copy the full SHA 276b74dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e688742 - Browse repository at this point
Copy the full SHA e688742View commit details -
Configuration menu - View commit details
-
Copy full SHA for cc49398 - Browse repository at this point
Copy the full SHA cc49398View commit details -
Configuration menu - View commit details
-
Copy full SHA for d92c2b5 - Browse repository at this point
Copy the full SHA d92c2b5View commit details -
Configuration menu - View commit details
-
Copy full SHA for cce82d8 - Browse repository at this point
Copy the full SHA cce82d8View commit details
Commits on Nov 21, 2023
-
Configuration menu - View commit details
-
Copy full SHA for d1583eb - Browse repository at this point
Copy the full SHA d1583ebView commit details
Commits on Nov 22, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 74834a9 - Browse repository at this point
Copy the full SHA 74834a9View commit details
Commits on Dec 4, 2023
-
Give
Handler::fatal
andSession::fatal
the same return type.Currently, `Handler::fatal` returns `FatalError`. But `Session::fatal` returns `!`, because it calls `Handler::fatal` and then calls `raise` on the result. This inconsistency is unfortunate. This commit changes `Handler::fatal` to do the `raise` itself, changing its return type to `!`. This is safe because there are only two calls to `Handler::fatal`, one in `rustc_session` and one in `rustc_codegen_cranelift`, and they both call `raise` on the result. `HandlerInner::fatal` still returns `FatalError`, so I renamed it `fatal_no_raise` to emphasise the return type difference.
Configuration menu - View commit details
-
Copy full SHA for 114380d - Browse repository at this point
Copy the full SHA 114380dView commit details -
Inline and remove
DiagnosticBuilder::new_diagnostic_*
functions.They each have a single call site.
Configuration menu - View commit details
-
Copy full SHA for d4933aa - Browse repository at this point
Copy the full SHA d4933aaView commit details -
Inline and remove more
DiagnosticBuilder::new_diagnostic_*
functions.They each have a single call site. Note: the `make_diagnostic_builder` calls in `lib.rs` will be replaced in a subsequent commit.
Configuration menu - View commit details
-
Copy full SHA for ab640ca - Browse repository at this point
Copy the full SHA ab640caView commit details -
`sess` is a terribly misleading name for a `Handler`! This confused me for a bit.
Configuration menu - View commit details
-
Copy full SHA for 6a95dee - Browse repository at this point
Copy the full SHA 6a95deeView commit details -
Always use
G
forEmissionGuarantee
type variables.That's what is mostly used. This commit changes a few `EM` and `E` and `T` type variables to `G`.
Configuration menu - View commit details
-
Copy full SHA for ed95f39 - Browse repository at this point
Copy the full SHA ed95f39View commit details -
Avoid
Diagnostic::new_with_code(..., None, ...)
.`Diagnostic::new` can be used instead.
Configuration menu - View commit details
-
Copy full SHA for 32dc78e - Browse repository at this point
Copy the full SHA 32dc78eView commit details -
Configuration menu - View commit details
-
Copy full SHA for d51b3db - Browse repository at this point
Copy the full SHA d51b3dbView commit details -
De-genericize some
IntoDiagnostic
impls.These impls are all needed for just a single `IntoDiagnostic` type, not a family of them. Note that `ErrorGuaranteed` is the default type parameter for `IntoDiagnostic`.
Configuration menu - View commit details
-
Copy full SHA for b7e18ca - Browse repository at this point
Copy the full SHA b7e18caView commit details -
Use
DiagnosticBuilder::new
more.By making it generic, instead of only for `EmissionGuarantee = ()`, we can use it everywhere.
Configuration menu - View commit details
-
Copy full SHA for 8c20ad6 - Browse repository at this point
Copy the full SHA 8c20ad6View commit details -
Move some
HandlerInner
functions toHandler
.`Handler` is a wrapper around `HanderInner`. Some functions on on `Handler` just forward to the samed-named functions on `HandlerInner`. This commit removes as many of those as possible, implementing functions on `Handler` where possible, to avoid the boilerplate required for forwarding. The commit is moderately large but it's very mechanical.
Configuration menu - View commit details
-
Copy full SHA for a8ff867 - Browse repository at this point
Copy the full SHA a8ff867View commit details -
This is weird: `HandlerInner::emit` calls `HandlerInner::emit_diagnostic`, but only after doing a `treat-err-as-bug` check. Which is fine, *except* that there are multiple others paths for an `Error` or `Fatal` diagnostic to be passed to `HandlerInner::emit_diagnostic` without going through `HandlerInner::emit`, e.g. `Handler::span_err` call `Handler::emit_diag_at_span`, which calls `emit_diagnostic`. So that suggests that the coverage for `treat-err-as-bug` is incomplete. This commit removes `HandlerInner::emit` and moves the `treat-err-as-bug` check to `HandlerInner::emit_diagnostic`, so it cannot by bypassed.
Configuration menu - View commit details
-
Copy full SHA for 883bdb7 - Browse repository at this point
Copy the full SHA 883bdb7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ab05ca - Browse repository at this point
Copy the full SHA 3ab05caView commit details -
Inline and remove
fatal_no_raise
.This makes `Handler::fatal` more like `Handler::{err,warn,bug,note}`.
Configuration menu - View commit details
-
Copy full SHA for 7811c97 - Browse repository at this point
Copy the full SHA 7811c97View commit details -
Configuration menu - View commit details
-
Copy full SHA for d627e2a - Browse repository at this point
Copy the full SHA d627e2aView commit details
Commits on Dec 5, 2023
-
bootstrap(builder.rs): Don't explicitly warn against `semicolon_in_ex…
…pressions_from_macros` This already wasn't passed in bootstrap.py and the lint itself already warns-by-default for 2 years now and has already been added to the future-incompat group in Rust 1.68. See rust-lang#79813 for the tracking issue.
Configuration menu - View commit details
-
Copy full SHA for a0ba895 - Browse repository at this point
Copy the full SHA a0ba895View commit details -
Configuration menu - View commit details
-
Copy full SHA for 334577f - Browse repository at this point
Copy the full SHA 334577fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3448284 - Browse repository at this point
Copy the full SHA 3448284View commit details -
Configuration menu - View commit details
-
Copy full SHA for b97ff8e - Browse repository at this point
Copy the full SHA b97ff8eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f6c30b3 - Browse repository at this point
Copy the full SHA f6c30b3View commit details -
Rollup merge of rust-lang#116496 - estebank:question-method-chain-con…
…text, r=compiler-errors Provide context when `?` can't be called because of `Result<_, E>` When a method chain ending in `?` causes an E0277 because the expression's `Result::Err` variant doesn't have a type that can be converted to the `Result<_, E>` type parameter in the return type, provide additional context of which parts of the chain can and can't support the `?` operator. ``` error[E0277]: `?` couldn't convert the error to `String` --> $DIR/question-mark-result-err-mismatch.rs:27:25 | LL | fn bar() -> Result<(), String> { | ------------------ expected `String` because of this LL | let x = foo(); | ----- this has type `Result<_, String>` ... LL | .map_err(|_| ())?; | ---------------^ the trait `From<()>` is not implemented for `String` | | | this can't be annotated with `?` because it has type `Result<_, ()>` | = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait = help: the following other types implement trait `From<T>`: <String as From<char>> <String as From<Box<str>>> <String as From<Cow<'a, str>>> <String as From<&str>> <String as From<&mut str>> <String as From<&String>> = note: required for `Result<(), String>` to implement `FromResidual<Result<Infallible, ()>>` ``` Fix rust-lang#72124.
Configuration menu - View commit details
-
Copy full SHA for 9cce23a - Browse repository at this point
Copy the full SHA 9cce23aView commit details -
Rollup merge of rust-lang#116952 - compiler-errors:lifetime_capture_r…
…ules_2024, r=TaKO8Ki Implement 2024-edition lifetime capture rules RFC Implements rust-lang/rfcs#3498.
Configuration menu - View commit details
-
Copy full SHA for cfce6e1 - Browse repository at this point
Copy the full SHA cfce6e1View commit details -
Rollup merge of rust-lang#118123 - RalfJung:internal-lib-features, r=…
…compiler-errors Add support for making lib features internal We have the notion of an "internal" lang feature: a feature that is never intended to be stabilized, and using which can cause ICEs and other issues without that being considered a bug. This extends that idea to lib features as well. It is an alternative to rust-lang#115623: instead of using an attribute to declare lib features internal, we simply do this based on the name. Everything ending in `_internals` or `_internal` is considered internal. Then we rename `core_intrinsics` to `core_intrinsics_internal`, which fixes rust-lang#115597.
Configuration menu - View commit details
-
Copy full SHA for f366503 - Browse repository at this point
Copy the full SHA f366503View commit details -
Rollup merge of rust-lang#118268 - compiler-errors:pretty-print, r=es…
…tebank Pretty print `Fn<(..., ...)>` trait refs with parentheses (almost) always It's almost always better, at least in diagnostics, to print `Fn(i32, u32)` instead of `Fn<(i32, u32)>`. Related to but doesn't fix rust-lang#118225. That needs a separate fix.
Configuration menu - View commit details
-
Copy full SHA for 0d6e309 - Browse repository at this point
Copy the full SHA 0d6e309View commit details -
Rollup merge of rust-lang#118346 - compiler-errors:deeply-normalize-f…
…or-diagnostic, r=lcnr Add `deeply_normalize_for_diagnostics`, use it in coherence r? lcnr Normalize trait refs used for coherence error reporting with `-Ztrait-solver=next-coherence`. Two things: 1. I said before that we can't add this to `TyErrCtxt` because we compute `OverlapResult`s even if there are no diagnostics being emitted, e.g. for a reservation impl. 2. I didn't want to add this to an `InferCtxtExt` trait because I felt it was unnecessary. I don't particularly care about the API though.
Configuration menu - View commit details
-
Copy full SHA for a65f240 - Browse repository at this point
Copy the full SHA a65f240View commit details -
Rollup merge of rust-lang#118585 - sjwang05:issue-118564, r=compiler-…
…errors Fix parser ICE when recovering `dyn`/`impl` after `for<...>` Fixes rust-lang#118564
Configuration menu - View commit details
-
Copy full SHA for c87f5b8 - Browse repository at this point
Copy the full SHA c87f5b8View commit details -
Rollup merge of rust-lang#118587 - nnethercote:cleanup-error-handlers…
…-2, r=compiler-errors Cleanup error handlers some more A sequel to rust-lang#118470. r? `@compiler-errors`
Configuration menu - View commit details
-
Copy full SHA for 7c09391 - Browse repository at this point
Copy the full SHA 7c09391View commit details -
Rollup merge of rust-lang#118642 - Xanewok:patch-1, r=clubby789
bootstrap(builder.rs): Don't explicitly warn against `semicolon_in_expressions_from_macros` This already wasn't passed in bootstrap.py and the lint itself already warns-by-default for 2 years now and has already been added to the future-incompat group in Rust 1.68. See rust-lang#79813 for the tracking issue.
Configuration menu - View commit details
-
Copy full SHA for d3dfbd8 - Browse repository at this point
Copy the full SHA d3dfbd8View commit details