Skip to content
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 11 pull requests #104738

Closed
wants to merge 49 commits into from
Closed

Conversation

Manishearth
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

ecnelises and others added 30 commits November 17, 2022 16:36
Before, the lint did the checking for `must_use` and pretty printing the
types in a special format in one pass, causing quite complex and
untranslatable code.
Now the collection and printing is split in two. That should also make
it easier to translate or extract the type pretty printing in the
future.

Also fixes an integer overflow in the array length pluralization
calculation.
…lally allow trait resolution to prove false things during coherence
Do not suggest `.clone()` as we already suggest borrowing the iterated
value.
WaffleLapkin and others added 14 commits November 22, 2022 16:45
Forbid inlining `thread_local!`'s `__getit` function on Windows

Sadly, this will make things slower to avoid UB in an edge case, but it seems hard to avoid... and really whenever I look at this code I can't help but think we're asking for trouble.

It's pretty dodgy for us to leave this as a normal function rather than `#[inline(never)]`, given that if it *does* get inlined into a dynamically linked component, it's extremely unsafe (you get some other thread local, or if you're lucky, crash). Given that it's pretty rare for people to use dylibs on Windows, the fact that we haven't gotten bug reports about it isn't really that convincing. Ideally we'd come up with some kind of compiler solution (that avoids paying for this cost when static linking, or *at least* for use within the same crate...), but it's not clear what that looks like.

Oh, and because all this is only needed when we're implementing `thread_local!` with `#[thread_local]`, this patch adjusts the `cfg_attr` to be `all(windows, target_thread_local)` as well.

r? `@ChrisDenton`

See also rust-lang#84933, which is about improving the situation.
Add powerpc64-ibm-aix as Tier-3 target

This is part of the effort mentioned in rust-lang/compiler-team#553.

A reference to these options are definitions from [clang](https://github.com/llvm/llvm-project/blob/ad6fe32032a6229e0c40510e9bed419a01c695b3/clang/lib/Basic/Targets/PPC.h#L414-L448) and [llvm](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp).

AIX has a system `ld` but [its options and behaviors](https://www.ibm.com/docs/en/aix/7.3?topic=l-ld-command) are different from GNU ld. Thanks to `@bzEq` for contributing the linking args.
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases

r? `@lcnr`

fixes rust-lang#99840
…ler-errors

Suggest `.clone()` or `ref binding` on E0382
Refactor must_use lint into two parts

Before, the lint did the checking for `must_use` and pretty printing the types in a special format in one pass, causing quite complex and untranslatable code.
Now the collection and printing is split in two. That should also make it easier to translate or extract the type pretty printing in the future.

Also fixes an integer overflow in the array length pluralization
calculation.

fixes rust-lang#104352
…lcnr

Use obligation ctxt instead of dyn TraitEngine

r? `@lcnr`
…r=thomcc

enable fuzzy_provenance_casts lint in liballoc and libstd

r? `@thomcc`
…d-as-const-generic, r=oli-obk

Add failing test for projections used as const generic

Based on the experiment done in rust-lang#104443, we realized it's currently not possible to support projections in const generics. More information about it in rust-lang#104443 (comment).

This PR adds the UI test in any case so we can gather data in order to work towards adding `TyAlias` into the ABI in the future.

r? `@oli-obk`
…ler-errors

Fix `ClosureKind::to_def_id`

`Fn` and `FnOnce` were mixed up in rust-lang#99131.
…litely, r=compiler-errors

Use `tcx.require_lang_item` instead of unwrapping lang items

I clearly remember esteban telling me that there is `require_lang_item` but he was from a phone atm and I couldn't find it, so I didn't use it. Stumbled on it today, so here we are :)
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Nov 22, 2022
@Manishearth
Copy link
Member Author

@bors r+ p=9 rollup=never

@bors
Copy link
Contributor

bors commented Nov 22, 2022

📌 Commit 0c626d4 has been approved by Manishearth

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 22, 2022
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking rustc_save_analysis v0.0.0 (/checkout/compiler/rustc_save_analysis)
    Checking rustc_resolve v0.0.0 (/checkout/compiler/rustc_resolve)
    Checking rustc_transmute v0.1.0 (/checkout/compiler/rustc_transmute)
    Checking rustc_trait_selection v0.0.0 (/checkout/compiler/rustc_trait_selection)
error[E0271]: type mismatch resolving `<&[_; 0] as IntoIterator>::Item == rustc_middle::ty::GenericArg<'_>`
     |
     |
430  |     let trait_ref = ty::TraitRef { def_id: bound, substs: tcx.mk_substs_trait(ty, &[]) };
     |                                                               ---------------     ^^^ expected struct `rustc_middle::ty::GenericArg`, found reference
     |                                                               required by a bound introduced by this call
     |
     = note: expected struct `rustc_middle::ty::GenericArg<'_>`
             found reference `&_`
             found reference `&_`
note: required by a bound in `rustc_middle::ty::TyCtxt::<'tcx>::mk_substs_trait`
     |
     |
2815 |         rest: impl IntoIterator<Item = GenericArg<'tcx>>,
     |                                 ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `rustc_middle::ty::TyCtxt::<'tcx>::mk_substs_trait`
For more information about this error, try `rustc --explain E0271`.
error: could not compile `rustc_trait_selection` due to previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `rustc_trait_selection` due to previous error

@JohnTitor
Copy link
Member

@bors r- --^ (Maybe something is conflicting with #104509)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 22, 2022
@compiler-errors
Copy link
Member

compiler-errors commented Nov 22, 2022

Failed due to #104509, needs rebase after one of Oli's refactor PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.