File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -122,3 +122,35 @@ fn whitespace() {
122
122
let contents = p. read_file ( "target/doc/foo/index.html" ) ;
123
123
assert ! ( contents. contains( SPACED_VERSION ) ) ;
124
124
}
125
+
126
+ #[ cargo_test]
127
+ fn not_affected_by_target_rustflags ( ) {
128
+ let cfg = if cfg ! ( windows) { "windows" } else { "unix" } ;
129
+ let p = project ( )
130
+ . file ( "src/lib.rs" , "" )
131
+ . file (
132
+ ".cargo/config" ,
133
+ & format ! (
134
+ r#"
135
+ [target.'cfg({cfg})']
136
+ rustflags = ["-D", "missing-docs"]
137
+
138
+ [build]
139
+ rustdocflags = ["--cfg", "foo"]
140
+ "# ,
141
+ ) ,
142
+ )
143
+ . build ( ) ;
144
+
145
+ // `cargo build` should fail due to missing docs.
146
+ p. cargo ( "build -v" )
147
+ . with_status ( 101 )
148
+ . with_stderr_contains ( "[RUNNING] `rustc [..] -D missing-docs[..]`" )
149
+ . run ( ) ;
150
+
151
+ // This is wrong behaviour. `cargo doc` shouldn't fail.
152
+ p. cargo ( "doc -v" )
153
+ . with_status ( 101 )
154
+ . with_stderr_contains ( "[RUNNING] `rustdoc [..] -D missing-docs[..]`" )
155
+ . run ( ) ;
156
+ }
You can’t perform that action at this time.
0 commit comments