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 4 pull requests #90325

Closed
wants to merge 15 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Noratrieb and others added 15 commits October 22, 2021 23:05
Suggest adding a new lifetime parameter when two elided lifetimes should match up but don't

Issue rust-lang#90170
This also changes the tests introduced by the previous commits because of another rustc issue (rust-lang#90258)
And add a rustdoc-gui test confirming various header sizes.
`is_clobber()` already checks if `reg` is a register and the both
values should be the same.
Properly check `target_features` not to trigger an assertion

Fixes rust-lang#89875
I think it should be a condition instead of an assertion to check if it's a register as it's possible that `reg` is a register class.
Also, this isn't related to the issue directly, but `is_target_supported` doesn't check `target_features` attributes. Is there any way to check it on rustc_codegen_llvm?

r? `@Amanieu`
…-hint, r=estebank

Add beginner friendly lifetime elision hint to E0623

Address rust-lang#90170

Suggest adding a new lifetime parameter when two elided lifetimes should match up but don't.

Example:

```
error[E0623]: lifetime mismatch
  --> $DIR/issue-90170-elision-mismatch.rs:2:35
   |
LL | fn foo(slice_a: &mut [u8], slice_b: &mut [u8]) {
   |                 ---------           --------- these two types are declared with different lifetimes...
LL |     core::mem::swap(&mut slice_a, &mut slice_b);
   |                                   ^^^^^^^^^^^^ ...but data from `slice_b` flows into `slice_a` here
   |
   = note: Each elided lifetime in input position becomes a distinct lifetime.
help: Explicitly declare a lifetime and assign it to both
   |
LL | fn foo<'a>(slice_a: &'a mut [u8], slice_b: &'a mut [u8]) {
   |       ++++           ++                     ++

```

for

```rust
fn foo(slice_a: &mut [u8], slice_b: &mut [u8]) {
    core::mem::swap(&mut slice_a, &mut slice_b);
}
```
…omez

Fix documentation header sizes

And add a rustdoc-gui test confirming various header sizes.

Split off from rust-lang#90156. This fixes a regression in rust-lang#89506 where the heading level of titles within Markdown was too high (h2) for docblocks under structs, unions, and enum impls.

r? `@camelid`

Demo: https://jacob.hoffman-andrews.com/rust/fix-header-sizes/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E
Stable: https://doc.rust-lang.org/stable/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E
Beta: https://doc.rust-lang.org/beta/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E
rustdoc: Use TTF based font instead of OTF for CJK glyphs to improve readability

Due to Windows' implementation of font rendering, OpenType fonts can be distorted. So the existing font, Noto Sans KR, is not very readable on Windows. This PR improves readability of Korean glyphs on Windows.

## Before
![원1](https://user-images.githubusercontent.com/11029378/138592394-16b15787-532d-4421-a5eb-ed85675290fa.png)

## After
![원2](https://user-images.githubusercontent.com/11029378/138592409-f3a440ee-f0fc-40e4-9561-42c479439c9f.png)

The fonts included in this PR are licensed under the SIL Open Font License and generated with these commands:

```sh
pyftsubset NanumBarunGothic.ttf \
--unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \
--output-file=NanumBarunGothic.ttf.woff --flavor=woff
```
```sh
pyftsubset NanumBarunGothic.ttf \
--unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \
--output-file=NanumBarunGothic.ttf.woff2 --flavor=woff2
```

r? `@GuillaumeGomez`
@rustbot rustbot added the rollup A PR which is a rollup label Oct 26, 2021
@matthiaskrgr
Copy link
Member Author

@bors r+ p=4

@bors
Copy link
Contributor

bors commented Oct 26, 2021

📌 Commit 5367f0b has been approved by matthiaskrgr

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Oct 26, 2021
@matthiaskrgr
Copy link
Member Author

@bors rollup=never

@bors
Copy link
Contributor

bors commented Oct 26, 2021

⌛ Testing commit 5367f0b with merge 936b096e2a32f73233fb09c6b78f5667d0bd83f7...

@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)
test [ui (nll)] ui/wrong-hashset-issue-42918.rs ... ok

failures:

---- [ui (nll)] ui/lifetimes/issue-90170-elision-mismatch.rs stdout ----

- error[E0623]: lifetime mismatch
-   --> $DIR/issue-90170-elision-mismatch.rs:3:47
+ error: lifetime may not live long enough
+ error: lifetime may not live long enough
+   --> $DIR/issue-90170-elision-mismatch.rs:3:40
3    |
4 LL | pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); }
-    |                        ---      ---           ^ ...but data from `y` flows into `x` here
-    |                                 these two types are declared with different lifetimes...
-    |
-    |
-    = note: each elided lifetime in input position becomes a distinct lifetime
- help: consider introducing a named lifetime parameter
-    |
- LL | pub fn foo<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
Some tests failed in compiletest suite=ui compare_mode=Nll mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
-    |           ++++              ++          ++
+    |                        -        -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
+    |                        |        |
+    |                        |        let's call the lifetime of this reference `'1`
+    |                        let's call the lifetime of this reference `'2`
- error[E0623]: lifetime mismatch
-   --> $DIR/issue-90170-elision-mismatch.rs:5:51
+ error: lifetime may not live long enough
+   --> $DIR/issue-90170-elision-mismatch.rs:5:44
+   --> $DIR/issue-90170-elision-mismatch.rs:5:44
17    |
18 LL | pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); }
-    |                         ------      ---           ^ ...but data from `y` flows into `x` here
-    |                                     these two types are declared with different lifetimes...
-    |
-    |
-    = note: each elided lifetime in input position becomes a distinct lifetime
- help: consider introducing a named lifetime parameter
-    |
- LL | pub fn foo2<'a>(x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
-    |            ++++              ~~          ++
+    |                         -           -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
+    |                         |           |
+    |                         |           let's call the lifetime of this reference `'1`
+    |                         let's call the lifetime of this reference `'2`
- error[E0623]: lifetime mismatch
-   --> $DIR/issue-90170-elision-mismatch.rs:7:70
+ error: lifetime may not live long enough
+   --> $DIR/issue-90170-elision-mismatch.rs:7:63
+   --> $DIR/issue-90170-elision-mismatch.rs:7:63
31    |
32 LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); }
-    |                                               ---      ---           ^ ...but data from `y` flows into `x` here
-    |                                                        these two types are declared with different lifetimes...
-    |
-    |
-    = note: each elided lifetime in input position becomes a distinct lifetime
- help: consider introducing a named lifetime parameter
-    |
- LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&'a u8>, y: &'a u8) { x.push(y); }
-    |                                                ++          ++
+    |                                               -        -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
+    |                                               |        |
+    |                                               |        let's call the lifetime of this reference `'1`
+    |                                               let's call the lifetime of this reference `'2`
43 error: aborting due to 3 previous errors
44 

- For more information about this error, try `rustc --explain E0623`.
- For more information about this error, try `rustc --explain E0623`.
46 


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lifetimes/issue-90170-elision-mismatch.nll/issue-90170-elision-mismatch.nll.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args lifetimes/issue-90170-elision-mismatch.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/lifetimes/issue-90170-elision-mismatch.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lifetimes/issue-90170-elision-mismatch.nll" "-Zborrowck=mir" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lifetimes/issue-90170-elision-mismatch.nll/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error: lifetime may not live long enough
  --> /checkout/src/test/ui/lifetimes/issue-90170-elision-mismatch.rs:3:40
   |
LL | pub fn foo(x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime mismatch
   |                        -        -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
   |                        |        |
   |                        |        let's call the lifetime of this reference `'1`
   |                        let's call the lifetime of this reference `'2`
error: lifetime may not live long enough
  --> /checkout/src/test/ui/lifetimes/issue-90170-elision-mismatch.rs:5:44
   |
   |
LL | pub fn foo2(x: &mut Vec<&'_ u8>, y: &u8) { x.push(y); } //~ ERROR lifetime mismatch
   |                         -           -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
   |                         |           |
   |                         |           let's call the lifetime of this reference `'1`
   |                         let's call the lifetime of this reference `'2`
error: lifetime may not live long enough
  --> /checkout/src/test/ui/lifetimes/issue-90170-elision-mismatch.rs:7:63
   |
   |
LL | pub fn foo3<'a>(_other: &'a [u8], x: &mut Vec<&u8>, y: &u8) { x.push(y); } //~ ERROR lifetime mismatch
   |                                               -        -      ^^^^^^^^^ argument requires that `'1` must outlive `'2`
   |                                               |        |
   |                                               |        let's call the lifetime of this reference `'1`
   |                                               let's call the lifetime of this reference `'2`
error: aborting due to 3 previous errors


------------------------------------------
---
test result: FAILED. 12205 passed; 1 failed; 143 ignored; 0 measured; 0 filtered out; finished in 111.37s



command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--suite" "ui" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -Cdebuginfo=0  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -Cdebuginfo=0  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python3" "--lldb-python" "/usr/bin/python3" "--gdb" "/usr/bin/gdb" "--llvm-version" "13.0.0-rust-1.58.0-nightly" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwp engine executionengine extensions filecheck frontendopenacc frontendopenmp fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interfacestub interpreter ipo irreader jitlink libdriver lineeditor linker lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info xray" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--channel" "nightly" "--color" "always" "--compare-mode" "nll"


Build completed unsuccessfully in 0:18:58

@bors
Copy link
Contributor

bors commented Oct 26, 2021

💔 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 Oct 26, 2021
@matthiaskrgr matthiaskrgr deleted the rollup-o4z4fmu branch November 20, 2021 15:04
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-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants