Skip to content

Conversation

@NanaHigh
Copy link

The UI test for tests/rustdoc-ui/issues/issue-98690.rs was failing because the expected stderr file still contained a "Permission denied" error that is no longer emitted by the test harness.

The test contains a doctest that attempts to use foo::dummy from a crate named foo, but the dummy function doesn't exist. This should produce an E0463 error for crate resolution failure, not a permission error.

Changes:

  • Updated tests/rustdoc-ui/issues/issue-98690.stderr to remove the outdated permission denied message
  • Added the correct E0463 error output that matches the actual test behavior

Before:

Couldn't create directory for doctest executables: Permission denied (os error 13)

After:

error[E0463]: can't find crate for `foo`
  --> $DIR/issue-98690.rs:3:1
   |
LL | extern crate r#foo;
   | ^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0463`.

This change aligns the test expectations with the current test harness behavior and ensures the UI test properly validates the E0463 crate resolution error that occurs when doctests reference non-existent dependencies.

…havior

- Remove outdated "Permission denied" error message from stderr file.
- Add correct E0463 error output that matches actual test behavior.
- Fix UI test for rustdoc doctest crate resolution failure.

Signed-off-by: Chongbing Yu <[email protected]>
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 19, 2025

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)

- error[E0463]: can't find crate for `foo`
-   --> $DIR/issue-98690.rs:3:1
-    |
- LL | extern crate r#foo;
-    | ^^^^^^^^^^^^^^^^^^^ can't find crate
- 
- error: aborting due to 1 previous error
- 
- For more information about this error, try `rustc --explain E0463`.
---
To only update this specific test, also pass `--test-args issues/issue-98690.rs`

error: 1 errors occurred comparing output.
status: exit status: 101
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustdoc" "/checkout/tests/rustdoc-ui/issues/issue-98690.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" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/rustdoc-ui/issues/issue-98690" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Cdebuginfo=0" "--test" "--persist-doctests" "/../../" "-Z" "unstable-options"
stdout: none
--- stderr -------------------------------
Couldn't create directory for doctest executables: Permission denied (os error 13)
------------------------------------------

@NanaHigh
Copy link
Author

May I ask if the strict directory permission management related to issue-98690 was implemented intentionally? The output on my local machine is not the same as described.

@fmease
Copy link
Member

fmease commented Sep 19, 2025

So on your machine std::fs::create_dir_all("/../name") returns Ok(()) instead of an error? What's your OS and your filesystem?

@GuillaumeGomez
Copy link
Member

/../ is completely valid on linux. :') /../../../ is considered as /.

@fmease
Copy link
Member

fmease commented Sep 19, 2025

Ah, I see :) So then the PR author has to have root privileges. Not sure how to adjust the test to account for that, lol. Tending towards WONTFIX :D

@NanaHigh
Copy link
Author

I see. Thank you for the explanation.

@NanaHigh NanaHigh closed this Sep 19, 2025
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

5 participants