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

Closed
wants to merge 26 commits into from
Closed

Conversation

Dylan-DPC
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

ChrisDenton and others added 26 commits February 18, 2023 19:13
This can be done by simply changing the `\??\` prefix to `\\?\` and then attempting to convert to a user path.

Currently it simply strips off the prefix which could lead to the wrong path being returned (e.g. if it's not a drive path or if the path contains trailing spaces, etc).
This change makes it so, instead of mixing string distance with
type unification, function signature search works by
mapping names to IDs at the start, reporting to the user any
cases where it had to make corrections, and then matches with
IDs when going through the items.

This only changes function searches. Name searches are left alone,
and corrections are only done when there's a single item in the
search query.
The suggestion given by `FIXME` to use `CompilerMetadata` for
`download_toolchain` in `bootstrap::download` can result in more
confusion. This is because `stamp_key` is not always a date; it
can also be a commit hash. Additionally, unlike in `download_beta_toolchain`,
in the `download_ci_rustc` function, `version` and `commit` values
are calculated separately.

Signed-off-by: ozkanonur <[email protected]>
Because it then just has to be filtered out.

This change makes this test more like these other tests:
- tests/ui/treat-err-as-bug/err.rs
- tests/ui/treat-err-as-bug/delay_span_bug.rs
- tests/ui/mir/validate/storage-live.rs
- tests/ui/associated-inherent-types/bugs/ice-substitution.rs
- tests/ui/layout/valid_range_oob.rs
This test is supposed to ensure that full backtraces are used for ICEs.
But it doesn't actually do that -- the filtering done cannot distinguish
between a full backtrace versus a short backtrace.

So this commit changes the filtering to preserve the existence of
`__rust_{begin,end}_short_backtrace` markers, which only appear in full
backtraces. This change means the test now tests what it is supposed to
test.

Also, the existing filtering included a rule that excluded any line
starting with two spaces. This was too strong because it filtered out
some parts of the error message. (This was not a showstopper). It was
also not strong enough because it didn't work with three digit stack
frame numbers, which just started seeing after upgrading my Ubuntu
distro to 23.04 machine (this *was* a showstopper).

So the commit replaces that rule with two more precise rules, one for
lines with stack frame numbers, and one for "at ..." lines.
I don't like the current wording. It's obnoxious to be told by a bot
that a change I made intentionally is "probably unintentional"! I also
don't like describing unintentional changes as "Random", it's not the
right word.
Correctly convert an NT path to a Win32 path in `read_link`

This can be done by simply changing the `\??\` prefix to `\\?\`.

Currently it strips off the prefix which could lead to the wrong path being returned (e.g. if it's not a drive path or if the path contains trailing spaces, etc).

r? libs
…ister,wesleywiser

Stabilize raw-dylib, link_ordinal, import_name_type and -Cdlltool

This stabilizes the `raw-dylib` feature (rust-lang#58713) for all architectures (i.e., `x86` as it is already stable for all other architectures).

Changes:
* Permit the use of the `raw-dylib` link kind for x86, the `link_ordinal` attribute and the `import_name_type` key for the `link` attribute.
* Mark the `raw_dylib` feature as stable.
* Stabilized the `-Zdlltool` argument as `-Cdlltool`.
* Note the path to `dlltool` if invoking it failed (we don't need to do this if `dlltool` returns an error since it prints its path in the error message).
* Adds tests for `-Cdlltool`.
* Adds tests for being unable to find the dlltool executable, and dlltool failing.
* Fixes a bug where we were checking the exit code of dlltool to see if it failed, but dlltool always returns 0 (indicating success), so instead we need to check if anything was written to `stderr`.

NOTE: As previously noted (rust-lang#104218 (comment)) using dlltool within rustc is temporary, but this is not the first time that Rust has added a temporary tool use and argument: rust-lang#104218 (comment)

Big thanks to ```@tbu-``` for the first version of this PR (rust-lang#104218)
…ions, r=GuillaumeGomez

rustdoc: restructure type search engine to pick-and-use IDs

Fixes rust-lang#110029

Preview: https://notriddle.com/rustdoc-demo-html-3/search-corrections/std/index.html?search=-%3E%20streaming

![image](https://user-images.githubusercontent.com/1593513/233494900-ae77d5b4-e395-41f8-bbac-53ee55bb4a76.png)

This change makes it so, instead of mixing string distance with type unification, function signature search works by mapping names to IDs at the start, reporting to the user any cases where it had to make corrections, and then matches with IDs when going through the items.

This only changes function searches. Name searches are left alone, and corrections are only done when there's a single item in the search query.
avoid duplicating TLS state between test std and realstd

This basically re-lands rust-lang#100201 and rust-lang#106638, which got reverted by rust-lang#110861. This works around 2 Miri limitations:
- Miri doesn't support the magic linker section that our Windows TLS support relies on, and instead knows where in std to find the symbol that stores the thread callback.
- For macOS, Miri only supports at most one destructor to be registered per thread.

The 2nd would not be very hard to fix (though the intended destructor order is unclear); the first would be a lot of work to fix. Neither of these is a problem for regular Rust code, but in the std test suite we have essentially 2 copies of the std code and then these both become issues. To avoid that we have the std test crate import the TLS code from the real std instead of having its own copy.

r? ```@m-ou-se```
…t, r=tmiasko

Encode def span for foreign return-position `impl Trait` in trait

Fixes rust-lang#111031, yet another def-span encoding issue :/

Includes a smaller repro than the issue, but I can confirm it ICEs:

```
query stack during panic:
#0 [def_span] looking up span for `rpitit::Foo::bar::{opaque#0}`
#1 [object_safety_violations] determining object safety of trait `rpitit::Foo`
rust-lang#2 [check_is_object_safe] checking if trait `rpitit::Foo` is object safe
rust-lang#3 [typeck] type-checking `main`
rust-lang#4 [used_trait_imports] finding used_trait_imports `main`
rust-lang#5 [analysis] running analysis passes on this crate
```

Luckily since this only affects nightly, this desn't need to be backported.
Fix problems with backtraces in two ui tests.

`default-backtrace-ice.rs` started started failing for me recently,
because on my Ubuntu 23.04 system there are 100 stack frames, and the
current stack filtering pattern doesn't match on a stack frame with a
three digit number.

`issue-86800.rs` can also be improved, backtrace-wise.

r? `@Nilstrieb`
…r=albertlarsan68

remove pointless `FIXME` in `bootstrap::download`

The suggestion given by `FIXME` to use `CompilerMetadata` for `download_toolchain` in `bootstrap::download` can result in more confusion. This is because `stamp_key` is not always a date; it can also be a commit hash. Additionally, unlike in `download_beta_toolchain`, in the `download_ci_rustc` function, `version` and `commit` values are calculated separately.
Don't suffix `RibKind` variants

This PR
- Removes `use RibKind::*`
- Renames `RibKind::{SomethingRibKind => Something}`

It seems unnecessary to have "RibKind" in the end of all variants, if we can just use it as a normal enum. Additionally previously it was weird that `MacroDefinition` is the only unsuffixed variant.
…errors

Add some triagebot notifications for nnethercote.

r? `@compiler-errors`
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself 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) labels May 3, 2023
@rustbot rustbot added 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels May 3, 2023
@Dylan-DPC
Copy link
Member Author

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 3, 2023
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking miniz_oxide v0.6.2
    Checking std_detect v0.1.5 (/checkout/library/stdarch/crates/std_detect)
    Checking object v0.30.1
    Checking addr2line v0.19.0
error[E0277]: a value of type `&Path` cannot be built from an iterator over elements of type `u16`
    --> library/std/src/sys/windows/fs.rs:545:87
     |
545  |                 let user = super::args::to_user_path(subst.iter().copied().chain([0]).collect())?;
     |                                                                                       ^^^^^^^ value of type `&Path` cannot be built from `std::iter::Iterator<Item=u16>`
     = help: the trait `core::iter::FromIterator<u16>` is not implemented for `&Path`
note: the method call chain might not have had the expected associated types
    --> library/std/src/sys/windows/fs.rs:545:67
     |
     |
538  |             let subst = slice::from_raw_parts_mut(subst_ptr, subst_len as usize);
     |                         -------------------------------------------------------- this expression has type `&mut [u16]`
...
545  |                 let user = super::args::to_user_path(subst.iter().copied().chain([0]).collect())?;
     |                                                            ------ ^^^^^^^^ ---------- `Iterator::Item` remains `u16` here
     |                                                            |      |
     |                                                            |      `Iterator::Item` changed to `u16` here
     |                                                            `Iterator::Item` is `&u16` here
    --> /checkout/library/core/src/iter/traits/iterator.rs:1891:19
     |
     |
1891 |     fn collect<B: FromIterator<Self::Item>>(self) -> B
     |                   ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `std` (lib) due to previous error
Build completed unsuccessfully in 0:00:12

@bors
Copy link
Contributor

bors commented May 4, 2023

☔ The latest upstream changes (presumably #111153) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC Dylan-DPC closed this May 18, 2023
@Dylan-DPC Dylan-DPC deleted the rollup-th2ih5l branch May 18, 2023 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.