Commit Graph

88136 Commits

Author SHA1 Message Date
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
Philipp Hansch
79ea93c54c
librustc_mir: Make qualify_min_const_fn module public
Trying to write a `const_fn` lint for Clippy. @oli-obk suggested
[here][link] to use the `is_min_const_fn` function from the
`qualify_min_const_fn` module. However, the module is currently private
and this commit makes it public.

I lack any historical knowledge of the development of the `const_fn`
feature, so I'm not sure if it was private on purpose or not. fwiw, all
modules are already public except `qualify_min_const_fn`.

[link]: https://github.com/rust-lang/rust-clippy/issues/2440#issuecomment-446109978
2019-01-04 20:19:04 +01:00
Esteban Küber
211365d68c review comments 2019-01-04 11:17:23 -08:00
Igor Matuszewski
480d0f3a31 Remove unused name from CrateAnalysis 2019-01-04 20:01:01 +01:00
Igor Matuszewski
a1189ac058 Replace CrateAnalysis::access_levels with query 2019-01-04 19:12:48 +01: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
QuietMisdreavus
0b55c79072 force binary filename for compiled doctests 2019-01-04 09:57:17 -06:00
Eric Huss
2b6caccd76 Bump stage0 2019-01-04 07:30:20 -08: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
king6cong
d60fa1d3c2 Doc rewording, use the same name writer 2019-01-04 11:23:24 +08: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
Alex Crichton
ccbf28eae8 rustc: Fix regression where jemalloc isn't used
In #56986 the linkage of jemalloc to the compiler was switched from the
driver library to the rustc binary to ensure that only rustc itself uses
jemalloc. In doing so, however, it turns out jemalloc wasn't actually
linked in at all! None of the symbols were referenced so the static
library wasn't used. This means that jemalloc wasn't pulled in at all.

This commit performs a bit of a dance to reference jemalloc symbols,
attempting to pull it in despite LLVM's optimizations.

Closes #57115
2019-01-03 13:52:36 -08: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
Georg Semmler
70645e79b6
Add some docs about the new feature to the unstable book 2019-01-03 22:26:47 +01:00
Georg Semmler
bcd7acfe04
Add some tests
This copies and adjusts the existing coherence tests to ensure that
they continue to work using the new implementation.
2019-01-03 22:26:44 +01:00
Georg Semmler
757d7ba9c9
Implement the re-rebalance coherence rfc 2019-01-03 22:26:40 +01:00
Eric Huss
57790b8524 Update cargo 2019-01-03 12:59:54 -08:00
Matthew Jasper
7ba17aa72f Display impl Sized correctly
It used to display as just `impl`
2019-01-03 20:49:01 +00:00
Wiktor Kuchta
190d139f3a Fix repeated word typos
Found with `git grep -P '\b([a-z]+)\s+\1\b'`
2019-01-03 21:33:37 +01:00
Alex Crichton
66f0e42b4e ci: Upgrade Travis to Xenial
In theory we shouldn't require trusty so long as docker continues to
work!
2019-01-03 12:22:37 -08:00