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 6 pull requests #98347

Closed
wants to merge 19 commits into from
Closed

Conversation

Dylan-DPC
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

lcnr and others added 19 commits June 8, 2022 12:41
Add `struct FileTimes` to contain the relevant file timestamps, since
most platforms require setting all of them at once. (This also allows
for future platform-specific extensions such as setting creation time.)

Add `File::set_file_time` to set the timestamps for a `File`.

Implement the `sys` backends for UNIX, macOS (which needs to fall back
to `futimes` before macOS 10.13 because it lacks `futimens`), Windows,
and WASI.
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
Arms are about TAIT and RPIT, as the variants clearly show.
…=jsha

Add macro support in jump to definition feature

Fixes rust-lang#91174.

To do so, I check if the span comes from an expansion, and if so, I infer the original macro `DefId` or `Span` depending if it's a defined in the current crate or not.

There is one limitation due to macro expansion though:

```rust
macro_rules! yolo { () => {}}

fn foo() {
    yolo!();
}
```

In `foo`, `yolo!` won't be linked because after expansion, it is replaced by nothing (which seems logical). So I can't get an item from the `Visitor` from which I could tell if its `Span` comes from an expansion.

I added a test for this specific limitation alongside others.

Demo: https://rustdoc.crud.net/imperio/macro-jump-to-def/src/foo/check-source-code-urls-to-def-std.rs.html

As for the empty macro issue that cannot create a jump to definition, you can see it [here](https://rustdoc.crud.net/imperio/macro-jump-to-def/src/foo/check-source-code-urls-to-def-std.rs.html#35).

r? ``@jyn514``
lub: don't bail out due to empty binders

allows for the following to compile. The equivalent code using `struct Wrapper<'upper>(fn(&'upper ());` already compiles on stable.
```rust
let _: fn(&'upper ()) = match v {
    true => lt_in_fn::<'a>(),
    false => lt_in_fn::<'b>(),
};
```
see https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=7034a677190110941223cafac6632f70 for a complete example

r? ``@rust-lang/types``
…impl-nll, r=cjgillot

Give name if anonymous region appears in impl signature

Fixes rust-lang#98170

We probably should remove the two unwraps in [`report_general_error`](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_borrowck/diagnostics/region_errors.rs.html#683-685), but I have no idea what to provide if those regions are missing, so I've kept those in. Let me know if I should try harder to remove those.
Support setting file accessed/modified timestamps

Add `struct FileTimes` to contain the relevant file timestamps, since
most platforms require setting all of them at once. (This also allows
for future platform-specific extensions such as setting creation time.)

Add `File::set_file_time` to set the timestamps for a `File`.

Implement the `sys` backends for UNIX, macOS (which needs to fall back
to `futimes` before macOS 10.13 because it lacks `futimens`), Windows,
and WASI.
…rrors

Add a full regression test for rust-lang#73727

Closes rust-lang#73727

This also moves a test to the `issues` directory as it's also tested on the adt_const_params feature.

r? ``@compiler-errors``

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
…t, r=oli-obk

This comment is out dated and misleading, the arm is about TAITs

r? ``@oli-obk``

``@oli-obk`` unsure if you want to add a different comment of some sort.

``@bors`` rollup=always
@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 Jun 21, 2022
@Dylan-DPC
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Jun 21, 2022

📌 Commit 9bf095d has been approved by Dylan-DPC

@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 Jun 21, 2022
@bors
Copy link
Contributor

bors commented Jun 21, 2022

⌛ Testing commit 9bf095d with merge 9d30b81ca309ab1adcb0048cf530e4f09fa78bad...

@bors
Copy link
Contributor

bors commented Jun 21, 2022

💔 Test failed - checks-actions

@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 Jun 21, 2022
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 21, 2022
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-apple-2 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
      Memory: 14 GB
      System Firmware Version: VMW71.00V.13989454.B64.1906190538
      Apple ROM Info: [MS_VM_CERT/SHA1/27d66596a61c48dd3dc7216fd715126e33f59ae7]Welcome to the Virtual Machine
      SMC Version (system): 2.8f0
      Serial Number (system): VM/nlACvQ1R9
      Provisioning UDID: 4203018E-580F-C1B5-9525-B745CECA79EB

hw.ncpu: 3
hw.byteorder: 1234
---
   Compiling addr2line v0.16.0
[RUSTC-TIMING] addr2line test:false 1.015
[RUSTC-TIMING] gimli test:false 12.157
[RUSTC-TIMING] object test:false 10.355
error: expected one of `async`, `move`, `|`, or `||`, found `DLSYM`
     |
75   | / pub(crate) macro dlsym {
76   | |     (fn $name:ident($($t:ty),*) -> $ret:ty) => (
76   | |     (fn $name:ident($($t:ty),*) -> $ret:ty) => (
77   | |          dlsym!(fn $name($($t),*) -> $ret, stringify!($name));
78   | |     ),
78   | |     ),
79   | |     (fn $name:ident($($t:ty),*) -> $ret:ty, $sym:expr) => (
80   | |         static DLSYM: DlsymWeak<unsafe extern "C" fn($($t),*) -> $ret> =
     | |                ^^^^^ expected one of `async`, `move`, `|`, or `||`
83   | |     )
84   | | }
     | | -
     | | |
     | | |
     | |_in this expansion of `weak!` (#1)
     |   in this expansion of `dlsym!` (#2)
    ::: library/std/src/sys/unix/fs.rs:1073:36
     |
     |
1073 |                       let futimens = weak!(fn futimens(c_int, *const libc::timespec) -> c_int);
     |
     = note: the macro call doesn't expand to an expression, but it can expand to a statement
     = note: the macro call doesn't expand to an expression, but it can expand to a statement
help: add `;` to interpret the expansion as a statement
     |
77   |          dlsym!(fn $name($($t),*) -> $ret, stringify!($name));;

error: trailing semicolon in macro used in expression position
    --> library/std/src/sys/unix/weak.rs:77:62
     |
     |
75   | / pub(crate) macro dlsym {
76   | |     (fn $name:ident($($t:ty),*) -> $ret:ty) => (
77   | |          dlsym!(fn $name($($t),*) -> $ret, stringify!($name));
78   | |     ),
...    |
83   | |     )
84   | | }
84   | | }
     | |_- in this expansion of `weak!`
     |
    ::: library/std/src/sys/unix/fs.rs:1073:36
     |
1073 |                       let futimens = weak!(fn futimens(c_int, *const libc::timespec) -> c_int);
     |
     |
     = note: `-D semicolon-in-expressions-from-macros` implied by `-D warnings`
     = note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>

error[E0308]: mismatched types
    --> library/std/src/sys/unix/fs.rs:1077:54
    --> library/std/src/sys/unix/fs.rs:1077:54
     |
1077 | ...                   let timevals = [ts_to_tv(times.0[0]), ts_to_tv(times.0[1])];
     |                                       |        |
     |                                       |        expected `&timespec`, found struct `timespec`
     |                                       |        help: consider borrowing here: `&times.0[0]`
     |                                       arguments to this function are incorrect
     |                                       arguments to this function are incorrect
     |
note: function defined here
    --> library/std/src/sys/unix/fs.rs:1069:20
     |
1069 |                 fn ts_to_tv(ts: &libc::timespec) -> libc::timeval {

error[E0308]: mismatched types
    --> library/std/src/sys/unix/fs.rs:1077:76
     |
     |
1077 | ...                   let timevals = [ts_to_tv(times.0[0]), ts_to_tv(times.0[1])];
     |                                                             |        |
     |                                                             |        expected `&timespec`, found struct `timespec`
     |                                                             |        help: consider borrowing here: `&times.0[1]`
     |                                                             arguments to this function are incorrect
     |                                                             arguments to this function are incorrect
     |
note: function defined here
    --> library/std/src/sys/unix/fs.rs:1069:20
     |
1069 |                 fn ts_to_tv(ts: &libc::timespec) -> libc::timeval {

error[E0308]: mismatched types
    --> library/std/src/sys/unix/fs.rs:1070:65
     |
     |
1070 |                     libc::timeval { tv_sec: ts.tv_sec, tv_usec: ts.tv_nsec / 1000 }
     |                                                                 ^^^^^^^^^^^^^^^^^ expected `i32`, found `i64`
For more information about this error, try `rustc --explain E0308`.
[RUSTC-TIMING] std test:false 3.894
error: could not compile `std` due to 5 previous errors
Build completed unsuccessfully in 0:01:05

@JohnTitor
Copy link
Member

Failed by #98246, closing.

@JohnTitor JohnTitor closed this Jun 21, 2022
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. 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.

10 participants