-
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 9 pull requests #121982
Rollup of 9 pull requests #121982
Commits on Feb 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d0873c7 - Browse repository at this point
Copy the full SHA d0873c7View commit details
Commits on Mar 3, 2024
-
Use root obligation on E0277 for some cases
When encountering trait bound errors that satisfy some heuristics that tell us that the relevant trait for the user comes from the root obligation and not the current obligation, we use the root predicate for the main message. This allows to talk about "X doesn't implement Pattern<'_>" over the most specific case that just happened to fail, like "char doesn't implement Fn(&mut char)" in `tests/ui/traits/suggest-dereferences/root-obligation.rs` The heuristics are: - the type of the leaf predicate is (roughly) the same as the type from the root predicate, as a proxy for "we care about the root" - the leaf trait and the root trait are different, so as to avoid talking about `&mut T: Trait` and instead remain talking about `T: Trait` instead - the root trait is not `Unsize`, as to avoid talking about it in `tests/ui/coercion/coerce-issue-49593-box-never.rs`. ``` error[E0277]: the trait bound `&char: Pattern<'_>` is not satisfied --> $DIR/root-obligation.rs:6:38 | LL | .filter(|c| "aeiou".contains(c)) | -------- ^ the trait `Fn<(char,)>` is not implemented for `&char`, which is required by `&char: Pattern<'_>` | | | required by a bound introduced by this call | = note: required for `&char` to implement `FnOnce<(char,)>` = note: required for `&char` to implement `Pattern<'_>` note: required by a bound in `core::str::<impl str>::contains` --> $SRC_DIR/core/src/str/mod.rs:LL:COL help: consider dereferencing here | LL | .filter(|c| "aeiou".contains(*c)) | + ``` Fix rust-lang#79359, fix rust-lang#119983, fix rust-lang#118779, cc rust-lang#118415 (the suggestion needs to change).
Configuration menu - View commit details
-
Copy full SHA for f0c9311 - Browse repository at this point
Copy the full SHA f0c9311View commit details -
Be more lax in
.into_iter()
suggestion when encounteringIterator
…… methods on non-`Iterator` ``` error[E0599]: no method named `map` found for struct `Vec<bool>` in the current scope --> $DIR/vec-on-unimplemented.rs:3:23 | LL | vec![true, false].map(|v| !v).collect::<Vec<_>>(); | ^^^ `Vec<bool>` is not an iterator | help: call `.into_iter()` first | LL | vec![true, false].into_iter().map(|v| !v).collect::<Vec<_>>(); | ++++++++++++ ``` We used to provide some help through `rustc_on_unimplemented` on non-`impl Trait` and non-type-params, but this lets us get rid of some otherwise unnecessary conditions in the annotation on `Iterator`.
Configuration menu - View commit details
-
Copy full SHA for 89a3c19 - Browse repository at this point
Copy the full SHA 89a3c19View commit details -
Configuration menu - View commit details
-
Copy full SHA for 40f9dcc - Browse repository at this point
Copy the full SHA 40f9dccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f29740 - Browse repository at this point
Copy the full SHA 2f29740View commit details -
Configuration menu - View commit details
-
Copy full SHA for d4b95eb - Browse repository at this point
Copy the full SHA d4b95ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 84d7ba0 - Browse repository at this point
Copy the full SHA 84d7ba0View commit details -
Configuration menu - View commit details
-
Copy full SHA for e1e02a2 - Browse repository at this point
Copy the full SHA e1e02a2View commit details
Commits on Mar 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 25e56de - Browse repository at this point
Copy the full SHA 25e56deView commit details -
Removing absolute path in proc-macro
With rust 1.75 the absolute build path is embedding into '.rustc' section and which causes reproducibility issues. Detailed issue is here. rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format.
Configuration menu - View commit details
-
Copy full SHA for a9a9798 - Browse repository at this point
Copy the full SHA a9a9798View commit details -
Extract an arguments struct for
Builder::then_else_break
Most of this method's arguments are usually or always forwarded as-is to recursive invocations. Wrapping them in a dedicated struct allows us to document each struct field, and lets us use struct-update syntax to indicate which arguments are being modified when making a recursive call.
Configuration menu - View commit details
-
Copy full SHA for 4146136 - Browse repository at this point
Copy the full SHA 4146136View commit details -
Don't run test_get_os_named_thread on win7
This test won't work on windows 7, as the Thread::set_name function is not implemented there (win7 does not provide a documented mechanism to set thread names).
Configuration menu - View commit details
-
Copy full SHA for 9eb927e - Browse repository at this point
Copy the full SHA 9eb927eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 05e68fa - Browse repository at this point
Copy the full SHA 05e68faView commit details -
Configuration menu - View commit details
-
Copy full SHA for 640e99c - Browse repository at this point
Copy the full SHA 640e99cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e6e140 - Browse repository at this point
Copy the full SHA 5e6e140View commit details -
Rollup merge of rust-lang#120976 - matthiaskrgr:constify_TL_statics, …
…r=lcnr constify a couple thread_local statics
Configuration menu - View commit details
-
Copy full SHA for 8a3dc83 - Browse repository at this point
Copy the full SHA 8a3dc83View commit details -
Rollup merge of rust-lang#121576 - Jarcho:visitor3, r=oli-obk
Convert the rest of the visitors to use `VisitorResult` Continuing from rust-lang#121256.
Configuration menu - View commit details
-
Copy full SHA for 3c16447 - Browse repository at this point
Copy the full SHA 3c16447View commit details -
Rollup merge of rust-lang#121826 - estebank:e0277-root-obligation-2, …
…r=oli-obk Use root obligation on E0277 for some cases When encountering trait bound errors that satisfy some heuristics that tell us that the relevant trait for the user comes from the root obligation and not the current obligation, we use the root predicate for the main message. This allows to talk about "X doesn't implement Pattern<'_>" over the most specific case that just happened to fail, like "char doesn't implement Fn(&mut char)" in `tests/ui/traits/suggest-dereferences/root-obligation.rs` The heuristics are: - the type of the leaf predicate is (roughly) the same as the type from the root predicate, as a proxy for "we care about the root" - the leaf trait and the root trait are different, so as to avoid talking about `&mut T: Trait` and instead remain talking about `T: Trait` instead - the root trait is not `Unsize`, as to avoid talking about it in `tests/ui/coercion/coerce-issue-49593-box-never.rs`. ``` error[E0277]: the trait bound `&char: Pattern<'_>` is not satisfied --> $DIR/root-obligation.rs:6:38 | LL | .filter(|c| "aeiou".contains(c)) | -------- ^ the trait `Fn<(char,)>` is not implemented for `&char`, which is required by `&char: Pattern<'_>` | | | required by a bound introduced by this call | = note: required for `&char` to implement `FnOnce<(char,)>` = note: required for `&char` to implement `Pattern<'_>` note: required by a bound in `core::str::<impl str>::contains` --> $SRC_DIR/core/src/str/mod.rs:LL:COL help: consider dereferencing here | LL | .filter(|c| "aeiou".contains(*c)) | + ``` Fix rust-lang#79359, fix rust-lang#119983, fix rust-lang#118779, cc rust-lang#118415 (the suggestion needs to change), cc rust-lang#121398 (doesn't fix the underlying issue).
Configuration menu - View commit details
-
Copy full SHA for 41733ae - Browse repository at this point
Copy the full SHA 41733aeView commit details -
Rollup merge of rust-lang#121928 - Zalathar:then-else-args, r=Nadrieril
Extract an arguments struct for `Builder::then_else_break` Most of this method's arguments are usually or always forwarded as-is to recursive invocations. Wrapping them in a dedicated struct allows us to document each struct field, and lets us use struct-update syntax to indicate which arguments are being modified when making a recursive call. --- While trying to understand the lowering of `if` expressions, I found it difficult to keep track of the half-dozen arguments passed through to every call to `then_else_break`. I tried switching over to an arguments struct, and I found that it really helps to make sense of what each argument does, and how each call is modifying the arguments. I have some further ideas for how to streamline these recursive calls, but I've kept those out of this PR so that it's a pure refactoring with no behavioural changes.
Configuration menu - View commit details
-
Copy full SHA for 9896348 - Browse repository at this point
Copy the full SHA 9896348View commit details -
Rollup merge of rust-lang#121958 - chenyukang:yukang-fix-121915-impor…
…t, r=pnkfelix Fix redundant import errors for preload extern crate Fixes rust-lang#121915
Configuration menu - View commit details
-
Copy full SHA for 85f3738 - Browse repository at this point
Copy the full SHA 85f3738View commit details -
Rollup merge of rust-lang#121959 - sundeep-kokkonda:patch-2, r=davidtwco
Removing absolute path in proc-macro With rust 1.75 the absolute build path name is embedding into proc-macro (.rustc section) and which causes reproducibility issues. Detailed issue description is here - rust-lang#120825 (comment) With this change the 'absolute path' changed back to '/rust/$hash' format as in earlier revisions.
Configuration menu - View commit details
-
Copy full SHA for f43a115 - Browse repository at this point
Copy the full SHA f43a115View commit details -
Rollup merge of rust-lang#121968 - roblabla:fix-win7, r=jhpratt
Don't run test_get_os_named_thread on win7 This test won't work on windows 7, as the Thread::set_name function is not implemented there (win7 does not provide a documented mechanism to set thread names).
Configuration menu - View commit details
-
Copy full SHA for 17709c0 - Browse repository at this point
Copy the full SHA 17709c0View commit details -
Rollup merge of rust-lang#121977 - Lee-Janggun:master, r=WaffleLapkin
Doc: Fix incorrect reference to integer in Atomic{Ptr,Bool}::as_ptr. I am assuming "resulting integer" is an error, since we are talking about pointers and booleans here. Seems like it was missed while copy & pasting the docs from the integer versions. I also checked the rest of the docs, and this was the only mention of integers.
Configuration menu - View commit details
-
Copy full SHA for 9cb0cba - Browse repository at this point
Copy the full SHA 9cb0cbaView commit details -
Rollup merge of rust-lang#121978 - GuillaumeGomez:dylib-duplicated-pa…
…th, r=bjorn3 Fix duplicated path in the "not found dylib" error While working on the gcc backend, I couldn't figure out why I had this error: ``` error: couldn't load codegen backend /checkout/compiler/rustc_codegen_gcc/target/release/librustc_codegen_gcc.so/checkout/compiler/rustc_codegen_gcc/target/release/librustc_codegen_gcc.so: cannot open shared object file: No such file or directory ``` As you can see, the path is duplicated for some reason. After investigating a bit more, I realized that `libloading::Error::LoadLibraryExW` starts with the path of the not found dylib, making it appear twice in our error afterward (because we do render it like this: `{path}{err}`, and since the `err` starts with the path...). Thanks to `@bjorn3` for linking me to rust-lang#121392. :)
Configuration menu - View commit details
-
Copy full SHA for 64bee84 - Browse repository at this point
Copy the full SHA 64bee84View commit details