File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ fn smoke_test_inputs() {
47
47
dbg ! ( cargo_encoded_rustflags( ) ) ;
48
48
dbg ! ( cargo_feature( "unstable" ) ) ;
49
49
dbg ! ( cargo_manifest_dir( ) ) ;
50
+ dbg ! ( cargo_manifest_path( ) ) ;
50
51
dbg ! ( cargo_manifest_links( ) ) ;
51
52
dbg ! ( cargo_pkg_authors( ) ) ;
52
53
dbg ! ( cargo_pkg_description( ) ) ;
Original file line number Diff line number Diff line change @@ -29,6 +29,18 @@ pub fn cargo_manifest_dir() -> PathBuf {
29
29
to_path ( var_or_panic ( "CARGO_MANIFEST_DIR" ) )
30
30
}
31
31
32
+ /// The path to the manifest of your package.
33
+ #[ track_caller]
34
+ pub fn cargo_manifest_path ( ) -> PathBuf {
35
+ var_os ( "CARGO_MANIFEST_PATH" )
36
+ . map ( to_path)
37
+ . unwrap_or_else ( || {
38
+ let mut path = cargo_manifest_dir ( ) ;
39
+ path. push ( "Cargo.toml" ) ;
40
+ path
41
+ } )
42
+ }
43
+
32
44
/// The manifest `links` value.
33
45
#[ track_caller]
34
46
pub fn cargo_manifest_links ( ) -> Option < String > {
You can’t perform that action at this time.
0 commit comments