Skip to content

Support normalization of $SRC_DIR #198

Closed
@jebrosen

Description

@jebrosen

Rocket's CI has been broken for a while because of UI test diffs like this:

 error[E0277]: the trait bound `usize: rocket::response::Responder<'_>` is not satisfied
-  --> $DIR/responder-types.rs:38:13
-   |
-38 | fn foo() -> usize { 0 }
-   |             ^^^^^ the trait `rocket::response::Responder<'_>` is not implemented for `usize`
-   |
-   = note: required by `rocket::handler::<impl rocket::Outcome<rocket::Response<'r>, rocket::http::Status, rocket::Data>>::from`
+   --> $DIR/responder-types.rs:38:13
+    |
+38  | fn foo() -> usize { 0 }
+    |             ^^^^^ the trait `rocket::response::Responder<'_>` is not implemented for `usize`
+    | 
+   ::: /Users/runner/runners/2.159.2/work/1/s/core/lib/src/handler.rs:202:20
+    |
+202 |     pub fn from<T: Responder<'r>>(req: &Request<'_>, responder: T) -> Outcome<'r> {
+    |                    ------------- required by this bound in `rocket::handler::<impl rocket::Outcome<rocket::Response<'r>, rocket::http::Status, rocket::Data>>::from`

The new annotations appear to be introduced by rust-lang/rust#64151, in which $SRC_DIR has been used to normalize similarly added paths in the output (e.g. https://github.com/rust-lang/rust/pull/64151/files#diff-4b63aaabf76aa70969c04a1a4185c421R7).

$SRC_DIR normalization was added to rustc in rust-lang/rust#50943 but it doesn't appear to be supported in compiletest - this means that it is not currently possible for these errors to be properly tested both in CI and locally, as each run ends up with files in a different path.

If the same change from rust-lang/rust#50943 is likely to be usable (and accepted) here, I'd be happy to make that pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions