-
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 #130964
Rollup of 8 pull requests #130964
Commits on Sep 23, 2024
-
Configuration menu - View commit details
-
Copy full SHA for ba3b536 - Browse repository at this point
Copy the full SHA ba3b536View commit details -
Configuration menu - View commit details
-
Copy full SHA for 04710e2 - Browse repository at this point
Copy the full SHA 04710e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for bf76888 - Browse repository at this point
Copy the full SHA bf76888View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b8a66c - Browse repository at this point
Copy the full SHA 4b8a66cView commit details -
Configuration menu - View commit details
-
Copy full SHA for d77664b - Browse repository at this point
Copy the full SHA d77664bView commit details
Commits on Sep 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d4ee408 - Browse repository at this point
Copy the full SHA d4ee408View commit details -
Configuration menu - View commit details
-
Copy full SHA for fa3215d - Browse repository at this point
Copy the full SHA fa3215dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0bf9289 - Browse repository at this point
Copy the full SHA 0bf9289View commit details -
rustdoc: update
ProcMacro
docs section on helper attributesI believe the mention of attribute macros in the section on proc macro helper attributes is erroneous. As far as I can tell, attribute macros cannot define helper attributes. The following attribute macro is not valid (fails to build), no matter how I try to define (or skip defining) the helpers: ```rust #[proc_macro_attribute(attributes(helper))] pub fn attribute_helpers(_attr: TokenStream, item: TokenStream) -> TokenStream { item } ``` The [language reference](https://doc.rust-lang.org/reference/procedural-macros.html#attribute-macros) also doesn't seem to mention attribute macro helpers. The helpers subsection is inside the section on derive macros.
Configuration menu - View commit details
-
Copy full SHA for 3b9db47 - Browse repository at this point
Copy the full SHA 3b9db47View commit details -
Revert "ci: Try to remove unused Xcode dirs"
This reverts commit 06f49f6.
Configuration menu - View commit details
-
Copy full SHA for 282d044 - Browse repository at this point
Copy the full SHA 282d044View commit details -
Partially revert "ci: Use mv instead of cp in upload step"
This partially reverts commit fe7c97c. I kept a mv, not a cp, for the one that shuffles major artifacts around, because the size of those artifacts are big enough to matter, sometimes. I don't think the diagnostic info will be that heavy, by comparison.
Configuration menu - View commit details
-
Copy full SHA for a2a4ea0 - Browse repository at this point
Copy the full SHA a2a4ea0View commit details -
add even more tests for ptr-to-ptr casts on trait objects
Lukas Markeffsky committedSep 27, 2024 Configuration menu - View commit details
-
Copy full SHA for 8302f2e - Browse repository at this point
Copy the full SHA 8302f2eView commit details -
borrowck: use subtyping instead of equality for ptr-to-ptr casts
Lukas Markeffsky committedSep 27, 2024 Configuration menu - View commit details
-
Copy full SHA for 53f45c4 - Browse repository at this point
Copy the full SHA 53f45c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4fb097a - Browse repository at this point
Copy the full SHA 4fb097aView commit details -
Configuration menu - View commit details
-
Copy full SHA for d753aba - Browse repository at this point
Copy the full SHA d753abaView commit details -
Configuration menu - View commit details
-
Copy full SHA for bcf8cf2 - Browse repository at this point
Copy the full SHA bcf8cf2View commit details -
Configuration menu - View commit details
-
Copy full SHA for a1fbf25 - Browse repository at this point
Copy the full SHA a1fbf25View commit details -
Configuration menu - View commit details
-
Copy full SHA for 19d5568 - Browse repository at this point
Copy the full SHA 19d5568View commit details
Commits on Sep 28, 2024
-
Rollup merge of rust-lang#125404 - a1phyr:fix-read_buf-uses, r=workin…
…gjubilee Fix `read_buf` uses in `std` Following lib-team decision here: rust-lang#78485 (comment) Guard against the pathological behavior of both returning an error and performing a read.
Configuration menu - View commit details
-
Copy full SHA for 6e9db86 - Browse repository at this point
Copy the full SHA 6e9db86View commit details -
Rollup merge of rust-lang#130866 - compiler-errors:dyn-instantiate-bi…
…nder, r=lcnr Allow instantiating object trait binder when upcasting This PR fixes two bugs (that probably need an FCP). ### We use equality rather than subtyping for upcasting dyn conversions This code should be valid: ```rust #![feature(trait_upcasting)] trait Foo: for<'h> Bar<'h> {} trait Bar<'a> {} fn foo(x: &dyn Foo) { let y: &dyn Bar<'static> = x; } ``` But instead: ``` error[E0308]: mismatched types --> src/lib.rs:7:32 | 7 | let y: &dyn Bar<'static> = x; | ^ one type is more general than the other | = note: expected existential trait ref `for<'h> Bar<'h>` found existential trait ref `Bar<'_>` ``` And so should this: ```rust #![feature(trait_upcasting)] fn foo(x: &dyn for<'h> Fn(&'h ())) { let y: &dyn FnOnce(&'static ()) = x; } ``` But instead: ``` error[E0308]: mismatched types --> src/lib.rs:4:39 | 4 | let y: &dyn FnOnce(&'static ()) = x; | ^ one type is more general than the other | = note: expected existential trait ref `for<'h> FnOnce<(&'h (),)>` found existential trait ref `FnOnce<(&(),)>` ``` Specifically, both of these fail because we use *equality* when comparing the supertrait to the *target* of the unsize goal. For the first example, since our supertrait is `for<'h> Bar<'h>` but our target is `Bar<'static>`, there's a higher-ranked type mismatch even though we *should* be able to instantiate that supertrait binder when upcasting. Similarly for the second example. ### New solver uses equality rather than subtyping for no-op (i.e. non-upcasting) dyn conversions This code should be valid in the new solver, like it is with the old solver: ```rust // -Znext-solver fn foo<'a>(x: &mut for<'h> dyn Fn(&'h ())) { let _: &mut dyn Fn(&'a ()) = x; } ``` But instead: ``` error: lifetime may not live long enough --> <source>:2:11 | 1 | fn foo<'a>(x: &mut dyn for<'h> Fn(&'h ())) { | -- lifetime `'a` defined here 2 | let _: &mut dyn Fn(&'a ()) = x; | ^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static` | = note: requirement occurs because of a mutable reference to `dyn Fn(&())` ``` Specifically, this fails because we try to coerce `&mut dyn for<'h> Fn(&'h ())` to `&mut dyn Fn(&'a ())`, which registers an `dyn for<'h> Fn(&'h ()): dyn Fn(&'a ())` goal. This fails because the new solver uses *equating* rather than *subtyping* in `Unsize` goals. This is *mostly* not a problem... You may wonder why the same code passes on the new solver for immutable references: ``` // -Znext-solver fn foo<'a>(x: &dyn Fn(&())) { let _: &dyn Fn(&'a ()) = x; // works } ``` That's because in this case, we first try to coerce via `Unsize`, but due to the leak check the goal fails. Then, later in coercion, we fall back to a simple subtyping operation, which *does* work. Since `&T` is covariant over `T`, but `&mut T` is invariant, that's where the discrepancy between these two examples crops up. --- r? lcnr or reassign :D
Configuration menu - View commit details
-
Copy full SHA for 4e510da - Browse repository at this point
Copy the full SHA 4e510daView commit details -
Rollup merge of rust-lang#130922 - tyilo:udp-unspecified, r=ibraheemdev
Reference UNSPECIFIED instead of INADDR_ANY in join_multicast_v4
Configuration menu - View commit details
-
Copy full SHA for 9c4b81c - Browse repository at this point
Copy the full SHA 9c4b81cView commit details -
Rollup merge of rust-lang#130924 - surechen:fix_130851, r=compiler-er…
…rors Make clashing_extern_declarations considering generic args for ADT field In following example, G<u16> should be recognized as different from G<u32> : ```rust #[repr(C)] pub struct G<T> { g: [T; 4] } pub mod x { extern "C" { pub fn g(_: super::G<u16>); } } pub mod y { extern "C" { pub fn g(_: super::G<u32>); } } ``` fixes rust-lang#130851
Configuration menu - View commit details
-
Copy full SHA for 2df6b07 - Browse repository at this point
Copy the full SHA 2df6b07View commit details -
Rollup merge of rust-lang#130939 - obi1kenobi:patch-2, r=aDotInTheVoid
rustdoc: update `ProcMacro` docs section on helper attributes I believe the mention of attribute macros in the section on proc macro helper attributes is erroneous. As far as I can tell, attribute macros cannot define helper attributes. The following attribute macro is not valid (fails to build), no matter how I try to define (or skip defining) the helpers: ```rust #[proc_macro_attribute(attributes(helper))] pub fn attribute_helpers(_attr: TokenStream, item: TokenStream) -> TokenStream { item } ``` The [language reference](https://doc.rust-lang.org/reference/procedural-macros.html#attribute-macros) also doesn't seem to mention attribute macro helpers. The helpers subsection is inside the section on derive macros.
Configuration menu - View commit details
-
Copy full SHA for 7e32221 - Browse repository at this point
Copy the full SHA 7e32221View commit details -
Rollup merge of rust-lang#130940 - workingjubilee:remove-space-saving…
…-operations, r=Kobzol Revert space-saving operations The "all of our artifacts" `mv` seems like it may save enough space to matter sometimes, since it can range up to a gigabyte of difference, if memory serves. For the rest, I think we're good. try-job: dist-aarch64-apple
Configuration menu - View commit details
-
Copy full SHA for 6b5cd4e - Browse repository at this point
Copy the full SHA 6b5cd4eView commit details -
Rollup merge of rust-lang#130944 - lukas-code:ptr-ptr-sub, r=compiler…
…-errors Allow instantiating trait object binder in ptr-to-ptr casts For unsizing coercions between trait objects with the same principal, we already allow instantiating the for binder. For example, coercing `Box<dyn for<'a> Trait<'a>` to `Box<dyn Trait<'static>>` is allowed. Since ptr-to-ptr casts will insert an unsizing coercion before the cast if possible, this has the consequence that the following compiles already: ```rust // This compiles today. fn cast<'b>(x: *mut dyn for<'a> Trait<'a>) -> *mut dyn Trait<'b> { // lowered as (roughly) // tmp: *mut dyn Trait<'?0> = Unsize(x) // requires dyn for<'a> Trait<'a> <: dyn Trait<'?0> // ret: *mut dyn Trait<'b> = PtrToPtr(tmp) // requires dyn Trait<'?0> == dyn Trait<'b> x as _ } ``` However, if no unsizing coercion is inserted then this currently fails to compile as one type is more general than the other. This PR will allow this code to compile, too, by changing ptr-to-ptr casts of pointers with vtable metadata to use sutyping instead of type equality. ```rust // This will compile after this PR. fn cast<'b>(x: *mut dyn for<'a> Trait<'a>) -> *mut Wrapper<dyn Trait<'b>> { // lowered as (roughly) // no Unsize here! // ret: *mut Wrapper<dyn Trait<'b>> = PtrToPtr(x) // requires dyn for<'a> Trait<'a> == dyn Trait<'b> x as _ } ``` Note that it is already possible to work around the current restrictions and make the code compile before this PR by splitting the cast in two, so this shouldn't allow a new class of programs to compile: ```rust // Workaround that compiles today. fn cast<'b>(x: *mut dyn for<'a> Trait<'a>) -> *mut Wrapper<dyn Trait<'b>> { x as *mut dyn Trait<'_> as _ } ``` r? `@compiler-errors` cc `@WaffleLapkin`
Configuration menu - View commit details
-
Copy full SHA for 58d0730 - Browse repository at this point
Copy the full SHA 58d0730View commit details -
Rollup merge of rust-lang#130953 - workingjubilee:rename-a-few-ctypes…
…-tests, r=fee1-dead Rename a few tests to make tidy happier A somewhat random smattering of tests that I have recently looked at, and thus had cause to research and write down the reason for their existence.
Configuration menu - View commit details
-
Copy full SHA for 5d7db93 - Browse repository at this point
Copy the full SHA 5d7db93View commit details