File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -886,7 +886,18 @@ impl<'a> Builder<'a> {
886886 // things still build right, please do!
887887 match mode {
888888 Mode :: Std => metadata. push_str ( "std" ) ,
889- _ => { } ,
889+ // When we're building rustc tools, they're built with a search path
890+ // that contains things built during the rustc build. For example,
891+ // bitflags is built during the rustc build, and is a dependency of
892+ // rustdoc as well. We're building rustdoc in a different target
893+ // directory, though, which means that Cargo will rebuild the
894+ // dependency. When we go on to build rustdoc, we'll look for
895+ // bitflags, and find two different copies: one built during the
896+ // rustc step and one that we just built. This isn't always a
897+ // problem, somehow -- not really clear why -- but we know that this
898+ // fixes things.
899+ Mode :: ToolRustc => metadata. push_str ( "tool-rustc" ) ,
900+ _ => { }
890901 }
891902 cargo. env ( "__CARGO_DEFAULT_LIB_METADATA" , & metadata) ;
892903
You can’t perform that action at this time.
0 commit comments