Commit Graph

50369 Commits

Author SHA1 Message Date
bors
b16fbe79ac Auto merge of #30843 - jseyfried:no_per_ns, r=nikomatsakis
This commit refactors the field `Module::children` from mapping `Name` -> `NameBindings` to mapping `(Name, Namespace)` -> `NameBinding` and refactors the field `Module::import_resolutions` from mapping `Name` -> `ImportResolutionPerNamespace` to mapping `(Name, Namespace)` -> `ImportResolution`.

This allows the duplicate checking code to be refactored so that `NameBinding` no longer needs ref-counting or a RefCell (removing the need for `NsDef`).

r? @nikomatsakis
2016-01-30 10:16:55 +00:00
Sandeep Datta
0922d7e68f Ignoring demo code with compilation error. 2016-01-30 13:43:02 +05:30
Alex Crichton
0316013b49 rustc: Set MIPS cpu/features in the compiler
Currently any compilation to MIPS spits out the warning:

    'generic' is not a recognized processor for this target (ignoring processor)

Doesn't make for a great user experience! We don't encounter this in the normal
bootstrap because the cpu/feature set are set by the makefiles. Instead let's
just propagate these to the defaults for the entire target all the time (still
overridable from the command line) and prevent warnings from being emitted by
default.
2016-01-29 23:44:46 -08:00
bors
ef1a13b637 Auto merge of #31297 - brson:wintrip, r=alexcrichton
Buildbot was updated long ago to use the correct triples.

The putvar here is emitting garbage into `configure --help` so
I want it gone.
2016-01-30 07:08:38 +00:00
Jonathan Reem
a4343e99c0 Add guard map methods for transforming guards to contain sub-borrows.
This is very useful when the lock is synchronizing access to a data
structure and you would like to return or store guards which contain
references to data inside the data structure instead of the data structure
itself.
2016-01-29 17:00:04 -08:00
bors
303892ee15 Auto merge of #30448 - alexcrichton:llvmup, r=nikomatsakis
These commits perform a few high-level changes with the goal of enabling i686 MSVC unwinding:

* LLVM is upgraded to pick up the new exception handling instructions and intrinsics for MSVC. This puts us somewhere along the 3.8 branch, but we should still be compatible with LLVM 3.7 for non-MSVC targets.
* All unwinding for MSVC targets (both 32 and 64-bit) are implemented in terms of this new LLVM support. I would like to also extend this to Windows GNU targets to drop the runtime dependencies we have on MinGW, but I'd like to land this first.
* Some tests were fixed up for i686 MSVC here and there where necessary. The full test suite should be passing now for that target.

In terms of landing this I plan to have this go through first, then verify that i686 MSVC works, then I'll enable `make check` on the bots for that target instead of just `make` as-is today.

Closes #25869
2016-01-30 00:25:44 +00:00
Alex Crichton
58f1b9c7fc Get tests working on MSVC 32-bit 2016-01-29 16:25:21 -08:00
Alex Crichton
3e9589c0f4 trans: Reimplement unwinding on MSVC
This commit transitions the compiler to using the new exception handling
instructions in LLVM for implementing unwinding for MSVC. This affects both 32
and 64-bit MSVC as they're both now using SEH-based strategies. In terms of
standard library support, lots more details about how SEH unwinding is
implemented can be found in the commits.

In terms of trans, this change necessitated a few modifications:

* Branches were added to detect when the old landingpad instruction is used or
  the new cleanuppad instruction is used to `trans::cleanup`.
* The return value from `cleanuppad` is not stored in an `alloca` (because it
  cannot be).
* Each block in trans now has an `Option<LandingPad>` instead of `is_lpad: bool`
  for indicating whether it's in a landing pad or not. The new exception
  handling intrinsics require that on MSVC each `call` inside of a landing pad
  is annotated with which landing pad that it's in. This change to the basic
  block means that whenever a `call` or `invoke` instruction is generated we
  know whether to annotate it as part of a cleanuppad or not.
* Lots of modifications were made to the instruction builders to construct the
  new instructions as well as pass the tagging information for the call/invoke
  instructions.
* The translation of the `try` intrinsics for MSVC has been overhauled to use
  the new `catchpad` instruction. The filter function is now also a
  rustc-generated function instead of a purely libstd-defined function. The
  libstd definition still exists, it just has a stable ABI across architectures
  and leaves some of the really weird implementation details to the compiler
  (e.g. the `localescape` and `localrecover` intrinsics).
2016-01-29 16:25:20 -08:00
Alex Crichton
d1cace17af trans: Upgrade LLVM
This brings some routine upgrades to the bundled LLVM that we're using, the most
notable of which is a bug fix to the way we handle range asserts when loading
the discriminant of an enum. This fix ended up being very similar to f9d4149c
where we basically can't have a range assert when loading a discriminant due to
filling drop, and appropriate flags were added to communicate this to
`trans::adt`.
2016-01-29 16:25:20 -08:00
Brian Anderson
59b2a29e8e configure: Remove compatibility hacks for windows triples
Buildbot was updated long ago to use the correct triples.

The putvar here is emitting garbage into `configure --help` so
I want it gone.
2016-01-29 15:55:11 -08:00
Jorge Aparicio
7b026f0355 add support for mips(el)-unknown-linux-musl
This target covers MIPS devices that run the trunk version of OpenWRT.

The x86_64-unknown-linux-musl target always links statically to C libraries. For
the mips(el)-unknown-linux-musl target, we opt for dynamic linking (like most of
other targets do) to keep binary size down.

As for the C compiler flags used in the build system, we use the same flags used
for the mips(el)-unknown-linux-gnu target.
2016-01-29 18:46:25 -05:00
Florian Hahn
efe56c8833 Add missings NOTE and HELP annotations to tests 2016-01-30 00:27:58 +01:00
Florian Hahn
36656f812d Expect all help/note messages are specified in a cfail test if it contains help/note annotations,
closes #21195
2016-01-30 00:27:58 +01:00
Steve Klabnik
919ea47356 Add main() so that examples work
Rustdoc will automatically wrap things in main, but this doesn't work
here.

Fixes #31249
2016-01-29 17:53:35 -05:00
Steve Klabnik
a2c328661b Make note that this is different in std
These are free functions in the text, but methods in the standard
library.

Fixes #31266
2016-01-29 17:48:22 -05:00
Steve Klabnik
24c928b99a Fix number of methods in guessing game
This code was refactored, but the words were not

Fixes #31284
2016-01-29 17:45:05 -05:00
Brian Anderson
6dbff05776 Update release notes for 1.7 2016-01-29 22:08:44 +00:00
Brian Anderson
5918d9b96f Release notes for 1.6 2016-01-29 22:08:44 +00:00
Brian Anderson
005c9624bb Remove src/test/bench
I don't believe these test cases have served any purpose in years.

The shootout benchmarks are now upstreamed. A new benchmark suite
should rather be maintained out of tree.
2016-01-29 21:54:30 +00:00
Alex Crichton
b960de0984 std: Ignore dtors_in_dtors_in_dtors on OSX
This test has been deadlocking and causing problems on the bots basically since
its inception. Some memory safety issues were fixed in 987dc84b, but the
deadlocks remained afterwards unfortunately.

After some investigation, I've concluded that this is just a situation where OSX
is not guaranteed to run destructors. The fix in 987dc84b observed that OSX was
rewriting the backing TLS memory to its initial state during destruction while
we weren't looking, and this would have the effect of canceling the destructors
of any other initialized TLS slots.

While very difficult to pin down, this is basically what I assume is happening
here, so there doesn't seem to really be anythig we can do to ensure the test
robustly passes on OSX, so just ignore it for now.
2016-01-29 13:46:47 -08:00
Jeffrey Seyfried
afd42d2144 Remove resolve::dump_module 2016-01-29 21:18:23 +00:00
Jeffrey Seyfried
1ca9f03ead Nits and other local improvements in resolve 2016-01-29 21:18:15 +00:00
Jeffrey Seyfried
e13a0450d3 Clean up resolve_single_import 2016-01-29 21:18:14 +00:00
Jeffrey Seyfried
118c93ba5e Refactor away NameBindings, NsDef, ImportResolutionPerNamespace, DuplicateCheckingMode, and NamespaceDefinition. 2016-01-29 21:18:12 +00:00
bors
074f49a350 Auto merge of #31283 - dotdash:32_64_cc, r=alexcrichton
When cross compiling for a target that has a larger usize type than the
host system, we use a truncated value to mark data as dropped,
eventually leading to drop calls on already dropped data. To properly
handle this, the drop pattern needs to be of type u64.

Since C_integral truncates its given value to the requested size anyway,
we can also drop the function that chose between the u32 and u64 values,
and always use the u64 constant.

Fixes #31139

r? @pnkfelix
2016-01-29 20:58:09 +00:00
Alex Crichton
ea31ff20f0 mk: Fix cross-compiling to armv7-unknown-linux-gnu
The cross prefix was not likely the actual compiler that needed to be used, but
rather the standard `arm-linux-gnueabihf-gcc` compiler can just be used with
`-march=armv7`.
2016-01-29 12:36:45 -08:00
Alex Crichton
7e1acc57d8 mk: Fix compiling jemalloc for powerpc64
We forgot to pass down the `-m64` flag to gcc, so we were actually compiling
powerpc code which would then later fail to link!
2016-01-29 12:23:17 -08:00
bors
0f196bcc3b Auto merge of #31248 - ruud-v-a:fix-triple-ice, r=nrc
This fixes #31238.

r? @michaelsproul
2016-01-29 17:52:26 +00:00
bors
61441cb124 Auto merge of #31285 - Manishearth:rollup, r=Manishearth
- Successful merges: #31252, #31256, #31264, #31269, #31272, #31275, #31276
- Failed merges:
2016-01-29 15:38:40 +00:00
ggomez
c78bf9d90c Add check for unused error codes 2016-01-29 16:37:02 +01:00
Simonas Kazlauskas
9b81d03114 [MIR] Add test for box EXPR dereferencing 2016-01-29 16:13:35 +01:00
Oliver Schneider
06ef2e72c9 [MIR] Fix type of temporary for box EXPR
Previously the code would fail to dereference the temporary.
2016-01-29 16:13:31 +01:00
Manish Goregaokar
7a0e490bdd Rollup merge of #31276 - alexcrichton:fix-powerpc64-cross-prefix, r=brson
Looks like the way to create these executables is to use the standard
`powerpc-linux-gnu-gcc` compiler but with the `-m64` option.
2016-01-29 20:19:39 +05:30
Manish Goregaokar
6550fe704e Rollup merge of #31275 - alexcrichton:fix-rumprun, r=brson
Looks like the rumprun build has bitrotted over time, so this includes some libc
fixes and some various libstd fixes which gets it back to bootstrapping.
2016-01-29 20:19:39 +05:30
Manish Goregaokar
97549c4f16 Rollup merge of #31272 - errandir:master, r=steveklabnik 2016-01-29 20:19:39 +05:30
Manish Goregaokar
669494bcd6 Rollup merge of #31269 - ollie27:patch-3, r=alexcrichton
It got lost in #31121.
2016-01-29 20:19:39 +05:30
Manish Goregaokar
37316e8d05 Rollup merge of #31264 - est31:block_coment_parent, r=alexcrichton
Block comments don't have to be in the format `/*! ... !*/`
in order to be read as doc comments about the parent block.
The format `/*! ... */` is enough.
2016-01-29 20:19:39 +05:30
Manish Goregaokar
050c587e9e Rollup merge of #31256 - oli-obk:patch-1, r=nagisa
if the tests were run with `RUST_BACKTRACE=1 make check` this test failed. If they were run without `RUST_BACKTRACE=1` it succeeded.
2016-01-29 20:19:38 +05:30
Manish Goregaokar
cbfc5e3704 Rollup merge of #31252 - alexcrichton:ios-old-mac, r=brson
Unfortunately older clang compilers don't support this argument, so the
bootstrap will fail. We don't actually really need to optimized the C code we
compile, however, as currently we're just compiling jemalloc and not much else.
2016-01-29 20:19:38 +05:30
Oliver Schneider
c511d362fc Merge pull request #1 from mitaa/patch-1
update tests emitter.rs
2016-01-29 14:46:59 +01:00
bors
ebe92e55f7 Auto merge of #31212 - jseyfried:fix_ICE_in_resolve, r=nrc
This fixes an ICE introduced by #31065 that occurs when a path cannot be resolved because of a certain class of unresolved import (`Indeterminate` imports).
For example, this currently causes an ICE:
```rust
mod foo { pub use self::*; }
fn main() { foo::f() }
```

r? @nrc
2016-01-29 13:45:03 +00:00
Björn Steinbrink
fdf65e719c Fix truncated drop pattern on 32bit -> 64bit cross compilation
When cross compiling for a target that has a larger usize type than the
host system, we use a truncated value to mark data as dropped,
eventually leading to drop calls on already dropped data. To properly
handle this, the drop pattern needs to be of type u64.

Since C_integral truncates its given value to the requested size anyway,
we can also drop the function that chose between the u32 and u64 values,
and always use the u64 constant.

Fixes #31139
2016-01-29 14:19:55 +01:00
mitaa
fe10914adc Update emitter.rs 2016-01-29 13:45:15 +01:00
bors
f030d1fba1 Auto merge of #31144 - jseyfried:remove_import_ordering_restriction, r=nrc
We no longer require `use` and `extern crate` items to precede other items in modules thanks to [RFC #385](https://github.com/rust-lang/rfcs/pull/385), but we still require `use` and `extern crate` items to precede statements in blocks (other items can appear anywhere in a block).

I think that this is a needless distinction between imports and other items that contradicts the intent of the RFC.
2016-01-29 11:21:58 +00:00
Oliver Schneider
b5845c6427 fix overflow due to multiline error span 2016-01-29 11:25:20 +01:00
Andrew Barchuk
1339ca9bf2 Fix link to Installing Rust section of the book 2016-01-29 10:45:37 +01:00
Oliver Schneider
5012d205cc don't leak RUST_BACKTRACE into test process
If the tests were run with `RUST_BACKTRACE=1 make check` this test failed. If they were run without it it succeeded.
We need to use `env_remove` instead of `env_clear` because the latter will never work on windows
2016-01-29 09:46:42 +01:00
bors
33b73e9643 Auto merge of #31132 - gchp:internals, r=brson
This adds the basic structure for the internals documentation, and also the initial version of the "Overview".

This first section gives and overview of the compilation process. It mentions the individual phases, and gives mention to their function & links to the relevant crates in the source tree.

This is a very general overview which is meant to lead in to the next section which will cover the `driver`. That section will give more in-depth information on each of the phases & cover things like sessions and the driver API. I wanted to give a more general introduction before getting into that detail.
2016-01-29 08:37:20 +00:00
bors
7bd87c1f1b Auto merge of #30948 - fabricedesre:rpi2, r=alexcrichton
This adds support for the armv7 crosstool-ng toolchain for the Raspberry Pi 2.

Getting the toolchain ready:
Checkout crosstool-ng from https://github.com/crosstool-ng/crosstool-ng
Build crosstool-ng
Configure the rpi2 target with |ct-ng armv7-rpi2-linux-gnueabihf|
Build the toolchain with |ct-build| and add the path to $toolchain_install_dir/bin to your $PATH

Then, on the rust side:
configure --target=armv7-rpi2-linux-gnueabihf && make && make install

To cross compile for the rpi2,
add $rust_install_path/lib to your $LD_LIBRARY_PATH, then use
rustc --target=armv7-rpi2-linux-gnueabihf -C linker=armv7-rpi2-linux-gnueabihf-g++ hello.rs
2016-01-29 06:41:22 +00:00
Alex Crichton
ba97b06609 mk: Fix cross prefix for powerpc64
Looks like the way to create these executables is to use the standard
`powerpc-linux-gnu-gcc` compiler but with the `-m64` option.
2016-01-28 21:50:29 -08:00