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

Closed
wants to merge 21 commits into from
Closed

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

cjgillot and others added 21 commits July 13, 2021 22:10
Lint missing Abi in ast validation instead of lowering.
…ochenkov

Make `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` warn by default

This PR makes the `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lint warn by default.

To avoid showing a large number of un-actionable warnings to users, we only enable the lint for macros defined in the same crate. This ensures that users will be able to fix the warning by simply removing a semicolon.

In the future, I'd like to enable this lint unconditionally, and eventually make it into a hard error in a future edition. This PR is a step towards that goal.
…kennytm

Add missing examples for NonNull
…-error, r=nikomatsakis

Fix issue with autofix for ambiguous associated function from Rust 2021 prelude when struct is generic

Fixes rust-lang#86940

The test cases and associated issue should make it clear what specifically this is meant to fix. The fix is slightly hacky in that we check against the literal source code of the call site for the presence of `<` in order to determine if the user has included the generics for the struct (meaning we don't need to include them for them).

r? `@nikomatsakis`
…ce, r=estebank

Add warning when whitespace is not skipped after an escaped newline

Fixes issue rust-lang#87318, also simplifies issue rust-lang#87319.

* Add support to the lexer to emit warnings as well as errors.
* Emit a warning when a string literal contains an escaped newline, but when (some of) the whitespace on the next line is not skipped due to it being non-ASCII.
Add some TAIT-related regression tests

Closes rust-lang#74280, closes rust-lang#77179.
r? `@oli-obk`
…ocs, r=m-ou-se

Add docs about performance and `Iterator::map` to `[T; N]::map`

This suboptimal code gen for some usages of array::map got a bit of
attention by multiple people throughout the community. Some cases:

- rust-lang#75243 (comment)
- rust-lang#75243 (comment)
- https://www.reddit.com/r/rust/comments/oeqqf7/unexpected_high_stack_usage/

My *guess* is that this gets the attention it gets because in JavaScript
(and potentially other languages), a `map` function on arrays is very
commonly used since in those languages, arrays basically take the role
of Rust's iterator. I considered explicitly naming JavaScript in the
first paragraph I added, but I couldn't find precedence of mentioning
other languages in standard library doc, so I didn't add it.

When array::map was stabilized, we still wanted to add docs, but that
somehow did not happen in time. So here we are. Not sure if this sounds
crazy but maybe it is worth considering beta backporting this? Only if
it's not a lot of work, of course! But yeah, stabilized array::map is
already in beta and if this problem is really as big as it sometimes seems,
might be worth having the docs in place when 1.55 is released.

CC `@CryZe`

r? `@m-ou-se` (since you were involved in that discussion and the stabilization)
@rustbot rustbot added the rollup A PR which is a rollup label Jul 30, 2021
@JohnTitor
Copy link
Member Author

@bors r+ p=9 rollup=never

@bors
Copy link
Contributor

bors commented Jul 30, 2021

📌 Commit 5b3bce6 has been approved by JohnTitor

@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 Jul 30, 2021
@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)
diff of stderr:

2   --> $DIR/cli-lint-override.rs:12:1
3    |
4 LL | extern fn foo() {}
-    | ^^^^^^^^^^^^^^^ ABI should be specified here
+    | ^^^^^^^^^^^^^^^^^^ ABI should be specified here
6    |
7    = note: requested on the command line with `-F missing-abi`
8    = help: the default ABI is C

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/lint/cli-lint-override.forbid_warn/cli-lint-override.forbid_warn.stderr
To only update this specific test, also pass `--test-args lint/cli-lint-override.rs`


error in revision `forbid_warn`: 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/lint/cli-lint-override.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--cfg" "forbid_warn" "--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/lint/cli-lint-override.forbid_warn" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--warn" "missing_abi" "--forbid" "missing_abi" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/cli-lint-override.forbid_warn/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error: extern declarations without an explicit ABI are deprecated
   |
LL | extern fn foo() {}
LL | extern fn foo() {}
   | ^^^^^^^^^^^^^^^^^^ ABI should be specified here
   |
   = note: requested on the command line with `-F missing-abi`
   = help: the default ABI is C
error: aborting due to previous error


------------------------------------------
------------------------------------------


---- [ui] ui/lint/cli-lint-override.rs#force_warn_deny stdout ----

2   --> $DIR/cli-lint-override.rs:12:1
3    |
4 LL | extern fn foo() {}
4 LL | extern fn foo() {}
-    | ^^^^^^^^^^^^^^^ ABI should be specified here
+    | ^^^^^^^^^^^^^^^^^^ ABI should be specified here
6    |
7    = note: requested on the command line with `--force-warn missing-abi`
8    = help: the default ABI is C

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/lint/cli-lint-override.force_warn_deny/cli-lint-override.force_warn_deny.stderr
To only update this specific test, also pass `--test-args lint/cli-lint-override.rs`


error in revision `force_warn_deny`: 1 errors occurred comparing output.
status: exit status: 0
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/lint/cli-lint-override.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--cfg" "force_warn_deny" "--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/lint/cli-lint-override.force_warn_deny" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "unstable-options" "--force-warn" "missing_abi" "--allow" "missing_abi" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/cli-lint-override.force_warn_deny/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
warning: extern declarations without an explicit ABI are deprecated
   |
LL | extern fn foo() {}
LL | extern fn foo() {}
   | ^^^^^^^^^^^^^^^^^^ ABI should be specified here
   |
   = note: requested on the command line with `--force-warn missing-abi`
   = help: the default ABI is C
warning: 1 warning emitted


------------------------------------------
------------------------------------------


---- [ui] ui/lint/cli-lint-override.rs#warn_deny stdout ----

2   --> $DIR/cli-lint-override.rs:12:1
3    |
4 LL | extern fn foo() {}
4 LL | extern fn foo() {}
-    | ^^^^^^^^^^^^^^^ ABI should be specified here
+    | ^^^^^^^^^^^^^^^^^^ ABI should be specified here
6    |
7    = note: requested on the command line with `-D missing-abi`
8    = help: the default ABI is C

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/lint/cli-lint-override.warn_deny/cli-lint-override.warn_deny.stderr
To only update this specific test, also pass `--test-args lint/cli-lint-override.rs`


error in revision `warn_deny`: 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/lint/cli-lint-override.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--cfg" "warn_deny" "--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/lint/cli-lint-override.warn_deny" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--warn" "missing_abi" "--deny" "missing_abi" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lint/cli-lint-override.warn_deny/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error: extern declarations without an explicit ABI are deprecated
   |
LL | extern fn foo() {}
LL | extern fn foo() {}
   | ^^^^^^^^^^^^^^^^^^ ABI should be specified here
   |
   = note: requested on the command line with `-D missing-abi`
   = help: the default ABI is C
error: aborting due to previous error


------------------------------------------
---
test result: FAILED. 11973 passed; 3 failed; 103 ignored; 0 measured; 0 filtered out; finished in 124.93s



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:12:48

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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.