This repository was archived by the owner on Nov 24, 2023. It is now read-only.
File tree 5 files changed +41
-12
lines changed
5 files changed +41
-12
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ pub fn run() -> Result<(), Error> {
104
104
if let Some ( "2018" ) = matches. value_of ( "edition" ) {
105
105
info ! ( "edition upgrade!" ) ;
106
106
let mut rustc_flags = env:: var_os ( "RUSTFLAGS" ) . unwrap_or_else ( || "" . into ( ) ) ;
107
- rustc_flags. push ( "-W rust-2018-compatibility" ) ;
107
+ rustc_flags. push ( " -W rust-2018-compatibility" ) ;
108
108
cmd. env ( "RUSTFLAGS" , & rustc_flags) ;
109
109
}
110
110
Original file line number Diff line number Diff line change @@ -356,6 +356,7 @@ mod broken_build;
356
356
mod broken_lints;
357
357
mod dependencies;
358
358
mod edition_upgrade;
359
+ mod rust_flags;
359
360
mod smoke;
360
361
mod subtargets;
361
362
mod vcs;
Original file line number Diff line number Diff line change
1
+ use super :: project;
2
+
3
+ #[ test]
4
+ fn specify_rustflags ( ) {
5
+ let p = project ( )
6
+ . file (
7
+ "src/lib.rs" ,
8
+ r#"
9
+ #![allow(unused)]
10
+ #![feature(rust_2018_preview)]
11
+
12
+ mod foo {
13
+ pub const FOO: &str = "fooo";
14
+ }
15
+
16
+ fn main() {
17
+ let x = ::foo::FOO;
18
+ }
19
+ "# ,
20
+ )
21
+ . build ( ) ;
22
+
23
+ let stderr = "\
24
+ [CHECKING] foo v0.1.0 (CWD)
25
+ [FIXING] src/lib.rs (1 fix)
26
+ [FINISHED] dev [unoptimized + debuginfo]
27
+ " ;
28
+
29
+ p. expect_cmd ( "cargo-fix fix --prepare-for 2018" )
30
+ . env ( "RUSTFLAGS" , "-C target-cpu=native" )
31
+ . stdout ( "" )
32
+ . stderr ( stderr)
33
+ . run ( ) ;
34
+ }
Original file line number Diff line number Diff line change @@ -105,9 +105,7 @@ fn preserve_line_endings() {
105
105
)
106
106
. build ( ) ;
107
107
108
- p. expect_cmd ( "cargo-fix fix" )
109
- . fix_everything ( )
110
- . run ( ) ;
108
+ p. expect_cmd ( "cargo-fix fix" ) . fix_everything ( ) . run ( ) ;
111
109
assert ! ( p. read( "src/lib.rs" ) . contains( "\r \n " ) ) ;
112
110
}
113
111
@@ -123,9 +121,7 @@ fn fix_deny_warnings() {
123
121
)
124
122
. build ( ) ;
125
123
126
- p. expect_cmd ( "cargo-fix fix" )
127
- . fix_everything ( )
128
- . run ( ) ;
124
+ p. expect_cmd ( "cargo-fix fix" ) . fix_everything ( ) . run ( ) ;
129
125
}
130
126
131
127
#[ test]
@@ -146,9 +142,7 @@ fn fix_deny_warnings_but_not_others() {
146
142
)
147
143
. build ( ) ;
148
144
149
- p. expect_cmd ( "cargo-fix fix" )
150
- . fix_everything ( )
151
- . run ( ) ;
145
+ p. expect_cmd ( "cargo-fix fix" ) . fix_everything ( ) . run ( ) ;
152
146
assert ! ( !p. read( "src/lib.rs" ) . contains( "let mut x = 3;" ) ) ;
153
147
assert ! ( p. read( "src/lib.rs" ) . contains( "fn bar() {}" ) ) ;
154
148
}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ enum State {
14
14
15
15
impl State {
16
16
fn is_inserted ( & self ) -> bool {
17
- if let & State :: Inserted ( ..) = self {
17
+ if let State :: Inserted ( ..) = * self {
18
18
true
19
19
} else {
20
20
false
@@ -26,7 +26,7 @@ impl State {
26
26
struct Span {
27
27
/// Start of this span in parent data
28
28
start : usize ,
29
- /// up to end inculding
29
+ /// up to end including
30
30
end : usize ,
31
31
data : State ,
32
32
}
You can’t perform that action at this time.
0 commit comments