You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/lib.rs
+44-34
Original file line number
Diff line number
Diff line change
@@ -1892,58 +1892,80 @@ impl Build {
1892
1892
1893
1893
letmut cmd = self.get_base_compiler()?;
1894
1894
1895
+
// The flags below are added in roughly the following order:
1896
+
// - 1. Default flags
1897
+
// - Controlled by `cc-rs`.
1898
+
// - 2. `rustc`-inherited flags
1899
+
// - Controlled by `rustc`.
1900
+
// - 3. Builder flags
1901
+
// - Controlled by the developer using `cc-rs` in e.g. their `build.rs`.
1902
+
// - 4. Environment flags
1903
+
// - Controlled by the end user.
1904
+
//
1905
+
// This is important to allow later flags to override previous ones.
1906
+
1907
+
// Copied from <https://github.com/rust-lang/rust/blob/5db81020006d2920fc9c62ffc0f4322f90bffa04/compiler/rustc_codegen_ssa/src/back/linker.rs#L27-L38>
1908
+
//
1909
+
// Disables non-English messages from localized linkers.
1910
+
// Such messages may cause issues with text encoding on Windows
1911
+
// and prevent inspection of msvc output in case of errors, which we occasionally do.
1912
+
// This should be acceptable because other messages from rustc are in English anyway,
1913
+
// and may also be desirable to improve searchability of the compiler diagnostics.
let warnings_to_errors_flag = cmd.family.warnings_to_errors_flag().into();
1966
-
cmd.push_cc_arg(warnings_to_errors_flag);
1967
-
}
1968
-
1969
-
// Copied from <https://github.com/rust-lang/rust/blob/5db81020006d2920fc9c62ffc0f4322f90bffa04/compiler/rustc_codegen_ssa/src/back/linker.rs#L27-L38>
1970
-
//
1971
-
// Disables non-English messages from localized linkers.
1972
-
// Such messages may cause issues with text encoding on Windows
1973
-
// and prevent inspection of msvc output in case of errors, which we occasionally do.
1974
-
// This should be acceptable because other messages from rustc are in English anyway,
1975
-
// and may also be desirable to improve searchability of the compiler diagnostics.
0 commit comments