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 9 pull requests #104479

Closed
wants to merge 25 commits into from
Closed

Conversation

Dylan-DPC
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

nagisa and others added 25 commits October 22, 2022 03:46
On usize=u64 platforms, the 4th iteration would overflow the `mod_gate`
back to 0. Similarly for usize=u32 platforms, the 3rd iteration would
overflow much the same way.

I tested various approaches to resolving this, including approaches with
`saturating_mul` and `widening_mul` to a double usize. Turns out LLVM
likes `mul_with_overflow` the best. In fact now, that LLVM can see the
iteration count is limited, it will happily unroll the loop into a nice
linear sequence.

You will also notice that the code around the loop got simplified
somewhat. Now that LLVM is handling the loop nicely, there isn’t any
more reasons to manually unroll the first iteration out of the loop
(though looking at the code today I’m not sure all that complexity was
necessary in the first place).

Fixes rust-lang#103361
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
implement binding_shadows

migrate till self-in-generic-param-default

use braces in fluent message as suggested by @compiler-errors.

to fix lock file issue reported by CI

migrate 'unreachable label' error

run formatter

name the variables correctly in fluent file

SessionDiagnostic -> Diagnostic

test "pattern/pat-tuple-field-count-cross.rs" passed

test "resolve/bad-env-capture2.rs" passed

test "enum/enum-in-scope.rs" and other depended on "resolve_binding_shadows_something_unacceptable" should be passed now.

fix crash errors while running test-suite. there might be more.

then_some(..) suits better here.

all tests passed

convert TraitImpl and InvalidAsm. TraitImpl is buggy yet. will fix after receiving help from Zulip

migrate "Ralative-2018"

migrate "ancestor only"

migrate "expected found"

migrate "Indeterminate"

migrate "module only"

revert to the older implementation for now. since this is failing at the moment.

follow the convension for fluent variable

order the diag attribute as suggested in review comment

fix merge error. migrate trait-impl-duplicate

make the changes compatible with "Flatten diagnostic slug modules rust-lang#103345"

fix merge

remove commented code

merge issues

fix review comments

fix tests
Since the empty main is used for `not(unix)`, all the targets that will
use this empty main will also need `allow(unused_imports)`.

Originally part of rust-lang#100316

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
This rule was added in cc4f804 because the help popover inherited the
font-size from the help button "?" icon.

It doesn't inherit this any more, because it was moved from being nested
inside the link to sharing a wrapper DIV with it.
Migrate rustc_resolve to use SessionDiagnostic, part # 1

crate a somewhat on larger size, so plz allow some time to get it finished.
…tmcm

Fix mod_inv termination for the last iteration

On usize=u64 platforms, the 4th iteration would overflow the `mod_gate` back to 0. Similarly for usize=u32 platforms, the 3rd iteration would overflow much the same way.

I tested various approaches to resolving this, including approaches with `saturating_mul` and `widening_mul` to a double usize. Turns out LLVM likes `mul_with_overflow` the best. In fact now, that LLVM can see the iteration count is limited, it will happily unroll the loop into a nice linear sequence.

You will also notice that the code around the loop got simplified somewhat. Now that LLVM is handling the loop nicely, there isn’t any more reasons to manually unroll the first iteration out of the loop (though looking at the code today I’m not sure all that complexity was necessary in the first place).

Fixes rust-lang#103361
…-ou-se

`unchecked_{shl|shr}` should use `u32` as the RHS

The other shift methods, such as https://doc.rust-lang.org/nightly/std/primitive.u64.html#method.checked_shr and https://doc.rust-lang.org/nightly/std/primitive.i16.html#method.wrapping_shl, use `u32` for the shift amount.  That's consistent with other things, like `count_ones`, which also always use `u32` for a bit count, regardless of the size of the type.

This PR changes `unchecked_shl` and `unchecked_shr` to also use `u32` for the shift amount (rather than Self).

cc rust-lang#85122, the `unchecked_math` tracking issue
Add `rust` to `let_underscore_lock` example

Currently https://doc.rust-lang.org/beta/rustc/lints/listing/deny-by-default.html#let-underscore-lock has no colored grammar and raw `{{produces}}` command is exposed.
… r=scottmcm

Make `pointer::byte_offset_from` more generic

As suggested by rust-lang#96283 (comment) (cc ``@scottmcm),`` make `pointer::byte_offset_from` work on pointers of different types. `byte_offset_from` really doesn't care about pointer types, so this is totally fine and, for example, allows patterns like this:
```rust
ptr::addr_of!(x.b).byte_offset_from(ptr::addr_of!(x))
```

The only possible downside is that this removes the `T` == `U` hint to inference, but I don't think this matter much. I don't think there are a lot of cases where you'd want to use `byte_offset_from` with a pointer of unbounded type (and in such cases you can just specify the type).

``@rustbot`` label +T-libs-api
…ilee

Fix some misleading target feature aliases

This is the first half of a fix for rust-lang#100752.  It looks like these aliases were added in rust-lang#78361 and slipped under the radar, as these features are not AVX512.  These features _do_ add AVX512 instructions when used _in combination_ with AVX512F, but without AVX512F, these features still provide 128-bit and 256-bit vector instructions.  A user might be mislead into thinking these features imply AVX512F (which is true of the actual AVX512 features).  This PR allows using the names as defined by LLVM, which matches Intel documentation.

A future PR should change the `std::arch` intrinsics to use these names, and finally remove these aliases from rustc.

r? `@workingjubilee`

cc `@Amanieu`
Respect visibility & stability of inherent associated types

As discussed in rust-lang#103621, this probably won't be the final location of the code that resolves inherent associated types. Still, I think it's valuable to push correctness fixes for this feature (in regards to visibility and stability).

Let me know if I should write a translatable diagnostic instead and if I should move the tests to `privacy/` and `stability-attribute/` respectively.

Fixes rust-lang#104243.
``@rustbot`` label A-visibility F-inherent_associated_types
r? ``@cjgillot`` (since you reviewed rust-lang#103621, feel free to reroll though)
Fix test/ui/issues/issue-30490.rs

Since the empty main is used for `not(unix)`, all the targets that will use this empty main will also need `allow(unused_imports)`.

Originally part of rust-lang#100316

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
…ize, r=GuillaumeGomez

rustdoc: remove no-op CSS `.popover { font-size: 1rem }`

This rule was added in cc4f804 because the help popover inherited the font-size from the help button "?" icon.

It doesn't inherit this any more, because it was moved from being nested inside the link to sharing a wrapper DIV with it.
@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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. labels Nov 16, 2022
@rustbot rustbot added 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 16, 2022
@Dylan-DPC
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Nov 16, 2022

📌 Commit 3f45fe3 has been approved by Dylan-DPC

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 16, 2022
@bors
Copy link
Contributor

bors commented Nov 16, 2022

⌛ Testing commit 3f45fe3 with merge 1b0ce1a1a61474f3ab161162df428605bcf4e308...

@bors
Copy link
Contributor

bors commented Nov 16, 2022

💔 Test failed - checks-actions

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

Looks like #103456 was the problem.

@scottmcm scottmcm closed this Nov 16, 2022
@Dylan-DPC Dylan-DPC deleted the rollup-ll6zoyb branch November 16, 2022 08:26
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-nopt failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

failures:
Some tests failed in compiletest suite=codegen mode=codegen host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu

---- [codegen] src/test/codegen/unchecked_shifts.rs stdout ----

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/unchecked_shifts/unchecked_shifts.ll" "/checkout/src/test/codegen/unchecked_shifts.rs" "--allow-unused-prefixes" "--check-prefixes" "CHECK,NONMSVC"
stdout: none
--- stderr -------------------------------
/checkout/src/test/codegen/unchecked_shifts.rs:22:16: error: CHECK-DAG: expected string not found in input
 // CHECK-DAG: %[[INRANGE:.+]] = icmp ult i32 %b, 65536
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/unchecked_shifts/unchecked_shifts.ll:20:43: note: scanning from here
define i16 @unchecked_shl_unsigned_smaller(i16 %a, i32 %b) unnamed_addr #1 personality ptr @rust_eh_personality {
                                          ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/unchecked_shifts/unchecked_shifts.ll:22:5: note: possible intended match here
 %_2.i.i = icmp ugt i32 %b, 65535
    ^
/checkout/src/test/codegen/unchecked_shifts.rs:52:16: error: CHECK-DAG: expected string not found in input
 // CHECK-DAG: %[[INRANGE:.+]] = icmp ult i32 %b, 32768
               ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/unchecked_shifts/unchecked_shifts.ll:61:41: note: scanning from here
define i16 @unchecked_shr_signed_smaller(i16 %a, i32 %b) unnamed_addr #1 personality ptr @rust_eh_personality {
                                        ^
/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/unchecked_shifts/unchecked_shifts.ll:63:5: note: possible intended match here
 %_2.i.i = icmp ugt i32 %b, 32767


Input file: /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/unchecked_shifts/unchecked_shifts.ll
Check file: /checkout/src/test/codegen/unchecked_shifts.rs

-dump-input=help explains the following input dump.
Input was:
<<<<<<
          .
          .
          .
          .
         15:  %0 = shl i32 %a, %b 
         16:  ret i32 %0 
         17: } 
         18:  
         19: ; Function Attrs: nonlazybind uwtable 
         20: define i16 @unchecked_shl_unsigned_smaller(i16 %a, i32 %b) unnamed_addr #1 personality ptr @rust_eh_personality { 
dag:22'0                                               X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
         21: start: 
dag:22'0     ~~~~~~~
         22:  %_2.i.i = icmp ugt i32 %b, 65535 
dag:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dag:22'1         ?                              possible intended match
         23:  br i1 %_2.i.i, label %bb2.i, label %"_ZN4core6option15Option$LT$T$GT$16unwrap_unchecked17h5fc80b933cf12eb7E.exit" 
dag:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         24:  
dag:22'0     ~
         25: bb2.i: ; preds = %start 
dag:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         26: ; call core::panicking::panic 
dag:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         27:  tail call void @_ZN4core9panicking5panic17h4a2384573d0594c7E(ptr noalias noundef nonnull readonly align 1 @alloc49, i64 32, ptr noalias noundef nonnull readonly align 8 dereferenceable(24) @alloc53) #3 
dag:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
          .
         56:  %0 = ashr i32 %a, %b 
         57:  ret i32 %0 
         58: } 
         59:  
         60: ; Function Attrs: nonlazybind uwtable 
         61: define i16 @unchecked_shr_signed_smaller(i16 %a, i32 %b) unnamed_addr #1 personality ptr @rust_eh_personality { 
dag:52'0                                             X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
         62: start: 
dag:52'0     ~~~~~~~
         63:  %_2.i.i = icmp ugt i32 %b, 32767 
dag:52'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dag:52'1         ?                              possible intended match
         64:  br i1 %_2.i.i, label %bb2.i, label %"_ZN4core6option15Option$LT$T$GT$16unwrap_unchecked17hd6ddc5ba5706fe00E.exit" 
dag:52'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         65:  
dag:52'0     ~
         66: bb2.i: ; preds = %start 
dag:52'0     ~~~~~~~~~~~~~~~~~~~~~~~~
         67: ; call core::panicking::panic 
dag:52'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         68:  tail call void @_ZN4core9panicking5panic17h4a2384573d0594c7E(ptr noalias noundef nonnull readonly align 1 @alloc49, i64 32, ptr noalias noundef nonnull readonly align 8 dereferenceable(24) @alloc59) #3 
dag:52'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
>>>>>>
------------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.