Skip to content

Test failure when enabling vendoring #123688

Closed
@filnet

Description

@filnet

When configuring the build with --enable-vendor, the ui\issues\issue-21763.rs fails as follows:

---- [ui] tests\ui\issues\issue-21763.rs stdout ----
$DIR\issue-21763.rs
\M\mingw-w64-rust\src\rustc-1.77.1-src\vendor\hashbrown\src\map.rs
$SRC_DIR\std\src\collections\hash\map.rs
$DIR\issue-21763.rs
diff of stderr:

8	   = note: required because it appears within the type `(Rc<()>, Rc<()>)`
9	   = note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send`
10	note: required because it appears within the type `hashbrown::map::HashMap<Rc<()>, Rc<()>, RandomState>`
-	  --> $HASHBROWN_SRC_LOCATION
+	  --> C:/M/mingw-w64-rust/src/rustc-1.77.1-src/vendor/hashbrown/src/map.rs:190:12
+	   |
+	LL | pub struct HashMap<K, V, S = DefaultHashBuilder, A: Allocator = Global> {
+	   |            ^^^^^^^
12	note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>`
13	  --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
14	note: required by a bound in `foo`

The test itself is:

// Regression test for HashMap only impl'ing Send/Sync if its contents do

// normalize-stderr-test: "\S+hashbrown-\S+" -> "$$HASHBROWN_SRC_LOCATION"

use std::collections::HashMap;
use std::rc::Rc;

fn foo<T: Send>() {}

fn main() {
    foo::<HashMap<Rc<()>, Rc<()>>>();
    //~^ ERROR `Rc<()>` cannot be sent between threads safely
}

The cause of the failure is that normalization of the std err output is not done properly.
The normalization regex "\S+hashbrown-\S+" is expecting a versioned hashbrown crate but the vendoring adds a non versioned crate that is picked up when running the test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions