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 #88920

Closed
wants to merge 21 commits into from

Conversation

workingjubilee
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

WaffleLapkin and others added 21 commits September 7, 2021 16:41
 * Add test for jump-to-def links background color
…mut, r=dtolnay

Make `UnsafeCell::get_mut` const
…r=estebank

feat(rustc_typeck): suggest removing bad parens in `(recv.method)()`

Fixes rust-lang#88803
Fix duplicate bounds for const_trait_impl

Fixes rust-lang#88383.

Compare the constness of the candidates before winnowing and removing a `~const` `BoundCandidate`.
… r=nagisa

Allow simd_shuffle to accept vectors of any length

cc `@rust-lang/project-portable-simd` `@workingjubilee`
…und, r=camelid

Fix jump def background

Fixes rust-lang#88870.

I somehow badly wrote the color in rust-lang#88111.

r? `@camelid`
Move object safety suggestions to the end of the error
Improve error message for missing trait in trait impl

Fixes rust-lang#88818. For the following example:
```rust
struct S { }
impl for S { }
```
the current output is:
```
error: missing trait in a trait impl
 --> t1.rs:2:5
  |
2 | impl for S { }
  |     ^
```
With my changes, I get:
```
error: missing trait in a trait impl
 --> t1.rs:2:5
  |
2 | impl for S { }
  |     ^
  |
help: add a trait here
  |
2 | impl Trait for S { }
  |      +++++
help: for an inherent impl, drop this `for`
  |
2 - impl for S { }
2 + impl S { }
  |
```
Reduce possibility of flaky tests

As asked in rust-lang#88885.

r? ```@camelid```
@rustbot rustbot added the rollup A PR which is a rollup label Sep 14, 2021
@workingjubilee
Copy link
Member Author

@bors r+ p=2

@bors
Copy link
Contributor

bors commented Sep 14, 2021

📌 Commit f453896 has been approved by workingjubilee

@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 Sep 14, 2021
@workingjubilee
Copy link
Member Author

oh right.
@bors rollup=never

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
.................................................................................................... 10800/12135
..........ii..............................i......................................................... 10900/12135
.................................................................................................... 11000/12135
.................................................................................................... 11100/12135
..................................F......................................................F.......... 11200/12135
....................................................................i............................... 11400/12135
.................................................................................................... 11500/12135
.................................................................................................... 11600/12135
.................................................................................................... 11700/12135
---

---- [ui] ui/traits/item-privacy.rs stdout ----
diff of stderr:

140    |               - this trait cannot be made into an object...
141 LL |         const C: u8 = 0;
142    |               ^ ...because it contains this associated `const`
-    = help: consider moving `B` to another trait
144    = help: consider moving `A` to another trait
+    = help: consider moving `B` to another trait
145    = help: consider moving `C` to another trait
147 error[E0223]: ambiguous associated type


The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/item-privacy/item-privacy.stderr
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args traits/item-privacy.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/traits/item-privacy.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/traits/item-privacy" "-A" "unused" "-Crpath" "-O" "-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/traits/item-privacy/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0599]: no method named `a` found for struct `S` in the current scope
   |
LL | struct S;
LL | struct S;
   | --------- method `a` not found for this
...
LL |     S.a(); //~ ERROR no method named `a` found
   |       ^ method not found in `S`
   = help: items from traits can only be used if the trait is implemented and in scope
   = help: items from traits can only be used if the trait is implemented and in scope
note: `method::A` defines an item `a`, perhaps you need to implement it
   |
LL |     trait A {
   |     ^^^^^^^


error[E0599]: no method named `b` found for struct `S` in the current scope
   |
LL | struct S;
LL | struct S;
   | --------- method `b` not found for this
LL |         fn b(&self) { }
LL |         fn b(&self) { }
   |            - the method is available for `S` here
...
LL |     S.b(); //~ ERROR no method named `b` found
   |       ^ method not found in `S`
   = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
   |
LL | use method::B;
LL | use method::B;
   |

error[E0624]: associated function `a` is private
   |
LL |         fn a(&self) { }
   |         ----------- private associated function defined here
...
...
LL |     c.a(); //~ ERROR associated function `a` is private
   |       ^ private associated function

error[E0599]: no function or associated item named `a` found for struct `S` in the current scope
   |
LL | struct S;
LL | struct S;
   | --------- function or associated item `a` not found for this
...
LL |     S::a(&S);
   |        ^ function or associated item not found in `S`
   = help: items from traits can only be used if the trait is implemented and in scope
   = help: items from traits can only be used if the trait is implemented and in scope
note: `method::A` defines an item `a`, perhaps you need to implement it
   |
LL |     trait A {
   |     ^^^^^^^


error[E0599]: no function or associated item named `b` found for struct `S` in the current scope
   |
LL | struct S;
LL | struct S;
   | --------- function or associated item `b` not found for this
...
LL |     S::b(&S);
   |        ^ function or associated item not found in `S`
   = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
   |
LL | use method::B;
LL | use method::B;
   |

error[E0624]: associated function `a` is private
   |
LL |         fn a(&self) { }
   |         ----------- private associated function defined here
...
...
LL |     <dyn C>::a(&S); //~ ERROR associated function `a` is private
   |              ^ private associated function

error[E0599]: no associated item named `A` found for struct `S` in the current scope
   |
LL | struct S;
LL | struct S;
   | --------- associated item `A` not found for this
...
LL |     S::A; //~ ERROR no associated item named `A` found
   |        ^ associated item not found in `S`
   = help: items from traits can only be used if the trait is implemented and in scope
   = help: items from traits can only be used if the trait is implemented and in scope
note: `assoc_const::A` defines an item `A`, perhaps you need to implement it
   |
LL |     trait A {
   |     ^^^^^^^


error[E0599]: no associated item named `B` found for struct `S` in the current scope
   |
LL | struct S;
LL | struct S;
   | --------- associated item `B` not found for this
...
LL |     S::B; //~ ERROR no associated item named `B` found
   |        ^ associated item not found in `S`
   = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
   |
LL | use assoc_const::B;
---
   |
LL |         const A: u8 = 0;
   |         ---------------- private associated constant defined here
...
LL |     <dyn C>::A; //~ ERROR associated constant `A` is private
   |              ^ private associated constant

error[E0038]: the trait `assoc_const::C` cannot be made into an object
   |
   |
LL |     <dyn C>::A; //~ ERROR associated constant `A` is private
   |      ^^^^^ `assoc_const::C` cannot be made into an object
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
  --> /checkout/src/test/ui/traits/item-privacy.rs:25:15
   |
LL |         const A: u8 = 0;
LL |         const A: u8 = 0;
   |               ^ ...because it contains this associated `const`
LL |         const B: u8 = 0;
LL |         const B: u8 = 0;
   |               ^ ...because it contains this associated `const`
...
LL |     pub trait C: A + B {
   |               - this trait cannot be made into an object...
LL |         const C: u8 = 0;
   |               ^ ...because it contains this associated `const`
   = help: consider moving `A` to another trait
   = help: consider moving `B` to another trait
   = help: consider moving `C` to another trait
error[E0223]: ambiguous associated type
  --> /checkout/src/test/ui/traits/item-privacy.rs:115:12
   |
   |
LL |     let _: S::A; //~ ERROR ambiguous associated type
   |            ^^^^ help: use fully-qualified syntax: `<S as Trait>::A`
error[E0223]: ambiguous associated type
  --> /checkout/src/test/ui/traits/item-privacy.rs:116:12
   |
   |
LL |     let _: S::B; //~ ERROR ambiguous associated type
   |            ^^^^ help: use fully-qualified syntax: `<S as Trait>::B`
error[E0223]: ambiguous associated type
  --> /checkout/src/test/ui/traits/item-privacy.rs:117:12
   |
   |
LL |     let _: S::C; //~ ERROR ambiguous associated type
   |            ^^^^ help: use fully-qualified syntax: `<S as Trait>::C`

error: associated type `A` is private
   |
   |
LL |     let _: T::A; //~ ERROR associated type `A` is private


error: associated type `A` is private
   |
   |
LL |         A = u8, //~ ERROR associated type `A` is private

error: aborting due to 15 previous errors

Some errors have detailed explanations: E0038, E0223, E0599, E0624.
---
---- [ui] ui/traits/test-2.rs stdout ----
diff of stderr:

40    |       |                      |
41    |       |                      ...because method `dup` references the `Self` type in its return type
42    |       this trait cannot be made into an object...
-    = help: consider moving `dup` to another trait
44    = help: consider moving `blah` to another trait
+    = help: consider moving `dup` to another trait
45 
46 error[E0038]: the trait `bar` cannot be made into an object

57    |       |                      |
57    |       |                      |
58    |       |                      ...because method `dup` references the `Self` type in its return type
59    |       this trait cannot be made into an object...
-    = help: consider moving `dup` to another trait
61    = help: consider moving `blah` to another trait
+    = help: consider moving `dup` to another trait
62    = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn bar>>` for `Box<{integer}>`
63    = note: required by cast to type `Box<dyn bar>`


The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/test-2/test-2.stderr
To only update this specific test, also pass `--test-args traits/test-2.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/traits/test-2.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/traits/test-2" "-A" "unused" "-Crpath" "-O" "-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/traits/test-2/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
   |
   |
LL |     10.dup::<i32>();
   |        ^^^------- help: remove these generics
   |        expected 0 generic arguments
   |
note: associated function defined here, with 0 generic parameters
  --> /checkout/src/test/ui/traits/test-2.rs:4:16
  --> /checkout/src/test/ui/traits/test-2.rs:4:16
   |
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }


error[E0107]: this associated function takes 1 generic argument but 2 generic arguments were supplied
   |
   |
LL |     10.blah::<i32, i32>();
   |        ^^^^        --- help: remove this generic argument
   |        expected 1 generic argument
   |
   |
note: associated function defined here, with 1 generic parameter: `X`
   |
   |
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }


error[E0038]: the trait `bar` cannot be made into an object
   |
   |
LL |     (box 10 as Box<dyn bar>).dup();
   |                ^^^^^^^^^^^^ `bar` cannot be made into an object
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
  --> /checkout/src/test/ui/traits/test-2.rs:4:30
   |
   |
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
   |       ---                    ^^^^     ^^^^ ...because method `blah` has generic type parameters
   |       |                      |
   |       |                      ...because method `dup` references the `Self` type in its return type
   |       this trait cannot be made into an object...
   = help: consider moving `blah` to another trait
   = help: consider moving `dup` to another trait

error[E0038]: the trait `bar` cannot be made into an object
   |
   |
LL |     (box 10 as Box<dyn bar>).dup();
   |      ^^^^^^ `bar` cannot be made into an object
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
  --> /checkout/src/test/ui/traits/test-2.rs:4:30
   |
   |
LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
   |       ---                    ^^^^     ^^^^ ...because method `blah` has generic type parameters
   |       |                      |
   |       |                      ...because method `dup` references the `Self` type in its return type
   |       this trait cannot be made into an object...
   = help: consider moving `blah` to another trait
   = help: consider moving `dup` to another trait
   = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn bar>>` for `Box<{integer}>`
   = note: required by cast to type `Box<dyn bar>`
error: aborting due to 4 previous errors

Some errors have detailed explanations: E0038, E0107.
For more information about an error, try `rustc --explain E0038`.
---
test result: FAILED. 12031 passed; 2 failed; 102 ignored; 0 measured; 0 filtered out; finished in 133.87s



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" "/usr/lib/llvm-10/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -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" "--quiet" "--llvm-version" "10.0.0" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils 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 engine executionengine frontendopenmp fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker lto 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 orcerror orcjit passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils 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 windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--channel" "nightly" "--color" "always"


Build completed unsuccessfully in 0:13:34

@workingjubilee
Copy link
Member Author

@bors r-

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Sep 14, 2021
@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 14, 2021
@workingjubilee workingjubilee deleted the rollup-l15r8fy branch September 14, 2021 02:10
@workingjubilee workingjubilee removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 14, 2021
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.