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 11 pull requests #119747

Closed
wants to merge 24 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Laura7089 and others added 24 commits January 5, 2024 02:36
The output is produced by printf from C code in these cases, and printf prints in text mode, which means `\n` will be printed as `\r\n` on Windows.
In --bless mode the new output with `\r\n` will replace expected output in `tests/run-make/raw-dylib-*\output.txt` files, which use \n, always resulting in dirty files in the repo.
The code for anonymizing line numbers in coverage reports now supports the
slightly different line number syntax used by branch regions.
The standard library's std::sync::mpsc basically is a crossbeam channel,
and for the use case here will definitely suffice. This drops this
dependency from librustc_driver.
When writing a no_std binary, you'll be greeted with nonsensical errors
mentioning lang items like eh_personality and start. That's pretty bad
because it makes you think that you need to define them somewhere! But
oh no, now you're getting the `internal_features` lint telling you that
you shouldn't use them! But you need a no_std binary! What now?

No problem! Writing a no_std binary is super easy. Just use panic=abort
and supply your own platform specific entrypoint symbol (like `main`)
and you're good to go. Would be nice if the compiler told you that,
right?

This makes it so that it does do that.
…he-weird-lang-items-just-saying, r=bjorn3

Stop mentioning internal lang items in no_std binary errors

When writing a no_std binary, you'll be greeted with nonsensical errors mentioning lang items like eh_personality and start. That's pretty bad because it makes you think that you need to define them somewhere! But oh no, now you're getting the `internal_features` lint telling you that you shouldn't use them! But you need a no_std binary! What now?

No problem! Writing a no_std binary is super easy. Just use panic=abort and supply your own platform specific entrypoint symbol (like `main`) and you're good to go. Would be nice if the compiler told you that, right?

This makes it so that it does do that.

I don't _love_ the new messages yet, but they're decent I think. They can probably be improved, please suggest improvements.
…ebuginfo.rs, r=petrochenkov

Improved support of collapse_debuginfo attribute for macros.

Added walk_chain_collapsed function to consider collapse_debuginfo attribute in parent macros in call chain.
Fixed collapse_debuginfo attribute processing for cranelift (there was if/else branches error swap).

cc rust-lang#100758
coverage: `llvm-cov` expects column numbers to be bytes, not code points

Normally the compiler emits column numbers as a 1-based number of Unicode code points.

But when we embed coverage mappings for `-Cinstrument-coverage`, those mappings will ultimately be read by the `llvm-cov` tool. That tool assumes that column numbers are 1-based numbers of *bytes*, and relies on that assumption when slicing up source code to apply highlighting (in HTML reports, and in text-based reports with colour).

For the very common case of all-ASCII source code, bytes and code points are the same, so the difference isn't noticeable. But for code that contains non-ASCII characters, emitting column numbers as code points will result in `llvm-cov` slicing strings in the wrong places, producing mangled output or fatal errors.

(See taiki-e/cargo-llvm-cov#275 as an example of what can go wrong.)
remove an unnecessary stderr-per-bitwidth

also update some regexp, `a(lloc)?` would no longer match now that we have compiletest itself do alloc ID normalization.

r? ```@oli-obk```
…lacrum

tests: Normalize `\r\n` to `\n` in some run-make tests

The output is produced by printf from C code in these cases, and printf prints in text mode, which means `\n` will be printed as `\r\n` on Windows.

In --bless mode the new output with `\r\n` will replace expected output in `tests/run-make/raw-dylib-*\output.txt` files, which use \n, always resulting in dirty files in the repo.
coverage: Anonymize line numbers in branch views

Extracted from rust-lang#118305, as this is now the only part of that PR that needs to touch compiletest.

---

Coverage tests run the `llvm-cov` tool to generate a coverage report for a test program, and then compare the report against a known-good snapshot.

We use the `anonymize_coverage_line_numbers` function to replace line numbers in coverage reports with `LL`, so that they are less sensitive to lines being added or removed. This PR augments the existing code by making it also support the slightly different line number syntax used when reporting branch regions.

Currently the compiler never emits branch regions, so there is no way to write a coverage test that makes use of this new capability. Instead, I've added a unit test that checks against some sample reports taken from rust-lang#118305. That unit test can be removed when some form of branch coverage support gets merged, and real branch coverage tests are added to the coverage test suite.

(I have also manually tested this change as part of my draft branch-coverage PR.)
…re, r=Nilstrieb

Fix two variable binding issues in lint let_underscore

Fixes rust-lang#119696
Fixes rust-lang#119697
…r=fmease

Add helper for when we want to know if an item has a host param

r? ```@fmease``` since you're a good reviewer and no good deed goes unpunished

This helper will see far more usages as built-in traits get constified.
Add `riscv32imafc-esp-espidf` tier 3 target for the ESP32-P4.

The tier 3 target answers in the original PR are still relevant, so please review them here: rust-lang#87666 (comment)

cc: `@ivmarkov`
…davidtwco

Remove crossbeam-channel

The standard library's std::sync::mpsc basically is a crossbeam channel, and for the use case here will definitely suffice. This drops this dependency from librustc_driver.
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc 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. rollup A PR which is a rollup labels Jan 8, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=11

@bors
Copy link
Contributor

bors commented Jan 8, 2024

📌 Commit d608792 has been approved by matthiaskrgr

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 Jan 8, 2024
@bors
Copy link
Contributor

bors commented Jan 8, 2024

⌛ Testing commit d608792 with merge b1babda...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 8, 2024
…iaskrgr

Rollup of 11 pull requests

Successful merges:

 - rust-lang#116343 (Stop mentioning internal lang items in no_std binary errors)
 - rust-lang#118903 (Improved support of collapse_debuginfo attribute for macros.)
 - rust-lang#119033 (coverage: `llvm-cov` expects column numbers to be bytes, not code points)
 - rust-lang#119598 (Fix a typo in core::ops::Deref's doc)
 - rust-lang#119660 (remove an unnecessary stderr-per-bitwidth)
 - rust-lang#119663 (tests: Normalize `\r\n` to `\n` in some run-make tests)
 - rust-lang#119681 (coverage: Anonymize line numbers in branch views)
 - rust-lang#119704 (Fix two variable binding issues in lint let_underscore)
 - rust-lang#119725 (Add helper for when we want to know if an item has a host param)
 - rust-lang#119738 (Add `riscv32imafc-esp-espidf` tier 3 target for the ESP32-P4.)
 - rust-lang#119740 (Remove crossbeam-channel)

Failed merges:

 - rust-lang#119723 (Remove `-Zdont-buffer-diagnostics`.)

r? `@ghost`
`@rustbot` modify labels: rollup
@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/no_std/no-std-unwind-binary.rs stdout ----

error: ui test compiled successfully!
status: exit status: 0
command: RUSTC_ICE="0" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/no_std/no-std-unwind-binary.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=wasm32-unknown-unknown" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/no_std/no-std-unwind-binary" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/no_std/no-std-unwind-binary/auxiliary"
stderr: none



@bors
Copy link
Contributor

bors commented Jan 8, 2024

💔 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 Jan 8, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-cm6htwo branch March 16, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet