Commit Graph

52699 Commits

Author SHA1 Message Date
bors
b52d76a085 Auto merge of #33214 - oli-obk:const_err_var_exprs, r=eddyb
report `const_err` on all expressions that can fail

also a drive-by fix for reporting an "overflow in shift *left*" when shifting an `i64` *right*

This increases the warning noise for shifting by more than the bitwidth and for `-T::MIN`. I can silence the bitwidth warnings explicitly and fix the const evaluator to make sure `--$expr` is treated exactly like `$expr` (which is kinda wrong, but mathematically right).

r? @eddyb
2016-04-27 04:00:16 -07:00
Tomáš Hübelbauer
e6b9760df2 Fix use of the move command in the Windows shell
`move` work both in `cmd` and in Powershell. `mv` works only in Powershell and the book says nothing about which shell is recommended so this could confuse beginners.

Closes #33219.
2016-04-27 10:56:35 +02:00
Adolfo Ochagavía
6c50c8877f rustc_driver: Allow running the compiler with a FileLoader 2016-04-27 10:51:55 +02:00
Oliver Schneider
5cdcad9d35 update Cargo.toml for rustbuild 2016-04-27 10:47:46 +02:00
Jeffrey Seyfried
6aa9145753 Avoid using the hir map when visibility checking in resolve
Refactor `ty::Visibility` methods to use a new trait `NodeIdTree` instead of the ast map.
2016-04-27 06:40:54 +00:00
Jeffrey Seyfried
33bb26998c Refactor away a use of ast_map.span_if_local() 2016-04-27 06:40:52 +00:00
bors
80bff1eea7 Auto merge of #33226 - fabricedesre:update-llvm, r=alexcrichton
Update llvm to 751345228a0ef03fd147394bb5104359b7a808be

Picking up the changes from 751345228a

r? @alexcrichton
2016-04-26 22:47:40 -07:00
Jeffrey Seyfried
3bcf818a8f Refactor resolve_crate_relative_path and resolve_module_relative_path
to return a `NameBinding` instead of a `Def`
2016-04-27 01:13:22 +00:00
Jeffrey Seyfried
6da115374f Refactor away get_trait_name 2016-04-27 01:13:22 +00:00
Jeffrey Seyfried
82e0dd5ac1 Refactor away is_static_method 2016-04-27 01:13:22 +00:00
Jeffrey Seyfried
2ccaeed50e Refactor away FallbackChecks and remove dead code 2016-04-27 01:13:21 +00:00
Jeffrey Seyfried
c9d8e1493c Refactor field span of NameBinding from Option<Span> to Span. 2016-04-27 01:13:15 +00:00
Fabrice Desré
1d2846dcda Update llvm to 751345228a0ef03fd147394bb5104359b7a808be 2016-04-26 17:03:14 -07:00
bors
8f55218189 Auto merge of #31414 - durka:clone-copy, r=alexcrichton
special-case #[derive(Copy, Clone)] with a shallow clone

If a type is Copy then its Clone implementation can be a no-op. Currently `#[derive(Clone)]` generates a deep clone anyway. This can lead to lots of code bloat.

This PR detects the case where Copy and Clone are both being derived (the general case of "is this type Copy" can't be determined by a syntax extension) and generates the shallow Clone impl. Right now this can only be done if there are no type parameters (see https://github.com/rust-lang/rust/issues/31085#issuecomment-178988663), but this restriction can be removed after specialization.

Fixes #31085.
2016-04-26 14:54:37 -07:00
bors
897199a0fb Auto merge of #33191 - alexcrichton:rustdoc-create-dir-all-racy, r=steveklabnik
rustdoc: Handle concurrent mkdir requests

It's likely that `rustdoc` as a tool is run concurrently in the same output
(e.g. documenting multiple crates as Cargo does), in which case it needs to
handle concurrent calls to `fs::create_dir`.
2016-04-26 12:00:35 -07:00
Alex Burka
9249e6a1e2 shallow Clone for #[derive(Copy,Clone)]
Changes #[derive(Copy, Clone)] to use a faster impl of Clone when
both derives are present, and there are no generics in the type.

The faster impl is simply returning *self (which works because the
type is also Copy). See the comments in libsyntax_ext/deriving/clone.rs
for more details.

There are a few types which are Copy but not Clone, in violation
of the definition of Copy. These include large arrays and tuples. The
very existence of these types is arguably a bug, but in order for this
optimization not to change the applicability of #[derive(Copy, Clone)],
the faster Clone impl also injects calls to a new function,
core::clone::assert_receiver_is_clone, to verify that all members are
actually Clone.

This is not a breaking change, because pursuant to RFC 1521, any type
that implements Copy should not do any observable work in its Clone
impl.
2016-04-26 13:49:29 -04:00
bors
01a0207919 Auto merge of #33142 - tshepang:split-long-line, r=guillaumegomez
doc: that line was too long
2016-04-26 09:04:27 -07:00
Kaiyin Zhong
10abb666e4 Update references-and-borrowing.md
add as 2nd example.
2016-04-26 17:40:59 +02:00
Oliver Schneider
6343f261f4 allow InternedString to be compared to &str directly 2016-04-26 16:27:10 +02:00
bors
092b0738b7 Auto merge of #33203 - Ryman:patch-3, r=alexcrichton
libstd: fix typos in thread::LocalKey docs
2016-04-26 06:57:03 -07:00
Oliver Schneider
d3c489c917 don't demote expressions just because const_eval fails
this might introduce subtle bugs to code generation
2016-04-26 15:32:18 +02:00
Oliver Schneider
9d7ed99c06 skip non-const-path errors for now
Associated constants aren't implemented fully in early const eval
2016-04-26 14:11:14 +02:00
Oliver Schneider
89d1046503 don't report bitshift overflow twice 2016-04-26 14:10:07 +02:00
Oliver Schneider
735c018974 skip double negation in const eval 2016-04-26 14:09:05 +02:00
bors
03bef4c43b Auto merge of #32989 - GuillaumeGomez:e0393, r=Manishearth
Add E0393 error explanation

Part of #32777.

r? @Manishearth
cc @steveklabnik
2016-04-26 04:51:08 -07:00
bors
81d070f582 Auto merge of #32962 - taralx:patch-1, r=GuillaumeGomez
Clean up some info log spam.

Some of this looks like merge cruft, but the region spam is especially noisy.
2016-04-26 02:42:52 -07:00
Oliver Schneider
3acee3b6c5 const_err lint all constant expressions 2016-04-26 11:18:48 +02:00
Oliver Schneider
ee983230c9 report shift right error instead of shift left error on right shift 2016-04-26 11:17:32 +02:00
Guillaume Gomez
d648fc6865 Add E0393 error explanation 2016-04-26 11:16:36 +02:00
Jeffrey Seyfried
c46164b626 Refactor away field vis of ModuleS 2016-04-26 09:01:24 +00:00
bors
769ac42c2e Auto merge of #33099 - eddyb:issue-33096, r=michaelwoerister
Normalize types before using them in debuginfo.

Small oversight, fixes #33096 - odd thing is that the old code doesn't look like it should've ever worked, although it wasn't using all of the type parameters, so maybe that's what changed.
2016-04-26 00:36:03 -07:00
York Xiang
93486180d9 Improve error message about regions of function body 2016-04-26 13:37:03 +08:00
bors
41028def11 Auto merge of #33204 - Manishearth:rollup, r=Manishearth
Rollup of 7 pull requests

- Successful merges: #33107, #33133, #33160, #33167, #33194, #33196, #33200
- Failed merges:
2016-04-25 22:26:56 -07:00
bors
8ce735858d Auto merge of #33210 - alexcrichton:fix-ndk-dir, r=alexcrichton
mk: Fix use of deprecated configure var

The `--android-cross-path` has been deprecated for some time now, we should use
`CFG_ARM_LINUX_ANDROIDEABI_NDK` instead.

Ideally this would use the right triple, but we're only testing ARM for now.
2016-04-25 18:48:05 -07:00
Alex Crichton
1fac8a4564 mk: Fix use of deprecated configure var
The `--android-cross-path` has been deprecated for some time now, we should use
`CFG_ARM_LINUX_ANDROIDEABI_NDK` instead.

Ideally this would use the right triple, but we're only testing ARM for now.
2016-04-25 18:35:58 -07:00
Nick Cameron
f7652bf809 save-analysis-json: lower def ids 2016-04-26 10:31:48 +12:00
Nick Cameron
e1d61cb637 save-analysis: expand smoke test to cover json and csv formats 2016-04-26 10:16:44 +12:00
Nick Cameron
5065f0c2a2 save-analysis-json: thread through -z option
In fact, we make JSOn the default and add an option for save-analysis-csv for the legacy behaviour.

We also rename some bits and pieces `dxr` -> `save-analysis`
2016-04-26 10:14:44 +12:00
Manish Goregaokar
3dc0b55a47 Rollup merge of #33200 - sfackler:nonblocking-docs, r=alexcrichton
Fix reference to TCP in UDP docs

Closees #33195
2016-04-26 01:44:52 +05:30
Manish Goregaokar
edbb0d5a90 Rollup merge of #33196 - mitaa:rdoc-crate-links, r=alexcrichton
rustdoc: Linkify extern crates

fixes #33178

r? @alexcrichton
2016-04-26 01:44:52 +05:30
Manish Goregaokar
b50a2ff4d1 Rollup merge of #33194 - mitaa:rdoc-a, r=alexcrichton
rustdoc: Improve accessibility of rustdoc pages

fixes #33131

r? @alexcrichton
2016-04-26 01:44:52 +05:30
Manish Goregaokar
4c0fdebe7b Rollup merge of #33167 - benaryorg:master, r=alexcrichton
clarify documentation of TcpStream::connect() for multiple valid addresses

I am not sure how the UDP part of the stdlib behaves when passing multiple valid addresses, but it should be mentioned as there are legit use cases for [`impl<'a> ToSocketAddrs for &'a [SocketAddr]`](http://doc.rust-lang.org/nightly/std/net/trait.ToSocketAddrs.html), a TCP fallback only being one.

Just a little example program for anyone willing to enhance the documentation further:

```rust
use std::net::SocketAddr;
use std::net::ToSocketAddrs;
use std::net::TcpStream;

fn main()
{
	let v: Vec<SocketAddr> = vec!
	[
		"127.0.0.1:1338".to_socket_addrs().unwrap().next().unwrap(),
		"127.0.0.1:1337".to_socket_addrs().unwrap().next().unwrap(),
		"127.0.0.1:1339".to_socket_addrs().unwrap().next().unwrap(),
	];

	let stream = TcpStream::connect(&v[..]).unwrap();
}
```
2016-04-26 01:44:51 +05:30
Manish Goregaokar
b588f6903d Rollup merge of #33160 - euclio:rustdoc-unstable-deprecated, r=alexcrichton
show unstable status for deprecated items

Fixes #32374.
2016-04-26 01:44:51 +05:30
Manish Goregaokar
5fba2bfa0a Rollup merge of #33133 - mitaa:rdoc-smth-smth-impl, r=alexcrichton
rustdoc: inline all the impls

This used to be done to avoid inlining impls referencing private items, but is now unnecessary since we actually check that impls do not reference non-doc-reachable items.

fixes #32881
fixes #33025
fixes #33113

r? @alexcrichton
2016-04-26 01:44:51 +05:30
Manish Goregaokar
1bc30a5621 Rollup merge of #33107 - sanxiyn:prev-impl-item, r=eddyb
Show previous definition of duplicate impl item

Fix #32971.
2016-04-26 01:44:51 +05:30
Ryman
2b71219a61 libstd: fix typos in thread::LocalKey docs 2016-04-25 21:01:19 +01:00
bors
bd938166d6 Auto merge of #33115 - mbrubeck:vfp3-d16, r=nrc
Enable vfp3-d16 for ARMv7 Android target

Android's [armeabi-v7a ABI][1] guarantees at least VFPv3-d16 hardware FPU support, so Rust should include this in the default features for the `arm-linux-androideabi` target.

[1]: https://developer.android.com/ndk/guides/abis.html
2016-04-25 10:43:36 -07:00
Steven Fackler
379e6fc5be Fix reference to TCP in UDP docs
Closees #33195
2016-04-25 09:12:51 -07:00
bors
90318b8c22 Auto merge of #32258 - nikomatsakis:fewer-errors, r=arielb1
Suppress fallback and ambiguity errors

If the infcx has observed other errors, then suppress both default type
parameter fallback (which can be unreliable, as the full constraint set
is not available) and errors related to unresovled
variables (annoyingly, integer type variables cannot currently be
unified with error, so that has to be a separate mechanism). Also add a
flag to `infcx` to allow us to independently indicate when we have
observed an error and hence should trigger this suppression mode.

Fixes #31997

cc @alexcrichton
r? @arielb1
2016-04-25 08:13:22 -07:00
Niko Matsakis
b3d54a2c0e patch test due to changes from compiletest-json 2016-04-25 09:38:06 -04:00