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 7 pull requests #129256

Closed
wants to merge 18 commits into from

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

surechen and others added 18 commits July 23, 2024 10:24
For following:

```rust
struct A;
impl A {
    fn test4(&self) {
        let mut _file = File::create("foo.txt")?;
        //~^ ERROR the `?` operator can only be used in a method
    }
```
Suggest:

```rust
impl A {
    fn test4(&self) -> Result<(), Box<dyn std::error::Error>> {
        let mut _file = File::create("foo.txt")?;
        //~^ ERROR the `?` operator can only be used in a method

    Ok(())
    }
}
```

For rust-lang#125997
The documentation incorrectly stated that std::env::var could return
an error for variable names containing '=' or the NUL byte. Copy the
correct documentation from var_os.

var_os was fixed in Commit 8a7a665, Pull Request rust-lang#109894, which
closed Issue rust-lang#109893.

This documentation was incorrectly added in commit f2c0f29, which
replaced a panic in var_os by returning None, but documented the
change as "May error if ...".

Reference the specific error values and link to them.
... by using `std::fs::remove_dir_all`, which handles a bunch of edge
cases including read-only files and symlinks which are extremely tricky
on Windows.
During config parsing, some bootstrap logic (e.g., `download-ci-llvm`) checks certain sources
and acts based on their state. This means that if path is a git submodule, bootstrap needs to
update it before checking its state. Otherwise it may make incorrect assumptions by relying on
outdated sources. To enable submodule updates during config parsing, we need to move the `update_submodule`
function from the `Build` to `Config` instance, so we can access to it during the parsing process.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
It's only valid when applied to a type or lifetime parameter
in `Drop` trait implementation.
Suggest adding Result return type for associated method in E0277.

Recommit rust-lang#126515 because I messed up during rebase,

Suggest adding Result return type for associated method in E0277.

For following:

```rust
struct A;
impl A {
    fn test4(&self) {
        let mut _file = File::create("foo.txt")?;
        //~^ ERROR the `?` operator can only be used in a method
    }
```

Suggest:

```rust
impl A {
    fn test4(&self) -> Result<(), Box<dyn std::error::Error>> {
        let mut _file = File::create("foo.txt")?;
        //~^ ERROR the `?` operator can only be used in a method

    Ok(())
    }
}
```

For rust-lang#125997

r? ````@cjgillot````
…rkingjubilee

doc: std::env::var: Returns None for names with '=' or NUL byte

The documentation incorrectly stated that std::env::var could return an error for variable names containing '=' or the NUL byte. Copy the correct documentation from var_os.

var_os was fixed in Commit 8a7a665, Pull Request rust-lang#109894, which closed Issue rust-lang#109893.

This documentation was incorrectly added in commit f2c0f29, which replaced a panic in var_os by returning None, but documented the change as "May error if ...".

Reference the specific error values and link to them.
…links, r=Kobzol

bootstrap: fix clean's remove_dir_all implementation

It turns out bootstrap's `clean.rs`'s hand-rolled `rm_rf` (which probably comes before `std::fs::remove_dir_all` was stable) is very broken on native Windows around both read-only files/directories and especially symbolic links. So instead of rolling our own, just use `std::fs::remove_dir_all`.

This is a blocker for compiletest's own `rm_rf` implementation rust-lang#129155 which happens to be also buggy, which in turn is a blocker for the rmake.rs test port rust-lang#128562 that heavily exercises symlinks (I was reviewing rust-lang#128562 and testing it on native Windows which is how I found out).

I also left a FIXME for `detect_src_and_out` due to a failing assertion on native Windows (opened rust-lang#129188):

```
---- core::config::tests::detect_src_and_out stdout ----
thread 'core::config::tests::detect_src_and_out' panicked at src\core\config\tests.rs:72:13:
assertion `left == right` failed
  left: "E:\\tmp"
 right: "C:\\tmp"
```

Fixes rust-lang#112544 (because now we handle Windows symlinks properly).

try-job: x86_64-msvc
try-job: i686-mingw
try-job: test-various
try-job: armhf-gnu
try-job: aarch64-apple
try-job: aarch64-gnu
…ulacrum

Fix bootstrap test `detect_src_and_out` on Windows

Fixes rust-lang#129188 by making sure it's properly testing the right path for the platform.
…es, r=Mark-Simulacrum

improve submodule updates

During config parsing, some bootstrap logic (e.g., `download-ci-llvm`) checks certain sources (for `download-ci-llvm`, it's `src/llvm-project`) and acts based on their state. This means that if path is a git submodule, bootstrap needs to update it before checking its state. Otherwise it may make incorrect assumptions by relying on outdated sources. To enable submodule updates during config parsing, we need to move the `update_submodule` function from the `Build` to `Config`, so we can access to it during the parsing process.

Closes rust-lang#122787
…piler-errors

Check that `#[may_dangle]` is properly applied

It's only valid when applied to a type or lifetime parameter in `Drop` trait implementation.

Tracking issue: rust-lang#34761
cc rust-lang#34761 (comment)
@rustbot rustbot added 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 Aug 18, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Aug 18, 2024

📌 Commit a9919ec 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 Aug 18, 2024
@bors
Copy link
Contributor

bors commented Aug 19, 2024

⌛ Testing commit a9919ec with merge 0465e63...

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

Rollup of 7 pull requests

Successful merges:

 - rust-lang#128084 (Suggest adding Result return type for associated method in E0277.)
 - rust-lang#128902 (doc: std::env::var: Returns None for names with '=' or NUL byte)
 - rust-lang#129187 (bootstrap: fix clean's remove_dir_all implementation)
 - rust-lang#129194 (Fix bootstrap test `detect_src_and_out` on Windows)
 - rust-lang#129231 (improve submodule updates)
 - rust-lang#129235 (Check that `#[may_dangle]` is properly applied)
 - rust-lang#129245 (Typo)

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

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

Click to see the possible cause of the failure (guessed by this bot)
 Documenting bootstrap v0.0.0 (/checkout/src/bootstrap)
error: unresolved link to `Build::require_submodule`
    --> src/core/config/config.rs:2518:31
     |
2518 |     /// tarball). Typically [`Build::require_submodule`] should be
     |                               ^^^^^^^^^^^^^^^^^^^^^^^^ the struct `Build` has no field or associated item named `require_submodule`
     = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(rustdoc::broken_intra_doc_links)]`

error: could not document `bootstrap`
error: could not document `bootstrap`
Command has failed. Rerun with -v to see more details.
  local time: Mon Aug 19 01:57:38 UTC 2024
  network time: Mon, 19 Aug 2024 01:57:38 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@bors
Copy link
Contributor

bors commented Aug 19, 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 Aug 19, 2024
@jieyouxu
Copy link
Member

@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 Aug 19, 2024
@jieyouxu jieyouxu closed this Aug 19, 2024
@matthiaskrgr matthiaskrgr deleted the rollup-kzuxwb6 branch September 1, 2024 17:35
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-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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.