]> git.lizzy.rs Git - rust.git/commitdiff
Remove #![crate_name] attribute from libtest
authorbjorn3 <bjorn3@users.noreply.github.com>
Wed, 29 Dec 2021 15:36:08 +0000 (16:36 +0100)
committerbjorn3 <bjorn3@users.noreply.github.com>
Wed, 29 Dec 2021 15:36:08 +0000 (16:36 +0100)
The crate name is already set in Cargo.toml. The comment says there is
some logic in the compiler that reads #![crate_name] and not
--crate-name, but I can't find it. Removing it seems to work fine.

library/test/src/lib.rs

index 17e15243afd7673431ead36e9091df17c07ecc0b..1e8c63b69dbaf2ae39a9e2b5ea51dde8da4fc493 100644 (file)
 // running tests while providing a base that other test frameworks may
 // build off of.
 
-// N.B., this is also specified in this crate's Cargo.toml, but librustc_ast contains logic specific to
-// this crate, which relies on this attribute (rather than the value of `--crate-name` passed by
-// cargo) to detect this crate.
-
-#![crate_name = "test"]
 #![unstable(feature = "test", issue = "50297")]
 #![doc(test(attr(deny(warnings))))]
 #![feature(libc)]