- 01 9月, 2021 2 次提交
-
-
由 bors 提交于
Fix loading large rlibs Bumps object crate to permit parsing archives with 64-bit table entries. These are primarily encountered when there's more than 4GB of archive data. cc https://github.com/gimli-rs/object/issues/365 Helps with https://github.com/rust-lang/rust/issues/88351, but will also need a beta backport r? `@ehuss` (mostly for the test)
-
由 bors 提交于
Rollup of 10 pull requests Successful merges: - #85017 (Add carrying_add, borrowing_sub, widening_mul, carrying_mul methods to integers) - #86362 (Avoid cloning LocalDecls) - #88391 (Fix json tuple struct enum variant ) - #88399 (Disallow the aapcs CC on Aarch64) - #88418 (Allow `~const` bounds on trait assoc functions) - #88445 (Clean up the lowering of AST items) - #88495 (Add `TcpStream::set_linger` and `TcpStream::linger`) - #88501 (Use right span in prelude collision suggestions with macros. ) - #88504 (Keep turbofish in prelude collision lint.) - #88524 (Remove unnecessary `mut` from udp doctests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
- 31 8月, 2021 38 次提交
-
-
由 Mara Bos 提交于
Remove unnecessary `mut` from udp doctests I don't think this `mut` is necessary, since both `recv_from` and `send_to` take `&self`.
-
由 Mara Bos 提交于
Keep turbofish in prelude collision lint. Fixes https://github.com/rust-lang/rust/issues/88442
-
由 Mara Bos 提交于
Use right span in prelude collision suggestions with macros. Fixes https://github.com/rust-lang/rust/issues/88347 r? `@estebank`
-
由 Mara Bos 提交于
Add `TcpStream::set_linger` and `TcpStream::linger` Adds methods for getting/setting the `SO_LINGER` option on TCP sockets. Behavior is consistent across Unix and Windows. r? `@joshtriplett` (I noticed you've been reviewing net related PRs)
-
由 Mara Bos 提交于
Clean up the lowering of AST items This PR simplifies and improves `rustc_ast_lowering::item` in various minor ways. The reasons for the changes should mostly be self evident, though I'm happy to specifically explain anything if needed. These changes used to be part of #88019, but I removed them after it was pointed out that some of my other changes to `rustc_ast_lowering` were unnecessary. It felt like a bad idea to clean up code which I didn't even need to touch anymore. r? `@cjgillot`
-
由 Mara Bos 提交于
Allow `~const` bounds on trait assoc functions r? `@oli-obk`
-
由 Mara Bos 提交于
Disallow the aapcs CC on Aarch64 This never really worked and makes LLVM assert.
-
由 Mara Bos 提交于
Fix json tuple struct enum variant Fixes #87887. cc `@dsherret` `@camelid` r? `@notriddle`
-
由 Mara Bos 提交于
Avoid cloning LocalDecls
-
由 Mara Bos 提交于
Add carrying_add, borrowing_sub, widening_mul, carrying_mul methods to integers This comes in part from my own attempts to make (crude) big integer implementations, and also due to the stalled discussion in [RFC 2417](https://github.com/rust-lang/rfcs/pull/2417). My understanding is that changes like these are best offered directly as code and then an RFC can be opened if there needs to be more discussion before stabilisation. Since all of these methods are unstable from the start, I figured I might as well offer them now. I tried looking into intrinsics, messed around with a few different implementations, and ultimately concluded that these are "good enough" implementations for now to at least put up some code and maybe start bikeshedding on a proper API for these. For the `carrying_add` and `borrowing_sub`, I tried looking into potential architecture-specific code and realised that even using the LLVM intrinsics for `addcarry` and `subborrow` on x86 specifically, I was getting exactly the same assembly as the naive implementation using `overflowing_add` and `overflowing_sub`, although the LLVM IR did differ because of the architecture-specific code. Longer-term I think that they would be best suited to specific intrinsics as that would make optimisations easier (instructions like add-carry tend to use implicit flags, and thus can only be optimised if they're done one-after-another, and thus it would make the most sense to have compact intrinsics that can be merged together easily). For `widening_mul` and `carrying_mul`, for now at least, I simply cast to the larger type and perform arithmetic that way, since we currently have no intrinsic that would work better for 128-bit integers. In the future, I also think that some form of intrinsic would work best to cover that case, but for now at least, I think that they're "good enough" for now. The main reasoning for offering these directly to the standard library even though they're relatively niche optimisations is to help ensure that the code generated for them is optimal. Plus, these operations alone aren't enough to create big integer implementations, although they could help simplify the code required to do so and make it a bit more accessible for the average implementor. That said, I 100% understand if any or all of these methods are not desired simply because of how niche they are. Up to you.
🤷 🏻 -
由 Ibraheem Ahmed 提交于
Co-authored-by: NMara Bos <m-ou.se@m-ou.se>
-
由 Mara Bos 提交于
-
由 Mara Bos 提交于
-
由 Mara Bos 提交于
-
由 Mara Bos 提交于
-
由 Mark Rousskov 提交于
This is kept to a separate commit so that the test itself is preserved in the commit history.
-
由 Paul Trojahn 提交于
-
由 bors 提交于
Rollup of 14 pull requests Successful merges: - #88394 (Document `std::env::current_exe` possible rename behaviour) - #88406 (Tait nest infer test) - #88408 (Add inference cycle TAIT test) - #88409 (Add auto trait leakage TAIT test) - #88413 (Add weird return types TAIT test) - #88450 (fix(rustc_parse): correct span in `maybe_whole_expr!`) - #88462 (rustdoc: Stop using resolver for macro loading) - #88465 (Adding examples to docs of `std::time` module) - #88486 (Remove unused arena macro args) - #88492 (Use MaybeUninit::write in functor.rs) - #88496 (Fix prelude collision lint suggestion for generics with lifetimes) - #88497 (Fix prelude collision suggestions for glob imported traits. ) - #88503 (Warn when [T; N].into_iter() is ambiguous in the new edition. ) - #88509 (Don't suggest extra <> in dyn suggestion.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Mara Bos 提交于
Rollup merge of #88509 - m-ou-se:dyn-no-left-shift-right-shift-just-single-angle-brackets-please-thanks, r=petrochenkov Don't suggest extra <> in dyn suggestion. Fixes https://github.com/rust-lang/rust/issues/88508
-
由 Mara Bos 提交于
Warn when [T; N].into_iter() is ambiguous in the new edition. Fixes https://github.com/rust-lang/rust/issues/88475 In https://github.com/rust-lang/rust/issues/88475, a situation was found where `[T; N].into_iter()` becomes *ambiguous* in the new edition. This is different than the case where `(&[T; N]).into_iter()` resolves differently, which was the only case handled by the `array_into_iter` lint. This is almost identical to the new-traits-in-the-prelude problem. Effectively, due to the array-into-iter hack disappearing in Rust 2021, we effectively added `IntoIterator` to the 'prelude' in Rust 2021 specifically for arrays. This modifies the prelude collisions lint to detect that case and emit a `array_into_iter` lint in that case.
-
由 Mara Bos 提交于
Fix prelude collision suggestions for glob imported traits. Fixes https://github.com/rust-lang/rust/issues/88471 cc `@nikomatsakis`
-
由 Mara Bos 提交于
Fix prelude collision lint suggestion for generics with lifetimes Fixes https://github.com/rust-lang/rust/issues/88470 cc `@nikomatsakis`
-
由 Mara Bos 提交于
Use MaybeUninit::write in functor.rs MaybeUninit::write is stable as of 1.55.0.
-
由 Mara Bos 提交于
Remove unused arena macro args
-
由 Mara Bos 提交于
Adding examples to docs of `std::time` module And adding missing link to `Duration` from `Instant`.
-
由 Mara Bos 提交于
rustdoc: Stop using resolver for macro loading r? `@jyn514`
-
由 Mara Bos 提交于
fix(rustc_parse): correct span in `maybe_whole_expr!` Fixes #87812
-
由 Mara Bos 提交于
Add weird return types TAIT test r? `@oli-obk` Related to #86727
-
由 Mara Bos 提交于
Add auto trait leakage TAIT test r? `@oli-obk` Related to #86727
-
由 Mara Bos 提交于
Add inference cycle TAIT test r? `@oli-obk` Related to #86727
-
由 Mara Bos 提交于
Tait nest infer test r? `@oli-obk` Related to #86727
-
由 Mara Bos 提交于
Document `std::env::current_exe` possible rename behaviour It might not be obvious that the "path of the current running executable" may (or may not) imply "at the time it was loaded". This came up recently in chat so I thought it might be worth documenting.
-
由 bors 提交于
update miri Fixes https://github.com/rust-lang/rust/issues/88473
-
由 bors 提交于
2229: Drop any deref in move closure Fixes: #88431 r? `@nikomatsakis`
-
由 Sönke Hahn 提交于
-
由 bors 提交于
Don't use `guess_head_span` in `predicates_of` for foreign span Previously, the result of `predicates_of` for a foreign trait would depend on the *current* state of the corresponding source file in the foreign crate. This could lead to ICEs during incremental compilation, since the on-disk contents of the upstream source file could potentially change without the upstream crate being recompiled. Additionally, this ensure that that the metadata we produce for a crate only depends on its *compiled* upstream dependencies (e.g an rlib or rmeta file), *not* the current on-disk state of the upstream crate source files.
-
由 bors 提交于
Make Edition 2021 Stable An item of #87959. This is an "on-demand" pull request, which means it will be merged when it is the right time to.
-
由 bors 提交于
update const generics feature gates **tl;dr: split const generics into three features: `adt_const_params`, `const_generics_defaults` and `generic_const_exprs`** continuing the work of `@BoxyUwU` in #88324, this PR - renames `feature(const_evaluatable_checked)` to `feature(generic_const_exprs)` which now doesn't need any other feature gate to work. Previously `feature(const_evaluatable_checked)` was only useful in combination with `feature(const_generics)`. - completely removes `feature(lazy_normalization_consts)`. This feature only supplied the parents generics to anonymous constants, which is pretty useless as generic anon consts are only allowed with `feature(generic_const_exprs)` anyways. - moves the ability to use additional const param types from `feature(const_generics)` into `feature(adt_const_params)`. As `feature(const_generics)` is now mostly useless without `feature(generic_const_exprs)` we also remove that feature flag. - updates tests, removing duplicates and unnecessary revisions in some cases and also deletes all unused `*.stderr` files. I not also remove the ordering restriction for const and type parameters if any of the three const generics features is active. This ordering restriction feels like the only "real" use of the current `feature(const_generics)` right now so this change isn't a perfect solution, but as I intend to stabilize the ordering - and `feature(const_generics_defaults)` - in the very near future, I think this is acceptable for now. --- cc `@rust-lang/project-const-generics` about the new feature names and this change in general. I don't think we need any external approval for this change but I do intend to publish an update to the const generics tracking issue the day this PR lands, so I don't want this merged yet. Apologies to whoever ends up reviewing this PR
😅 ❤ r? rust-lang/project-const-generics
-