File tree Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -207,7 +207,10 @@ impl Shell {
207
207
208
208
/// Prints a red 'error' message.
209
209
pub fn error < T : fmt:: Display > ( & mut self , message : T ) -> CargoResult < ( ) > {
210
- self . print ( & "error:" , Some ( & message) , Red , false )
210
+ if self . needs_clear {
211
+ self . err_erase_line ( ) ;
212
+ }
213
+ self . err . print ( & "error:" , Some ( & message) , Red , false )
211
214
}
212
215
213
216
/// Prints an amber 'warning' message.
Original file line number Diff line number Diff line change @@ -2137,3 +2137,39 @@ fn ws_warn_path() {
2137
2137
. with_stderr_contains ( "[WARNING] [..]/foo/a/Cargo.toml: the cargo feature `edition`[..]" )
2138
2138
. run ( ) ;
2139
2139
}
2140
+
2141
+ #[ cargo_test]
2142
+ fn invalid_missing ( ) {
2143
+ // Warnings include path to manifest.
2144
+ let p = project ( )
2145
+ . file (
2146
+ "Cargo.toml" ,
2147
+ r#"
2148
+ [package]
2149
+ name = "foo"
2150
+ version = "0.1.0"
2151
+
2152
+ [dependencies]
2153
+ x = { path = 'x' }
2154
+ "# ,
2155
+ )
2156
+ . file ( "src/lib.rs" , "" )
2157
+ . build ( ) ;
2158
+
2159
+ p. cargo ( "build -q" )
2160
+ . with_status ( 101 )
2161
+ . with_stderr (
2162
+ "\
2163
+ error: [..]
2164
+
2165
+ Caused by:
2166
+ [..]
2167
+
2168
+ Caused by:
2169
+ [..]
2170
+
2171
+ Caused by:
2172
+ [..]" ,
2173
+ )
2174
+ . run ( ) ;
2175
+ }
You can’t perform that action at this time.
0 commit comments