Commit Graph

88081 Commits

Author SHA1 Message Date
kennytm
ab55ecf4ba
Rollup merge of #57314 - wiktorkuchta:master, r=Centril
Fix repeated word typos

Inspired by #57295 (I skipped 'be be' because of it) and my [PR in another repo
](https://github.com/e-maxx-eng/e-maxx-eng/pull/389)
Not a stupid `sed`, I actually tried to fix case by case.
2019-01-05 23:56:59 +08:00
kennytm
676b0b0cc4
Rollup merge of #57313 - Nemo157:box-to-pin, r=cramertj
Improve Box<T> -> Pin<Box<T>> conversion

I found the `From` trait conversion for this very hard to find, having a named function for it is much more discoverable. Also fixes #56256 as I need that in the place I'm using this.

Has a placeholder tracking issue, will file an issue once I get feedback.
2019-01-05 23:56:58 +08:00
kennytm
e1a1ab0836
Rollup merge of #57312 - Mendess2526:master, r=Centril
`const fn` is no longer coming soon (const keyword docs)

The `const` keyword [documentation](https://doc.rust-lang.org/std/keyword.const.html) mentions that `const fn`s are coming soon, but they have already been added.
2019-01-05 23:56:56 +08:00
kennytm
dfc1037757
Rollup merge of #57311 - dlrobertson:fix_valist_copy, r=KodrAus
VaList::copy should not require a mutable ref

`VaList::copy` does not need to take a mutable reference. The `va_copy`
intrinsic takes a immutable reference.
2019-01-05 23:56:55 +08:00
kennytm
952af5e898
Rollup merge of #57295 - d-e-s-o:topic/be-be, r=zackmdavis
Fix 'be be' constructs

I noticed a duplicated "be" somewhere in the code. A search for it
manifested a couple more locations with the same problem. This change
removes one of the "be"s.
2019-01-05 23:56:53 +08:00
kennytm
f11f85812f
Rollup merge of #57278 - mati865:config_clippy, r=alexcrichton
Add Clippy to config.toml.example

Omitted in https://github.com/rust-lang/rust/pull/51122

The order is based on ec194646fe/src/bootstrap/install.rs (L212)
2019-01-05 23:56:52 +08:00
kennytm
85ddc4d150
Rollup merge of #57273 - alexcrichton:update-stdsimd, r=nikomatsakis
Update the stdsimd submodule

Add a new cmpxchg16b intrinsics for x86_64 and some corrections for ARM/AArch64
2019-01-05 23:56:51 +08:00
kennytm
69d3c1a188
Rollup merge of #57267 - rust-lang:SimonSapin-patch-1, r=varkor
src/jemalloc is gone, remove its mention from COPYRIGHT

The `src/jemalloc` submodule was removed in 61e89446ef / https://github.com/rust-lang/rust/pull/55238.
2019-01-05 23:56:49 +08:00
kennytm
aa5fc743b5
Rollup merge of #57249 - frewsxcv:frewsxcv-second-edition, r=KodrAus
Fix broken links to second edition TRPL.

Fixes https://github.com/rust-lang/rust/issues/57104.

Remove `second-edition/` from TRPL hyperlinks.
2019-01-05 23:56:48 +08:00
kennytm
dd3e27357d
Rollup merge of #57238 - Zoxc:bt-fix, r=alexcrichton
Fix backtraces for inlined functions on Windows

Fixes an regression introduced in https://github.com/rust-lang/rust/pull/50526

r? @alexcrichton
2019-01-05 23:56:47 +08:00
kennytm
3d8e5d40c5
Rollup merge of #57233 - Smibu:rename-and-fix-nolink-test, r=alexcrichton
Rename and fix nolink-with-link-args test

There are three problems with the nolink-with-link-args test:

* The test fails when using MSVC. It's caused by the `linker-flavor=ld` flag which was added in #46291.
* In its comment, this test tests that "link_args are indeed passed when nolink is specified", but the `nolink` attribute has been removed [a long time ago](https://github.com/rust-lang/rust/pull/12826).
* Pattern has a small typo.

At first I was going to completely remove this test, but there is [a closed pull request for that](https://github.com/rust-lang/rust/pull/21090).

So:

* rename the file as suggested in the closed PR
* adjust the comment
* fix typo in the pattern
* add `ignore-msvc`.

r? @alexcrichton
2019-01-05 23:56:46 +08:00
kennytm
6c58b842d6
Rollup merge of #57229 - mikeyhew:fix-56806, r=varkor
Fix #56806 by using `delay_span_bug` in object safety layout sanity checks

It's possible that `is_object_safe` is called on a trait method that with an invalid receiver type. This caused an ICE in #56806, because `receiver_is_dispatchable` returns `true` for `self: Box<dyn Trait>`, which causes one of the layout sanity checks in object_safety.rs to fail. Replacing `bug!` with `delay_span_bug` solves this.

The fact that `receiver_is_dispatchable` returns `true` here could be considered a bug. It passes the check that the method implements, though: `Box<dyn Trait>` implements `DispatchFromDyn<Box<dyn Trait>>` because `dyn Trait` implements `Unsize<dyn Trait>`. It would be good to hear what @eddyb and @nikomatsakis think.

Note that I only added a test for the case encountered in #56806. I could not come up with a case that triggered an ICE from the other check, `bug!("receiver when Self = dyn Trait should be ScalarPair, found Scalar")`. There is no way, to my knowledge, that you can make `receiver_is_dispatchable` return true but still have a `Scalar` ABI when `Self = dyn Trait`.

One other case I encountered while debugging #56806 was that if you have a type parameter `T` that implements `Deref<Target=Self>` and `DispatchFromDyn<T>`, and use it as a method receiver, it will cause an ICE during `is_object_safe` because `T` has no layout ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=d9b7497b3be0ca8382fa7d9497263214)):

```rust
trait Trait<T: Deref<Target=Self> + DispatchFromDyn<T>> {
    fn foo(self: T) -> dyn Trait<T>;
}
```

I don't intend to remove the ICE there because it is a pathological case, especially since there is no way to implement `DispatchFromDyn<T>` for `T` — the checks in typeck/coherence/builtin.rs do not allow that.

fixes #56806
r? @varkor
2019-01-05 23:56:44 +08:00
kennytm
aa83481a5c
Rollup merge of #57219 - matthewjasper:mir-cleanup, r=nikomatsakis
Remove some unused code

Closes #57096
2019-01-05 23:56:43 +08:00
bors
68614265d3 Auto merge of #57101 - o01eg:fix-57014, r=alexcrichton
Search codegen backends based on target libdir instead of sysroot

Fixes #57014

Fixes cases with custom libdir when it consists of two or more parts.
2019-01-05 12:21:44 +00:00
bors
cae623c5ce Auto merge of #57099 - davidtwco:issue-57098, r=nikomatsakis
NLL: Add closure cannot be moved note.

Fixes #57098.

This PR extends existing logic for checking whether a closure that
is `FnOnce` and therefore moves variables that it captures from the
environment has already been invoked when being invoked again.

Now, this logic will also check whether the closure is being moved after
previously being moved or invoked and add an appropriate note.

r? @pnkfelix
2019-01-05 09:41:04 +00:00
bors
2fba17fc97 Auto merge of #56837 - arielb1:nonprincipal-trait-objects, r=nikomatsakis
Add support for trait-objects without a principal

The hard-error version of #56481 - should be merged after we do something about the `traitobject` crate.

Fixes #33140.
Fixes #57057.

r? @nikomatsakis
2019-01-05 03:36:31 +00:00
bors
244b05db12 Auto merge of #56145 - weiznich:re_rebalance_coherence, r=nikomatsakis
Implement the Re-rebalance coherence RFC

This is the first time I touch anything in the compiler so just tell me if I got something wrong.

Big thanks to @sgrif for the pointers where to look for those things.
cc #55437
2019-01-05 00:49:12 +00:00
Michael Hewson
2433526809 use delay_span_bug instead of bug! when doing layout sanity check
It's possible that `is_object_safe` is called on a trait that is ill-formed, and we shouldn't ICE unless there are no errors being raised. Using `delay_span_bug` solves this.

fixes #56806
2019-01-04 17:43:18 -05:00
bors
bf6bb141bb Auto merge of #56079 - mark-i-m:patch-1, r=nikomatsakis
Link to rustc guide

As proposed in https://github.com/rust-lang-nursery/rustc-guide/issues/239
2019-01-04 22:14:13 +00:00
Ariel Ben-Yehuda
c213b0db2e add test for #57162
Fixes #57162.
2019-01-04 21:53:00 +02:00
Ariel Ben-Yehuda
bb1afa19f5 add some debug logging to collect 2019-01-04 21:52:02 +02:00
bors
f381a96255 Auto merge of #56897 - euclio:parse-fatal, r=estebank
make `panictry!` private to libsyntax

This commit completely removes usage of the `panictry!` macro from
outside libsyntax. The macro causes parse errors to be fatal, so using
it in libsyntax_ext caused parse failures *within* a syntax extension to
be fatal, which is probably not intended.

Furthermore, this commit adds spans to diagnostics emitted by empty
extensions if they were missing, à la #56491.
2019-01-04 19:39:24 +00:00
wiktorkuchta
06243b1f4d
Fix repeated word in astconv.rs 2019-01-04 17:50:53 +00:00
Artem Varaksa
632d58436a
Update src/librustc/ty/fold.rs
Co-Authored-By: wiktorkuchta <35867657+wiktorkuchta@users.noreply.github.com>
2019-01-04 17:49:35 +00:00
bors
d6d32ac25d Auto merge of #56723 - oli-obk:lazy_const, r=nikomatsakis
Don't emit `Unevaluated` from `const_eval`

cc @eddyb @RalfJung
2019-01-04 17:01:24 +00:00
bors
ae167c91aa Auto merge of #56074 - matthewjasper:forbid-recursive-impl-trait, r=nikomatsakis
Forbid recursive impl trait

There is no type T, such that `T = [T; 2]`, but impl Trait could sometimes
be to circumvented this.

This patch makes it a hard error for an opaque type to resolve to such a
"type". Before this can be merged it needs

- [x] A better error message - it's good enough for now.
- [x] A crater run (?) to see if this any real-world code

closes #47659
2019-01-04 14:21:19 +00:00
Ariel Ben-Yehuda
10a89400cf alphabetize marker traits when printed
This makes sure they are printed in a compiler-version-independent
order, avoiding ui test instability.
2019-01-04 15:09:09 +02:00
bors
a602f13f02 Auto merge of #55986 - cjgillot:issue-45510, r=nikomatsakis
Allow to dispatch fn traits depending on number of parameters

Hello,

By following @eddyb's advise on issue #45510, I managed to have the snippets of code in #45510 and #18952 passing without breaking older diagnostics.

EDIT: the codegen tests breakage I experienced is due to the poor quality of my laptop.

If any kind reviewer has any advice, you are very welcome.
2019-01-04 11:51:30 +00:00
Georg Semmler
d758e4db78
Update tests changed by rebase 2019-01-04 10:19:22 +01:00
bors
ae38baed33 Auto merge of #57315 - ehuss:update-cargo, r=alexcrichton
Update cargo

24 commits in 0d1f1bbeabd5b43a7f3ecfa16540af8e76d5efb4..34320d212dca8cd27d06ce93c16c6151f46fcf2e
2018-12-19 14:45:14 +0000 to 2019-01-03 19:12:38 +0000
- Display environment variables for rustc commands (rust-lang/cargo#6492)
- Fix a very minor race condition in `cargo fix`. (rust-lang/cargo#6515)
- Add a high-level overview of how `fix` works. (rust-lang/cargo#6516)
- Add dependency `registry` to `cargo metadata`. (rust-lang/cargo#6500)
- Fix fingerprint calculation for patched deps. (rust-lang/cargo#6493)
- serialize version directly (rust-lang/cargo#6512)
- use DYLD_FALLBACK_LIBRARY_PATH for dylib_path_envvar on macOS (rust-lang/cargo#6355)
- Fix error message when resolving dependencies (rust-lang/cargo#6510)
- use PathBuf in cargo metadata (rust-lang/cargo#6511)
- Fixed link to testsuite in CONTRIBUTING.md (rust-lang/cargo#6506)
- Update display of contents of Cargo.toml (rust-lang/cargo#6501)
- Update display of contents of Cargo.toml (rust-lang/cargo#6502)
- Fixup cargo install's help message (rust-lang/cargo#6495)
- testsuite: Require failing commands to check output. (rust-lang/cargo#6497)
- Delete unnecessary 'return' (rust-lang/cargo#6496)
- Fix new unused patch warning. (rust-lang/cargo#6494)
- Some minor documentation changes. (rust-lang/cargo#6481)
- Add `links` to `cargo metadata`. (rust-lang/cargo#6480)
- Salvaged semver work (rust-lang/cargo#6476)
- Warn on unused patches. (rust-lang/cargo#6470)
- don't write a an incorrect rustc version to the fingerprint file (rust-lang/cargo#6473)
- Rewrite `login` and registry cleanups. (rust-lang/cargo#6466)
- [issue#6461] Fix cargo commands list (rust-lang/cargo#6462)
- Restrict registry names to same style as package names. (rust-lang/cargo#6469)
2019-01-04 09:10:13 +00:00
bors
62decc5c16 Auto merge of #56958 - alexcrichton:upgrade-docker, r=kennytm
ci: Upgrade Travis to Xenial

In theory we shouldn't require trusty so long as docker continues to
work!
2019-01-04 04:34:13 +00:00
Ariel Ben-Yehuda
0b511b7bd2 implement a hack to make traitobject 0.1.0 compile 2019-01-04 01:50:35 +02:00
Ariel Ben-Yehuda
7eb444e4f1 Revert "add coherence future-compat warnings for marker-only trait objects"
This reverts commit 760639635f.
2019-01-04 01:18:34 +02:00
Ariel Ben-Yehuda
e030aa8015 Revert "fix stupid bug"
This reverts commit 6e4b2b3ae7.
2019-01-04 00:34:53 +02:00
Ariel Ben-Yehuda
391a7ebd83 add comment to <List<ExistentialPredicates>>::principal 2019-01-04 00:34:53 +02:00
Ariel Ben-Yehuda
64857de2bd hack-fix to rustdoc 2019-01-04 00:34:53 +02:00
Ariel Ben-Yehuda
c2aa7485d2 add tests 2019-01-04 00:34:52 +02:00
Ariel Ben-Yehuda
4ab27b255c fix ppaux 2019-01-04 00:34:52 +02:00
Ariel Ben-Yehuda
571a15bd15 avoid giving a principal to marker-only trait objects
Fixes #33140.
2019-01-04 00:34:52 +02:00
Ariel Ben-Yehuda
3aa1503a61 add support for principal-less trait object types
should be a pure refactoring.
2019-01-04 00:34:52 +02:00
Matthew Jasper
65c1f54a06 Forbid impl Trait from referring to unnamable recursive types
There is no type T, such that `T = [T; 2]`, we should not allow this
to be circumvented by impl Trait.
2019-01-03 22:15:02 +00:00
Georg Semmler
ae5c092682
More test deduplication 2019-01-03 22:29:11 +01:00
Georg Semmler
2bc436e713
Add missing files 2019-01-03 22:27:12 +01:00
Georg Semmler
d6ffd88d21
Fix typo 2019-01-03 22:27:09 +01:00
Georg Semmler
464b4dcb2b
Unify tests
Implement compile tests as variants of existing tests
2019-01-03 22:27:06 +01:00
Georg Semmler
2888d5631c
Update some new tests to changed error messages 2019-01-03 22:27:03 +01:00
Georg Semmler
992712ef30
Fix failing compile tests 2019-01-03 22:27:00 +01:00
Georg Semmler
a31dd0a2f7
Directly check if input_ty is a type parameter and therefore a
uncoverd type
2019-01-03 22:26:57 +01:00
varkor
854ac40104
Update src/doc/unstable-book/src/language-features/re-rebalance-coherence.md
Co-Authored-By: weiznich <Georg_semmler_05@web.de>
2019-01-03 22:26:54 +01:00
Georg Semmler
1715be0e3c
Fix tidy 2019-01-03 22:26:51 +01:00