@@ -518,14 +518,10 @@ fn clippy_disable_docs_links() -> Result<String> {
518518}
519519
520520#[ allow( clippy:: unwrap_used) ]
521- #[ cfg( test) ]
521+ #[ cfg( all ( test, __library_packages ) ) ]
522522mod test {
523523 use super :: * ;
524- use dylint_internal:: examples;
525- use std:: {
526- env:: { join_paths, set_var} ,
527- sync:: Mutex ,
528- } ;
524+ use std:: sync:: Mutex ;
529525
530526 // smoelius: With the upgrade to nightly-2023-03-10, I started running into this:
531527 // https://github.com/rust-lang/rustup/issues/988
@@ -535,7 +531,7 @@ mod test {
535531 static OPTS : Lazy < opts:: Dylint > = Lazy :: new ( || opts:: Dylint {
536532 operation : opts:: Operation :: Check ( opts:: Check {
537533 lib_sel : opts:: LibrarySelection {
538- no_metadata : true ,
534+ manifest_path : Some ( String :: from ( "../fixtures/name_toolchain_map/Cargo.toml" ) ) ,
539535 ..Default :: default ( )
540536 } ,
541537 ..Default :: default ( )
@@ -544,27 +540,6 @@ mod test {
544540 } ) ;
545541
546542 fn name_toolchain_map ( ) -> NameToolchainMap < ' static > {
547- examples:: build ( ) . unwrap ( ) ;
548- let metadata = dylint_internal:: cargo:: current_metadata ( ) . unwrap ( ) ;
549- // smoelius: As of version 0.1.14, `cargo-llvm-cov` no longer sets `CARGO_TARGET_DIR`.
550- // So `dylint_library_path` no longer requires a `cfg!(coverage)` special case.
551- let dylint_library_path = join_paths ( [
552- metadata. target_directory . join ( "examples/debug" ) ,
553- metadata. target_directory . join ( "straggler/debug" ) ,
554- ] )
555- . unwrap ( ) ;
556-
557- #[ rustfmt:: skip]
558- // smoelius: Following the upgrade nightly-2023-08-24, I started seeing the following error:
559- //
560- // error: internal compiler error: encountered incremental compilation error with shallow_lint_levels_on(dylint_internal[...]::cargo::{use#15})
561- // |
562- // = help: This is a known issue with the compiler. Run `cargo clean -p dylint_internal` or `cargo clean` to allow your project to compile
563- // = note: Please follow the instructions below to create a bug report with the provided information
564- // = note: See <https://github.com/rust-lang/rust/issues/84970> for more information
565- set_var ( env:: CARGO_INCREMENTAL , "0" ) ;
566- set_var ( env:: DYLINT_LIBRARY_PATH , dylint_library_path) ;
567-
568543 NameToolchainMap :: new ( & OPTS )
569544 }
570545
0 commit comments