rustc_target: Refactor away TargetResult

Construction of a built-in target is always infallible now, so `TargetResult` is no longer necessary.
This commit is contained in:
Vadim Petrochenkov
2020-10-05 15:37:55 +03:00
parent f317a93d4d
commit 021fcbd90c
158 changed files with 619 additions and 630 deletions

View File

@@ -13,7 +13,7 @@
use super::wasm32_base;
use super::{LinkerFlavor, LldFlavor, Target};
pub fn target() -> Result<Target, String> {
pub fn target() -> Target {
let mut options = wasm32_base::options();
let clang_args = options.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap();
@@ -30,7 +30,7 @@ pub fn target() -> Result<Target, String> {
.unwrap()
.push("--no-entry".to_string());
Ok(Target {
Target {
llvm_target: "wasm32-unknown-unknown".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
@@ -42,5 +42,5 @@ pub fn target() -> Result<Target, String> {
arch: "wasm32".to_string(),
linker_flavor: LinkerFlavor::Lld(LldFlavor::Wasm),
options,
})
}
}