Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 14 pull requests #36764

Merged
merged 54 commits into from
Sep 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
172d321
Updated "Getting started". Trying to fix #34523
vanjacosic Sep 18, 2016
9631e9f
rustc: implement -C link-arg
Sep 19, 2016
2f71fa7
add a test
Sep 19, 2016
e0c60b4
rustdoc: implement --sysroot
Sep 19, 2016
dc7ed30
Refactor out `parse_struct_expr`.
jseyfried Sep 22, 2016
fa5eb54
rustbuild: Print out all build steps when --verbose
brson Sep 23, 2016
a0e178d
Parse paths in statement and pattern macro invocations.
jseyfried Sep 22, 2016
6c08d03
Parse paths in item, trait item, and impl item macro invocations.
jseyfried Sep 22, 2016
167f70a
Fix fallout in tests.
jseyfried Sep 22, 2016
1e1804d
Cleanup.
jseyfried Sep 22, 2016
2c85733
Fix indents.
jseyfried Sep 22, 2016
e82d13e
rustdoc css: Put `where` in trait listings on a new line
bluss Sep 23, 2016
1a6fc8b
Add support for the Haiku operating system on x86 and x86_64 machines
nielx Sep 25, 2016
783ab77
Haiku: Work around the lack of the FIOCLEX ioctl
nielx Sep 25, 2016
ba6eb57
Haiku: add workaround for missing F_DUPFD_CLOEXEC
nielx Sep 25, 2016
328743a
Haiku: add search path for terminfo
nielx Sep 25, 2016
01fecb9
Haiku: add support for building on Haiku
nielx Sep 25, 2016
729ae39
Haiku: Style, TODO to FIXME
kallisti5 Sep 25, 2016
8ec1d21
Haiku: Fix pthread_t typesize set to stable 1.8.0 post #29791
kallisti5 Sep 25, 2016
ae3ed31
Use underscores to breakup long number.
frewsxcv Sep 25, 2016
a147a9d
Fix incorrect alignment for `if` statement.
frewsxcv Sep 25, 2016
5495fab
Privatize `unindent` function.
frewsxcv Sep 25, 2016
f1a3eb6
Separate rustdoc passes into separate modules.
frewsxcv Sep 25, 2016
7e91b86
Haiku: Adjust haiku target to match new librustc_back design
kallisti5 Sep 25, 2016
bd62c4c
Move pass contants/types into the new `pass` module.
frewsxcv Sep 25, 2016
99e1b9c
Move in-pass-function structs and impls outside functions.
frewsxcv Sep 25, 2016
8b40ead
Refactor `parse_expansion` out of `ResultAnyMacro`.
jseyfried Sep 23, 2016
4a8467b
Remove `TokResult`.
jseyfried Sep 26, 2016
b90cedd
Refactor `ensure_complete_parse`.
jseyfried Sep 23, 2016
34f4ad1
Add regression test.
jseyfried Sep 26, 2016
51ea050
reject macros with empty repetitions
TimNN Sep 25, 2016
7c34d9c
Haiku: Use common thread set_name stub
kallisti5 Sep 26, 2016
df0e4bf
Move `ensure_complete_parse` into `expand.rs`.
jseyfried Sep 26, 2016
e6e117c
Extend preprocessor LLVM version checks to support LLVM 4.x
shepmaster Sep 24, 2016
09a63c1
Add E0513 error explanation
GuillaumeGomez Sep 25, 2016
1e4e81c
Add compile-fail test for E0513
GuillaumeGomez Sep 25, 2016
96a0f06
Update E0513 to new error format
GuillaumeGomez Sep 25, 2016
0bd7ef0
Remove whitespace from line endings
vanjacosic Sep 26, 2016
c52b957
When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno.
tmiasko Sep 24, 2016
157208b
New error format for E0512
alygin Sep 26, 2016
e3ffde8
Rollup merge of #36563 - vanjacosic:patch-1, r=steveklabnik
Sep 27, 2016
c816720
Rollup merge of #36574 - japaric:link-arg, r=alexcrichton
Sep 27, 2016
3775be8
Rollup merge of #36586 - japaric:rustdoc-sysroot, r=alexcrichton
Sep 27, 2016
1d96462
Rollup merge of #36662 - jseyfried:parse_macro_invoc_paths, r=nrc
Sep 27, 2016
96577e4
Rollup merge of #36663 - brson:build-plan, r=alexcrichton
Sep 27, 2016
5cc9fb9
Rollup merge of #36669 - jseyfried:refactor_tok_result, r=nrc
Sep 27, 2016
d6a7a4f
Rollup merge of #36676 - bluss:rustdoc-where-css, r=steveklabnik
Sep 27, 2016
02cc578
Rollup merge of #36721 - TimNN:infinite-emptiness, r=nrc
Sep 27, 2016
9b72650
Rollup merge of #36723 - GuillaumeGomez:e0513, r=jonathandturner
Sep 27, 2016
df52628
Rollup merge of #36727 - kallisti5:master, r=Aatch
Sep 27, 2016
ee2e115
Rollup merge of #36729 - frewsxcv:rustdoc, r=alexcrichton
Sep 27, 2016
816f147
Rollup merge of #36742 - shepmaster:llvm-4-preamble, r=alexcrichton
Sep 27, 2016
5c9fc99
Rollup merge of #36754 - tmiasko:getaddrinfo-errors, r=alexcrichton
Sep 27, 2016
e832762
Rollup merge of #36756 - alygin:e0512-new-format, r=jonathandturner
Sep 27, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ case $CFG_OSTYPE in
CFG_CPUTYPE=$(isainfo -n)
;;

Haiku)
CFG_OSTYPE=unknown-haiku
;;

MINGW*)
# msys' `uname` does not print gcc configuration, but prints msys
# configuration. so we cannot believe `uname -m`:
Expand Down Expand Up @@ -532,6 +536,10 @@ case $CFG_CPUTYPE in
CFG_CPUTYPE=x86_64
;;

BePC)
CFG_CPUTYPE=i686
;;

*)
err "unknown CPU type: $CFG_CPUTYPE"
esac
Expand Down
27 changes: 27 additions & 0 deletions mk/cfg/i686-unknown-haiku.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# i686-unknown-haiku configuration
CROSS_PREFIX_i686-unknown-haiku=i586-pc-haiku-
CC_i686-unknown-haiku=$(CC)
CXX_i686-unknown-haiku=$(CXX)
CPP_i686-unknown-haiku=$(CPP)
AR_i686-unknown-haiku=$(AR)
CFG_LIB_NAME_i686-unknown-haiku=lib$(1).so
CFG_STATIC_LIB_NAME_i686-unknown-haiku=lib$(1).a
CFG_LIB_GLOB_i686-unknown-haiku=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_i686-unknown-haiku=lib$(1)-*.dylib.dSYM
CFG_CFLAGS_i686-unknown-haiku := -m32 $(CFLAGS)
CFG_GCCISH_CFLAGS_i686-unknown-haiku := -Wall -Werror -g -fPIC -m32 $(CFLAGS)
CFG_GCCISH_CXXFLAGS_i686-unknown-haiku := -fno-rtti $(CXXFLAGS)
CFG_GCCISH_LINK_FLAGS_i686-unknown-haiku := -shared -fPIC -ldl -pthread -lrt -g -m32
CFG_GCCISH_PRE_LIB_FLAGS_i686-unknown-haiku := -Wl,-whole-archive
CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-haiku := -Wl,-no-whole-archive
CFG_DEF_SUFFIX_i686-unknown-haiku := .linux.def
CFG_LLC_FLAGS_i686-unknown-haiku :=
CFG_INSTALL_NAME_i686-unknown-haiku =
CFG_EXE_SUFFIX_i686-unknown-haiku =
CFG_WINDOWSY_i686-unknown-haiku :=
CFG_UNIXY_i686-unknown-haiku := 1
CFG_PATH_MUNGE_i686-unknown-haiku := true
CFG_LDPATH_i686-unknown-haiku :=
CFG_RUN_i686-unknown-haiku=$(2)
CFG_RUN_TARG_i686-unknown-haiku=$(call CFG_RUN_i686-unknown-haiku,,$(2))
CFG_GNU_TRIPLE_i686-unknown-haiku := i686-unknown-haiku
27 changes: 27 additions & 0 deletions mk/cfg/x86_64-unknown-haiku.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# x86_64-unknown-haiku configuration
CROSS_PREFIX_x86_64-unknown-haiku=x86_64-unknown-haiku-
CC_x86_64-unknown-haiku=$(CC)
CXX_x86_64-unknown-haiku=$(CXX)
CPP_x86_64-unknown-haiku=$(CPP)
AR_x86_64-unknown-haiku=$(AR)
CFG_LIB_NAME_x86_64-unknown-haiku=lib$(1).so
CFG_STATIC_LIB_NAME_x86_64-unknown-haiku=lib$(1).a
CFG_LIB_GLOB_x86_64-unknown-haiku=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_x86_64-unknown-haiku=lib$(1)-*.dylib.dSYM
CFG_CFLAGS_x86_64-unknown-haiku := -m64 $(CFLAGS)
CFG_GCCISH_CFLAGS_x86_64-unknown-haiku := -Wall -Werror -g -fPIC -m64 $(CFLAGS)
CFG_GCCISH_CXXFLAGS_x86_64-unknown-haiku := -fno-rtti $(CXXFLAGS)
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-haiku := -shared -fPIC -ldl -pthread -lrt -g -m64
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-haiku := -Wl,-whole-archive
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-haiku := -Wl,-no-whole-archive
CFG_DEF_SUFFIX_x86_64-unknown-haiku := .linux.def
CFG_LLC_FLAGS_x86_64-unknown-haiku :=
CFG_INSTALL_NAME_x86_64-unknown-haiku =
CFG_EXE_SUFFIX_x86_64-unknown-haiku =
CFG_WINDOWSY_x86_64-unknown-haiku :=
CFG_UNIXY_x86_64-unknown-haiku := 1
CFG_PATH_MUNGE_x86_64-unknown-haiku := true
CFG_LDPATH_x86_64-unknown-haiku :=
CFG_RUN_x86_64-unknown-haiku=$(2)
CFG_RUN_TARG_x86_64-unknown-haiku=$(call CFG_RUN_x86_64-unknown-haiku,,$(2))
CFG_GNU_TRIPLE_x86_64-unknown-haiku := x86_64-unknown-haiku
4 changes: 4 additions & 0 deletions mk/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,14 @@ ifeq ($$(OSTYPE_$(3)),apple-darwin)
else
ifeq ($$(CFG_WINDOWSY_$(3)),1)
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := PATH
else
ifeq ($$(OSTYPE_$(3)),unknown-haiku)
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := LIBRARY_PATH
else
LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3) := LD_LIBRARY_PATH
endif
endif
endif

LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3) := \
$$(CURDIR)/$$(HLIB$(1)_H_$(3)):$$(CFG_LLVM_INST_DIR_$(3))/lib
Expand Down
9 changes: 8 additions & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,14 @@ impl Build {
// Almost all of these are simple one-liners that shell out to the
// corresponding functionality in the extra modules, where more
// documentation can be found.
for target in step::all(self) {
let steps = step::all(self);

self.verbose("bootstrap build plan:");
for step in &steps {
self.verbose(&format!("{:?}", step));
}

for target in steps {
let doc_out = self.out.join(&target.target).join("doc");
match target.src {
Llvm { _dummy } => {
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ targets!(define_source);
/// into a topologically sorted list which when executed left-to-right will
/// correctly sequence the entire build.
pub fn all(build: &Build) -> Vec<Step> {
build.verbose("inferred build steps:");

let mut ret = Vec::new();
let mut all = HashSet::new();
for target in top_level(build) {
Expand All @@ -184,6 +186,7 @@ pub fn all(build: &Build) -> Vec<Step> {
set: &mut HashSet<Step<'a>>) {
if set.insert(target.clone()) {
for dep in target.deps(build) {
build.verbose(&format!("{:?}\n -> {:?}", target, dep));
fill(build, &dep, ret, set);
}
ret.push(target.clone());
Expand Down
11 changes: 6 additions & 5 deletions src/doc/book/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,13 @@ $ cd hello_world

## Writing and Running a Rust Program

Next, make a new source file and call it *main.rs*. Rust files always end
in a *.rs* extension. If you’re using more than one word in your filename, use
an underscore to separate them; for example, you'd use *hello_world.rs* rather
than *helloworld.rs*.
We need to create a source file for our Rust program. Rust files always end
in a *.rs* extension. If you are using more than one word in your filename,
use an underscore to separate them; for example, you would use
*my_program.rs* rather than *myprogram.rs*.

Now open the *main.rs* file you just created, and type the following code:
Now, make a new file and call it *main.rs*. Open the file and type
the following code:

```rust
fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/etc/local_stage0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LIB_PREFIX=lib

OS=`uname -s`
case $OS in
("Linux"|"FreeBSD"|"DragonFly"|"Bitrig"|"OpenBSD"|"SunOS")
("Linux"|"FreeBSD"|"DragonFly"|"Bitrig"|"OpenBSD"|"SunOS"|"Haiku")
BIN_SUF=
LIB_SUF=.so
;;
Expand Down
2 changes: 1 addition & 1 deletion src/liblibc
Submodule liblibc updated 38 files
+1 −1 Cargo.toml
+1 −1 ci/docker/aarch64-unknown-linux-gnu/Dockerfile
+1 −1 ci/docker/x86_64-unknown-freebsd/Dockerfile
+1 −1 ci/docker/x86_64-unknown-openbsd/Dockerfile
+1 −4 ci/run-qemu.sh
+16 −4 ci/run.sh
+4 −4 libc-test/Cargo.lock
+3 −1 libc-test/build.rs
+63 −29 src/unix/bsd/apple/mod.rs
+50 −0 src/unix/bsd/freebsdlike/dragonfly/mod.rs
+53 −0 src/unix/bsd/freebsdlike/freebsd/mod.rs
+21 −6 src/unix/bsd/freebsdlike/mod.rs
+2 −29 src/unix/bsd/mod.rs
+5 −7 src/unix/bsd/netbsdlike/mod.rs
+40 −12 src/unix/bsd/netbsdlike/netbsd.rs
+75 −0 src/unix/bsd/netbsdlike/openbsdlike/bitrig.rs
+71 −34 src/unix/bsd/netbsdlike/openbsdlike/mod.rs
+28 −0 src/unix/bsd/netbsdlike/openbsdlike/openbsd.rs
+0 −437 src/unix/bsd/openbsdlike/bitrig.rs
+4 −0 src/unix/mod.rs
+61 −0 src/unix/notbsd/android/mod.rs
+26 −0 src/unix/notbsd/linux/mips.rs
+14 −0 src/unix/notbsd/linux/mips64.rs
+34 −1 src/unix/notbsd/linux/mod.rs
+17 −0 src/unix/notbsd/linux/musl/b32/arm.rs
+17 −0 src/unix/notbsd/linux/musl/b32/asmjs.rs
+26 −0 src/unix/notbsd/linux/musl/b32/mips.rs
+17 −0 src/unix/notbsd/linux/musl/b32/x86.rs
+14 −0 src/unix/notbsd/linux/musl/b64/mod.rs
+17 −0 src/unix/notbsd/linux/other/b32/arm.rs
+17 −0 src/unix/notbsd/linux/other/b32/powerpc.rs
+17 −0 src/unix/notbsd/linux/other/b32/x86.rs
+3 −4 src/unix/notbsd/linux/other/b64/aarch64.rs
+14 −0 src/unix/notbsd/linux/other/b64/mod.rs
+63 −0 src/unix/notbsd/linux/other/mod.rs
+3 −0 src/unix/notbsd/mod.rs
+2 −0 src/unix/solaris/mod.rs
+41 −0 src/windows.rs
9 changes: 7 additions & 2 deletions src/librustc/middle/intrinsicck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,16 @@ impl<'a, 'gcx, 'tcx> ExprVisitor<'a, 'gcx, 'tcx> {
}
};

span_err!(self.infcx.tcx.sess, span, E0512,
struct_span_err!(self.infcx.tcx.sess, span, E0512,
"transmute called with differently sized types: \
{} ({}) to {} ({})",
from, skeleton_string(from, sk_from),
to, skeleton_string(to, sk_to));
to, skeleton_string(to, sk_to))
.span_label(span,
&format!("transmuting between {} and {}",
skeleton_string(from, sk_from),
skeleton_string(to, sk_to)))
.emit();
}
}

Expand Down
10 changes: 10 additions & 0 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ macro_rules! options {
pub const parse_opt_bool: Option<&'static str> =
Some("one of: `y`, `yes`, `on`, `n`, `no`, or `off`");
pub const parse_string: Option<&'static str> = Some("a string");
pub const parse_string_push: Option<&'static str> = Some("a string");
pub const parse_opt_string: Option<&'static str> = Some("a string");
pub const parse_list: Option<&'static str> = Some("a space-separated list of strings");
pub const parse_opt_list: Option<&'static str> = Some("a space-separated list of strings");
Expand Down Expand Up @@ -668,6 +669,13 @@ macro_rules! options {
}
}

fn parse_string_push(slot: &mut Vec<String>, v: Option<&str>) -> bool {
match v {
Some(s) => { slot.push(s.to_string()); true },
None => false,
}
}

fn parse_list(slot: &mut Vec<String>, v: Option<&str>)
-> bool {
match v {
Expand Down Expand Up @@ -743,6 +751,8 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
"tool to assemble archives with"),
linker: Option<String> = (None, parse_opt_string, [UNTRACKED],
"system linker to link outputs with"),
link_arg: Vec<String> = (vec![], parse_string_push, [UNTRACKED],
"a single extra argument to pass to the linker (can be used several times)"),
link_args: Option<Vec<String>> = (None, parse_opt_list, [UNTRACKED],
"extra arguments to pass to the linker (space separated)"),
link_dead_code: bool = (false, parse_bool, [UNTRACKED],
Expand Down
23 changes: 23 additions & 0 deletions src/librustc_back/target/haiku_base.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use target::TargetOptions;
use std::default::Default;

pub fn opts() -> TargetOptions {
TargetOptions {
linker: "cc".to_string(),
dynamic_linking: true,
executables: true,
has_rpath: true,
linker_is_gnu: true,
.. Default::default()
}
}
30 changes: 30 additions & 0 deletions src/librustc_back/target/i686_unknown_haiku.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use target::{Target, TargetResult};

pub fn target() -> TargetResult {
let mut base = super::haiku_base::opts();
base.cpu = "pentium4".to_string();
base.max_atomic_width = 64;
base.pre_link_args.push("-m32".to_string());

Ok(Target {
llvm_target: "i686-unknown-haiku".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(),
arch: "x86".to_string(),
target_os: "haiku".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
options: base,
})
}
4 changes: 4 additions & 0 deletions src/librustc_back/target/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ mod apple_ios_base;
mod bitrig_base;
mod dragonfly_base;
mod freebsd_base;
mod haiku_base;
mod linux_base;
mod linux_musl_base;
mod openbsd_base;
Expand Down Expand Up @@ -165,6 +166,9 @@ supported_targets! {
("x86_64-unknown-netbsd", x86_64_unknown_netbsd),
("x86_64-rumprun-netbsd", x86_64_rumprun_netbsd),

("i686_unknown_haiku", i686_unknown_haiku),
("x86_64_unknown_haiku", x86_64_unknown_haiku),

("x86_64-apple-darwin", x86_64_apple_darwin),
("i686-apple-darwin", i686_apple_darwin),

Expand Down
30 changes: 30 additions & 0 deletions src/librustc_back/target/x86_64_unknown_haiku.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use target::{Target, TargetResult};

pub fn target() -> TargetResult {
let mut base = super::haiku_base::opts();
base.cpu = "x86-64".to_string();
base.max_atomic_width = 64;
base.pre_link_args.push("-m64".to_string());

Ok(Target {
llvm_target: "x86_64-unknown-haiku".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "64".to_string(),
data_layout: "e-m:e-i64:64-f80:128-n8:16:32:64-S128".to_string(),
arch: "x86_64".to_string(),
target_os: "haiku".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
options: base,
})
}
21 changes: 21 additions & 0 deletions src/librustc_data_structures/flock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,27 @@ mod imp {
pub const F_SETLKW: libc::c_int = 9;
}

#[cfg(target_os = "haiku")]
mod os {
use libc;

pub struct flock {
pub l_type: libc::c_short,
pub l_whence: libc::c_short,
pub l_start: libc::off_t,
pub l_len: libc::off_t,
pub l_pid: libc::pid_t,

// not actually here, but brings in line with freebsd
pub l_sysid: libc::c_int,
}

pub const F_UNLCK: libc::c_short = 0x0200;
pub const F_WRLCK: libc::c_short = 0x0400;
pub const F_SETLK: libc::c_int = 0x0080;
pub const F_SETLKW: libc::c_int = 0x0100;
}

#[cfg(any(target_os = "macos", target_os = "ios"))]
mod os {
use libc;
Expand Down
4 changes: 3 additions & 1 deletion src/librustc_trans/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,8 @@ fn link_args(cmd: &mut Linker,
let empty_vec = Vec::new();
let empty_str = String::new();
let args = sess.opts.cg.link_args.as_ref().unwrap_or(&empty_vec);
let mut args = args.iter().chain(used_link_args.iter());
let more_args = &sess.opts.cg.link_arg;
let mut args = args.iter().chain(more_args.iter()).chain(used_link_args.iter());
let relocation_model = sess.opts.cg.relocation_model.as_ref()
.unwrap_or(&empty_str);
if (t.options.relocation_model == "pic" || *relocation_model == "pic")
Expand Down Expand Up @@ -844,6 +845,7 @@ fn link_args(cmd: &mut Linker,
if let Some(ref args) = sess.opts.cg.link_args {
cmd.args(args);
}
cmd.args(&sess.opts.cg.link_arg);
cmd.args(&used_link_args);
}

Expand Down
8 changes: 5 additions & 3 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1525,9 +1525,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
match self.locals.borrow().get(&nid) {
Some(&t) => t,
None => {
span_err!(self.tcx.sess, span, E0513,
"no type for local variable {}",
nid);
struct_span_err!(self.tcx.sess, span, E0513,
"no type for local variable {}",
self.tcx.map.node_to_string(nid))
.span_label(span, &"no type for variable")
.emit();
self.tcx.types.err
}
}
Expand Down
Loading