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 8 pull requests #91061

Closed
wants to merge 29 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

WaffleLapkin and others added 29 commits October 10, 2021 14:03
- Make clear that the `Pointer` trait is related to formatting
- Make clear that `&T` (shared reference) implements `Send` (if `T: Send + Sync`)
Co-authored-by: fmease <liehr.exchange@gmx.net>
Be more thorough in using `ItemObligation` and `BindingObligation` when
evaluating obligations so that we can point at trait bounds that
introduced unfulfilled obligations. We no longer incorrectly point at
unrelated trait bounds (`substs-ppaux.verbose.stderr`).

In particular, we now point at trait bounds on method calls.

We no longer point at "obvious" obligation sources (we no longer have a
note pointing at `Trait` saying "required by a bound in `Trait`", like
in `associated-types-no-suitable-supertrait*`).

Address part of rust-lang#89418.
`predicates_of` no longer changes when changing a trait's front matter
because we no longer include the trait's span in the identity trait
obligation.
Group obligations by `impl` block that introduced them.
The basic problem with this is that rustdoc, when hunting for `fn main`, will stop
parsing after it reaches a fatal error. This unexpected semicolon was a fatal error,
so in `src/test/rustdoc-ui/failed-doctest-extra-semicolon-on-item.rs`, it would wrap
the doctest in an implied main function, turning it into this:

    fn main() {
        struct S {};
        fn main() {
            assert_eq!(0, 1);
        }
    }

This, as it turns out, is totally valid, and it executes no assertions, so *it passes,*
even though the user wanted it to execute the assertion.

The Rust parser already has the ability to recover from these unexpected semicolons,
but to do so, it needs to use the `parse_mod` function, so this commit changes it to do that.
They were being interpreted literally.
Makes docs for references a little less confusing

- Make clear that the `Pointer` trait is related to formatting
- Make clear that the `Pointer` trait is implemented for references (previously it was confusing to first see that it's implemented and then see it in "expect")
- Make clear that `&T` (shared reference) implements `Send` (if `T: Send + Sync`)
…=nagisa

Point at source of trait bound obligations in more places

Be more thorough in using `ItemObligation` and `BindingObligation` when
evaluating obligations so that we can point at trait bounds that
introduced unfulfilled obligations. We no longer incorrectly point at
unrelated trait bounds (`substs-ppaux.verbose.stderr`).

In particular, we now point at trait bounds on method calls.

We no longer point at "obvious" obligation sources (we no longer have a
note pointing at `Trait` saying "required by a bound in `Trait`", like
in `associated-types-no-suitable-supertrait*`).

We no longer point at associated items (`ImplObligation`), as they didn't
add any user actionable information, they just added noise.

Address part of rust-lang#89418.
fix CTFE/Miri simd_insert/extract on array-style repr(simd) types

The changed test would previously fail since `place_index` would just return the only field of `f32x4`, i.e., the array -- rather than *indexing into* the array which is what we have to do.

The new helper methods will also be needed for rust-lang/miri#1912.

r? `````@oli-obk`````
…-semicolon, r=jyn514

rustdoc doctest: detect `fn main` after an unexpected semicolon

Fixes rust-lang#91014

The basic problem with this is that rustdoc, when hunting for `fn main`, will stop parsing after it reaches a fatal error. This unexpected semicolon was a fatal error, so in `src/test/rustdoc-ui/failed-doctest-extra-semicolon-on-item.rs`, it would wrap the doctest in an implied main function, turning it into this:

    fn main() {
        struct S {};
        fn main() {
            assert_eq!(0, 1);
        }
    }

This, as it turns out, is totally valid, and it executes no assertions, so *it passes,* even though the user wanted it to execute the assertion.

The Rust parser already has the ability to recover from these unexpected semicolons, but to do so, it needs to use the `parse_mod` function, so this PR changes it to do that.
…ty-line, r=camelid

Put back removed empty line

Fixes comment from rust-lang#90438 (comment).

r? ```@camelid```
Turn all 0x1b_u8 into '\x1b' or b'\x1b'

Supersedes rust-lang#91040
rustdoc: Fix some unescaped HTML tags in docs

They were being interpreted literally.
@rustbot rustbot added the rollup A PR which is a rollup label Nov 19, 2021
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=8

@bors
Copy link
Contributor

bors commented Nov 19, 2021

📌 Commit e47fe9c 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 Nov 19, 2021
@bors
Copy link
Contributor

bors commented Nov 19, 2021

⌛ Testing commit e47fe9c with merge 8789b2575a7cc493df88a1b0582ef7b8dc602c78...

@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)

---- [ui (nll)] ui/mismatched_types/closure-arg-type-mismatch.rs stdout ----
diff of stderr:

5    |              ^^^ ------------------ found signature of `fn((u32, u32)) -> _`
6    |              |
7    |              expected signature of `fn(&(u32, u32)) -> _`
Some tests failed in compiletest suite=ui compare_mode=Nll mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
+ note: required by a bound in `map`
+   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
+    |
+    |
+ LL |         F: FnMut(Self::Item) -> B,
+    |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
9 error[E0631]: type mismatch in closure arguments
10   --> $DIR/closure-arg-type-mismatch.rs:4:14


13    |              ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _`
14    |              |
15    |              expected signature of `fn(&(u32, u32)) -> _`
+ note: required by a bound in `map`
+   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
+    |
+    |
+ LL |         F: FnMut(Self::Item) -> B,
+    |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
17 error[E0631]: type mismatch in closure arguments
18   --> $DIR/closure-arg-type-mismatch.rs:5:14


21    |              ^^^ ------------------ found signature of `fn((u16, u16)) -> _`
22    |              |
23    |              expected signature of `fn(&(u32, u32)) -> _`
+ note: required by a bound in `map`
+   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
+    |
+    |
+ LL |         F: FnMut(Self::Item) -> B,
+    |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
25 error: aborting due to 3 previous errors
26 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/mismatched_types/closure-arg-type-mismatch.nll/closure-arg-type-mismatch.nll.stderr
To only update this specific test, also pass `--test-args mismatched_types/closure-arg-type-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/mismatched_types/closure-arg-type-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/mismatched_types/closure-arg-type-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/mismatched_types/closure-arg-type-mismatch.nll/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0631]: type mismatch in closure arguments
  --> /checkout/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs:3:14
   |
LL |     a.iter().map(|_: (u32, u32)| 45); //~ ERROR type mismatch
   |              ^^^ ------------------ found signature of `fn((u32, u32)) -> _`
   |              |
   |              expected signature of `fn(&(u32, u32)) -> _`
note: required by a bound in `map`
  --> /checkout/library/core/src/iter/traits/iterator.rs:685:12
   |
   |
LL |         F: FnMut(Self::Item) -> B,
   |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
error[E0631]: type mismatch in closure arguments
  --> /checkout/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs:4:14
   |
   |
LL |     a.iter().map(|_: &(u16, u16)| 45); //~ ERROR type mismatch
   |              ^^^ ------------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _`
   |              |
   |              expected signature of `fn(&(u32, u32)) -> _`
note: required by a bound in `map`
  --> /checkout/library/core/src/iter/traits/iterator.rs:685:12
   |
   |
LL |         F: FnMut(Self::Item) -> B,
   |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
error[E0631]: type mismatch in closure arguments
  --> /checkout/src/test/ui/mismatched_types/closure-arg-type-mismatch.rs:5:14
   |
   |
LL |     a.iter().map(|_: (u16, u16)| 45); //~ ERROR type mismatch
   |              ^^^ ------------------ found signature of `fn((u16, u16)) -> _`
   |              |
   |              expected signature of `fn(&(u32, u32)) -> _`
note: required by a bound in `map`
  --> /checkout/library/core/src/iter/traits/iterator.rs:685:12
   |
   |
LL |         F: FnMut(Self::Item) -> B,
   |            ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
error: aborting due to 3 previous errors

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

---
test result: FAILED. 12236 passed; 1 failed; 146 ignored; 0 measured; 0 filtered out; finished in 115.89s



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:19:55

@bors
Copy link
Contributor

bors commented Nov 20, 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 Nov 20, 2021
@matthiaskrgr matthiaskrgr deleted the rollup-h874aol 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.