]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoPoint at function name span
Esteban Küber [Sun, 30 Dec 2018 23:41:19 +0000 (15:41 -0800)]
Point at function name span

5 years agoPoint at the return type span on type mismatch due to missing return
Esteban Küber [Sun, 30 Dec 2018 21:55:00 +0000 (13:55 -0800)]
Point at the return type span on type mismatch due to missing return

Do not point at the entire block span on fn return type mismatches
caused by missing return.

5 years agoAuto merge of #56225 - alexreg:type_alias_enum_variants, r=petrochenkov
bors [Sat, 29 Dec 2018 21:03:11 +0000 (21:03 +0000)]
Auto merge of #56225 - alexreg:type_alias_enum_variants, r=petrochenkov

Implement RFC 2338, "Type alias enum variants"

This PR implements [RFC 2338](https://github.com/rust-lang/rfcs/pull/2338), allowing one to write code like the following.

```rust
#![feature(type_alias_enum_variants)]

enum Foo {
    Bar(i32),
    Baz { i: i32 },
}

type Alias = Foo;

fn main() {
    let t = Alias::Bar(0);
    let t = Alias::Baz { i: 0 };
    match t {
        Alias::Bar(_i) => {}
        Alias::Baz { i: _i } => {}
    }
}
```

Since `Self` can be considered a type alias in this context, it also enables using `Self::Variant` as both a constructor and pattern.

Fixes issues #56199 and #56611.

N.B., after discussing the syntax for type arguments on enum variants with @petrochenkov and @eddyb (there are also a few comments on the [tracking issue](https://github.com/rust-lang/rust/issues/49683)), the consensus seems to be treat the syntax as follows, which ought to be backwards-compatible.

```rust
Option::<u8>::None; // OK
Option::None::<u8>; // OK, but lint in near future (hard error next edition?)
Alias::<u8>::None; // OK
Alias::None::<u8>; // Error
```

I do not know if this will need an FCP, but let's start one if so.

5 years agoAuto merge of #57197 - kennytm:rollup, r=kennytm
bors [Sat, 29 Dec 2018 18:12:57 +0000 (18:12 +0000)]
Auto merge of #57197 - kennytm:rollup, r=kennytm

Rollup of 7 pull requests

Successful merges:

 - #57149 (Fix typo in pin documentation)
 - #57153 (Small: Fix span in char documentation)
 - #57159 (Update references to closed issue)
 - #57163 (Give the crate select chevron room to breathe.)
 - #57168 (Removed aligned ZST requirement from docs of read_/write_unaligned.)
 - #57174 (Update link to rustc guide)
 - #57177 (Fix warning when compiling rustc)

Failed merges:

r? @ghost

5 years agoAuto merge of #56924 - ehuss:update-cargo-rls-miri, r=alexcrichton
bors [Sat, 29 Dec 2018 15:35:59 +0000 (15:35 +0000)]
Auto merge of #56924 - ehuss:update-cargo-rls-miri, r=alexcrichton

Update cargo, rls, miri

Update cargo, rls, miri

Added `rustc-workspace-hack` to miri so that it shares the same features for serde as other tools.

cc @alexcrichton

## cargo

25 commits in 2cf1f5dda2f7ed84e94c4d32f643e0f1f15352f0..0d1f1bbeabd5b43a7f3ecfa16540af8e76d5efb4
2018-12-11 03:44:04 +0000 to 2018-12-19 14:45:14 +0000
- Remove Stale bot's configuration (rust-lang/cargo#6463)
- Add labels to issue templates (rust-lang/cargo#6464)
- Fix new man page links. (rust-lang/cargo#6459)
- Fix metabuild compile errors with --message-format=json. (rust-lang/cargo#6432)
- Support alt-registry names in [patch] table. (rust-lang/cargo#6456)
- Update the rustup URL (rust-lang/cargo#6455)
- New man pages. (rust-lang/cargo#6405)
- Reify the DepFingerprint type (rust-lang/cargo#6451)
- Extract Fingerprint::new (rust-lang/cargo#6449)
- Upgrade the metabuild to Rust 2018 (rust-lang/cargo#6448)
- Make edition comparing code consistent (rust-lang/cargo#6450)
- Document `name` and `authors` in [package] (rust-lang/cargo#6447)
- Travis: only use mdbook 0.1.7. (rust-lang/cargo#6443)
- Update git2-curl requirement from 0.8.1 to 0.9.0 (rust-lang/cargo#6439)
- Update git2 requirement from 0.7.5 to 0.8.0 (rust-lang/cargo#6438)
- Display errors when `cargo fix` fails. (rust-lang/cargo#6419)
- cargo fix: fix targets with shared sources. (rust-lang/cargo#6434)
- Fix panic-in-panic in tests. (rust-lang/cargo#6431)
- More Rust 2018 edition cleanups (rust-lang/cargo#6422)
- Cleanup some trait impls for SourceId (rust-lang/cargo#6429)
- Remove a nightly check from doc tests (rust-lang/cargo#6427)
- Replace CargoError with failure::Error (rust-lang/cargo#6425)
- Allow testsuite warnings in dev (rust-lang/cargo#6426)
- add `--dry-run` option to cargo update (rust-lang/cargo#6371)
- Migrate to some Rust 2018 idioms (rust-lang/cargo#6416)

## rls

16 commits in bd5b899afb05e14d33e210ede3da241ca1ca088f..6f5e4bba7b1586fca6e0ea7724cadb5683b2f308
2018-12-10 08:53:00 +0100 to 2018-12-21 17:11:08 +0100
- Update jsonrpc-core (rust-lang-nursery/rls#1206)
- Use `home_dir` from `home` crate (rust-lang-nursery/rls#1207)
- Update cargo. (rust-lang-nursery/rls#1204)
- Fix deprecated `trim_{left,right}` warnings (rust-lang-nursery/rls#1203)
- Respect ${CARGO,RUSTUP}_HOME for tooltip relative dirs (rust-lang-nursery/rls#1201)
- Separate tooltip tests that require Racer fallback (rust-lang-nursery/rls#1200)
- tests: Don't generate tooltip results in tests/fixtures (rust-lang-nursery/rls#1199)
- Overhaul fixture handling in tests (rust-lang-nursery/rls#1190)
- Don't return symbols with empty names (rust-lang-nursery/rls#1193)
- Don't check AppVeyor CI status for bors
- Properly infer full_docs (rust-lang-nursery/rls#1192)
- Update cargo (rust-lang-nursery/rls#1191)
- Improve hover test_tooltip tests (rust-lang-nursery/rls#1175)
- Fix unused warnings (rust-lang-nursery/rls#1185)
- Workaround rust-lang-nursery/rls#703 to prevent obscure failures due to sccache. (rust-lang-nursery/rls#1177)
- Disable travis cache (rust-lang-nursery/rls#1182)

## miri

14 commits in bccadeb4f7cbeeb14097a365653148afe8bbd159..6c2fc6daf1ac6849d1243b213f5a3fb07feeef29
2018-12-08 11:07:22 +0100 to 2018-12-26 14:28:25 +0100
- use memory::check_bounds_ptr for offset check (solson/miri#589)
- Fix comparing function pointers (solson/miri#587)
- fix for infallible allocation (solson/miri#586)
- fix test for latest nightly (solson/miri#585)
- Treat ref-to-raw cast like a reborrow: do a special kind of retag (solson/miri#572)
- Test cargo-miri on Windows (solson/miri#578)
- Cargo miri tweaks and test that we can exclude tests (solson/miri#580)
- Fix cargo miri test (solson/miri#550)
- fix for latest nightly (solson/miri#574)
- Add rustc-workspace-hack. (solson/miri#575)
- use RUSTC_WRAPPER for the cargo hook (solson/miri#573)
- do not auto-detect the targets in the sysroot, instead specify target manually through env var (solson/miri#570)
- Cleanup: Avoid repeating signatures, get rid of to_bytes hack (solson/miri#568)
- Support building and running with full MIR on foreign architectures, drop support for missing MIR (solson/miri#566)

5 years agoAuto merge of #57181 - petrochenkov:impice3, r=estebank
bors [Sat, 29 Dec 2018 12:55:48 +0000 (12:55 +0000)]
Auto merge of #57181 - petrochenkov:impice3, r=estebank

resolve: Fix another ICE in import validation

Imports are allowed to have ambiguous resolutions as long as all of them have same `Def`.
As it turned out, it's possible for different `Module`s to have same `Def` when `extern crate` items are involved.

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

5 years agoRollup merge of #57177 - varkor:fix-duration_as_u128-warning, r=estebank
kennytm [Sat, 29 Dec 2018 10:50:32 +0000 (18:50 +0800)]
Rollup merge of #57177 - varkor:fix-duration_as_u128-warning, r=estebank

Fix warning when compiling rustc

5 years agoRollup merge of #57174 - linclark:patch-1, r=varkor
kennytm [Sat, 29 Dec 2018 10:50:30 +0000 (18:50 +0800)]
Rollup merge of #57174 - linclark:patch-1, r=varkor

Update link to rustc guide

5 years agoRollup merge of #57168 - kennytm:fix-unaligned-docs, r=rkruppe
kennytm [Sat, 29 Dec 2018 10:50:29 +0000 (18:50 +0800)]
Rollup merge of #57168 - kennytm:fix-unaligned-docs, r=rkruppe

Removed aligned ZST requirement from docs of read_/write_unaligned.

This is just a copy-paste error.

5 years agoRollup merge of #57163 - JohnHeitmann:chevron-fix, r=estebank
kennytm [Sat, 29 Dec 2018 10:50:28 +0000 (18:50 +0800)]
Rollup merge of #57163 - JohnHeitmann:chevron-fix, r=estebank

Give the crate select chevron room to breathe.

Before:
![screen shot 2018-12-27 at 10 26 10 pm](https://user-images.githubusercontent.com/4282480/50505100-9ff24300-0a26-11e9-9b74-37bdee6faf83.png)

After:
![screen shot 2018-12-27 at 10 25 57 pm](https://user-images.githubusercontent.com/4282480/50505110-a54f8d80-0a26-11e9-9fa2-7fed21773207.png)

5 years agoRollup merge of #57159 - ids1024:closed-issue, r=Centril
kennytm [Sat, 29 Dec 2018 10:50:27 +0000 (18:50 +0800)]
Rollup merge of #57159 - ids1024:closed-issue, r=Centril

Update references to closed issue

Issue #28979 was closed with a link to #55467.

5 years agoRollup merge of #57153 - estebank:doc, r=cramertj
kennytm [Sat, 29 Dec 2018 10:50:26 +0000 (18:50 +0800)]
Rollup merge of #57153 - estebank:doc, r=cramertj

Small: Fix span in char documentation

5 years agoRollup merge of #57149 - rust-lang:sgrif-patch-1, r=rkruppe
kennytm [Sat, 29 Dec 2018 10:50:24 +0000 (18:50 +0800)]
Rollup merge of #57149 - rust-lang:sgrif-patch-1, r=rkruppe

Fix typo in pin documentation

Affect is a verb, effect is a noun

5 years agoAuto merge of #57160 - petrochenkov:impice2, r=estebank
bors [Sat, 29 Dec 2018 10:17:10 +0000 (10:17 +0000)]
Auto merge of #57160 - petrochenkov:impice2, r=estebank

resolve: Fix an ICE in import validation

Fixes ICE reported in the comment https://github.com/rust-lang/rust/issues/56596#issuecomment-449866807

5 years agoAuto merge of #57140 - estebank:str-err, r=varkor
bors [Sat, 29 Dec 2018 07:28:15 +0000 (07:28 +0000)]
Auto merge of #57140 - estebank:str-err, r=varkor

Tweaks to format string diagnostics

Add label spans and fix incorrect spans.

Fix #55155, fix #55350.

5 years agoFixed stderr files for ui tests.
Alexander Regueiro [Sat, 29 Dec 2018 05:45:45 +0000 (05:45 +0000)]
Fixed stderr files for ui tests.

5 years agoUpdate cargo, rls, miri
Eric Huss [Mon, 17 Dec 2018 18:23:04 +0000 (10:23 -0800)]
Update cargo, rls, miri

5 years agoAuto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavus
bors [Sat, 29 Dec 2018 01:22:04 +0000 (01:22 +0000)]
Auto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavus

Add no-crate filter option on rustdoc

@onur asked me about it so here it is!

r? @QuietMisdreavus

5 years agoAuto merge of #57138 - matthiaskrgr:clippy, r=oli-obk
bors [Fri, 28 Dec 2018 22:41:04 +0000 (22:41 +0000)]
Auto merge of #57138 - matthiaskrgr:clippy, r=oli-obk

submodules: update clippy from fc24fce7 to 721f688e

Fixes clippy toolstate.

Changes:
````
rustup https://github.com/rust-lang/rust/pull/57069
Rustfmt.
fix breakage from rust-lang/rust#57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````

r? @oli-obk

5 years agoresolve: Fix another ICE in import validation
Vadim Petrochenkov [Fri, 28 Dec 2018 21:15:19 +0000 (00:15 +0300)]
resolve: Fix another ICE in import validation

5 years agoAuto merge of #57118 - Zoxc:query-stats, r=wesleywiser
bors [Fri, 28 Dec 2018 20:02:23 +0000 (20:02 +0000)]
Auto merge of #57118 - Zoxc:query-stats, r=wesleywiser

Add a command line flag to print some query stats

r? @michaelwoerister

5 years agoFix warning when compiling rustc
varkor [Fri, 28 Dec 2018 19:28:57 +0000 (19:28 +0000)]
Fix warning when compiling rustc

5 years agoUpdate link to rustc guide
Lin Clark [Fri, 28 Dec 2018 18:34:00 +0000 (13:34 -0500)]
Update link to rustc guide

5 years agosubmodules: update clippy from fc24fce7 to f7bdf500
Matthias Krüger [Thu, 27 Dec 2018 16:34:48 +0000 (17:34 +0100)]
submodules: update clippy from  fc24fce7 to f7bdf500

Fixes clippy toolstate

Changes:
````
Match on ast/hir::ExprKind::Err
Update *.stderr files
Use -Zui-testing flag
Mention S-inactive-closed PRs in the CONTRIBUTING.md
tests: fix formatting and update test output
base tests: make sure to fail CI if tests need formatting
base tests: switch to nightly toolchain before checking formatting of tests with rustfmt
rustup https://github.com/rust-lang/rust/pull/57069
Rustfmt.
fix breakage from rust-lang/rust#57088
fix a couple of ftrivial typos (NFC).
update CARGO_CLIPPY_HELP string to suggest tool lints.
rustc_tools_util: add readme
rustc_tool_utils: expand Cargo.toml with a few keywords in preparation for crates.io release
Fix macro detection in `empty_loop`.
Changed `macro_backtrace()` to `in_macro()`.
Fix lint detection on macro expansion.
````

5 years agoAuto merge of #57167 - Dylan-DPC:feature/non-zero-getters, r=SimonSapin
bors [Fri, 28 Dec 2018 15:10:17 +0000 (15:10 +0000)]
Auto merge of #57167 - Dylan-DPC:feature/non-zero-getters, r=SimonSapin

Make the getter for NonZero types into a const fn

Closes https://github.com/rust-lang/rust/issues/53331

Rework of #56739

cc @Lokathor

r? @oli-obk

5 years agoRemoved aligned ZST requirement from docs of read_/write_unaligned.
kennytm [Fri, 28 Dec 2018 14:00:33 +0000 (22:00 +0800)]
Removed aligned ZST requirement from docs of read_/write_unaligned.

This is just a copy-paste error.

5 years agoUpdate src/test/ui/consts/const-nonzero.rs
Oliver Scherer [Fri, 28 Dec 2018 12:15:49 +0000 (17:45 +0530)]
Update src/test/ui/consts/const-nonzero.rs

Co-Authored-By: Dylan-DPC <dylan.dpc@gmail.com>
5 years agoMake the getter for NonZero types into a const fn
dylan_DPC [Fri, 28 Dec 2018 11:28:55 +0000 (16:58 +0530)]
Make the getter for NonZero types into a const fn

5 years agoAuto merge of #57137 - cramertj:unpin-prelude, r=SimonSapin
bors [Fri, 28 Dec 2018 10:54:16 +0000 (10:54 +0000)]
Auto merge of #57137 - cramertj:unpin-prelude, r=SimonSapin

Add Unpin to std prelude, not just core

r? @alexcrichton

5 years agoAuto merge of #55519 - fhartwig:hashmap-index-example, r=Centril
bors [Fri, 28 Dec 2018 06:52:15 +0000 (06:52 +0000)]
Auto merge of #55519 - fhartwig:hashmap-index-example, r=Centril

Add example of using the indexing operator to HashMap docs

Fixes #52575

5 years agoGive the crate select chevron room to breathe.
John Heitmann [Fri, 28 Dec 2018 06:26:54 +0000 (22:26 -0800)]
Give the crate select chevron room to breathe.

5 years agoAuto merge of #57155 - petrochenkov:dcrate3, r=dtolnay
bors [Fri, 28 Dec 2018 02:54:14 +0000 (02:54 +0000)]
Auto merge of #57155 - petrochenkov:dcrate3, r=dtolnay

Resolve `$crate`s for pretty-printing at more appropriate time

Doing it in `BuildReducedGraphVisitor` wasn't a good idea, identifiers wasn't actually visited half of the time.
As a result some `$crate`s weren't resolved and were therefore pretty-printed as `$crate` literally, which turns into two tokens during re-parsing of the pretty-printed text.

Now we are visiting and resolving `$crate` identifiers in an item right before sending that item to a proc macro attribute or derive.

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

5 years agoresolve: Fix an ICE in import validation
Vadim Petrochenkov [Fri, 28 Dec 2018 02:20:11 +0000 (05:20 +0300)]
resolve: Fix an ICE in import validation

5 years agoUpdate references to closed issue
Ian Douglas Scott [Fri, 28 Dec 2018 00:49:12 +0000 (16:49 -0800)]
Update references to closed issue

Issue #28979 was closed with a link to #55467.

5 years agoAuto merge of #56999 - petrochenkov:macrecov2, r=estebank
bors [Thu, 27 Dec 2018 22:27:27 +0000 (22:27 +0000)]
Auto merge of #56999 - petrochenkov:macrecov2, r=estebank

AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end

This way we can avoid aborting compilation if expansion produces errors and generate `ExprKind::Err`s instead.

5 years agoResolve `$crate`s for pretty-printing at more appropriate time
Vadim Petrochenkov [Thu, 27 Dec 2018 21:31:28 +0000 (00:31 +0300)]
Resolve `$crate`s for pretty-printing at more appropriate time

5 years agoAdd test demonstrating disintegration of `$crate` into `$` and `crate`
Vadim Petrochenkov [Thu, 27 Dec 2018 18:13:49 +0000 (21:13 +0300)]
Add test demonstrating disintegration of `$crate` into `$` and `crate`

5 years agoAuto merge of #56384 - scalexm:chalk, r=nikomatsakis
bors [Thu, 27 Dec 2018 19:47:56 +0000 (19:47 +0000)]
Auto merge of #56384 - scalexm:chalk, r=nikomatsakis

Implement the new-style trait solver

Final PR of what I believe to be a minimally working implementation of the new-style trait solver.

The new trait solver can be used by providing the `-Z chalk` command line flag. It is currently used everywhere in `rustc_typeck`, and for everything relying on `rustc::infer::canonical::query_response::enter_canonical_trait_query`.

The trait solver is invoked in rustc by using the `evaluate_goal` canonical query. This is not optimal because each call to `evaluate_goal` creates a new `chalk_engine::Forest`, hence rustc cannot use answers to intermediate goals produced by the root goal. We'll need to change that but I guess that's ok for now.

Some next steps, I think, are:
* handle region constraints: region constraints are computed but are completely ignored for now, I think we may need additional support from `chalk_engine` (as a side effect, types or trait references with outlive requirements cannot be proved well-formed)
* deactivate eager normalization in the presence of `-Z chalk` in order to leverage the lazy normalization strategy of the new-style trait solver
* add the remaining built-in impls (only `Sized` is supported currently)
* transition the compiler to using generic goals instead of predicates that still refer to named type parameters etc

I added a few very simple tests to check that the new solver has the right behavior, they won't be needed anymore once it is mature enough. Additionally it shows off that we get [implied bounds](https://github.com/rust-lang/rust/issues/44491) for free.

r? @nikomatsakis

5 years agoFix span in char documentation
Esteban Küber [Thu, 27 Dec 2018 19:36:05 +0000 (11:36 -0800)]
Fix span in char documentation

5 years agoSet a `def_id` in `ParamEnv` only with `-Z chalk`
scalexm [Thu, 20 Dec 2018 18:54:11 +0000 (19:54 +0100)]
Set a `def_id` in `ParamEnv` only with `-Z chalk`

5 years agoAdd tests
scalexm [Fri, 30 Nov 2018 14:07:38 +0000 (15:07 +0100)]
Add tests

5 years agoFix `tcx.environment` for inherent impls
scalexm [Fri, 30 Nov 2018 14:06:49 +0000 (15:06 +0100)]
Fix `tcx.environment` for inherent impls

5 years agoAdd `wf_clause_for_fn_def`
scalexm [Wed, 28 Nov 2018 22:29:26 +0000 (23:29 +0100)]
Add `wf_clause_for_fn_def`

5 years agoUse `TraitEngine` in `enter_canonical_trait_query`
scalexm [Wed, 28 Nov 2018 22:29:01 +0000 (23:29 +0100)]
Use `TraitEngine` in `enter_canonical_trait_query`

5 years agoHandle sub-typing in chalk-engine
scalexm [Wed, 28 Nov 2018 21:11:00 +0000 (22:11 +0100)]
Handle sub-typing in chalk-engine

5 years agoIntegrate chalk engine
scalexm [Sat, 24 Nov 2018 19:18:16 +0000 (20:18 +0100)]
Integrate chalk engine

5 years agoFix binding levels in implied bounds rules
scalexm [Sat, 24 Nov 2018 19:17:42 +0000 (20:17 +0100)]
Fix binding levels in implied bounds rules

5 years agoFix replacement of escaping bound types
scalexm [Sat, 24 Nov 2018 16:13:54 +0000 (17:13 +0100)]
Fix replacement of escaping bound types

Multiple references to the same `BoundTy` were not using the same
result.

5 years agoFix `Sized` requirement for empty tuples in `program_clauses`
scalexm [Fri, 23 Nov 2018 20:06:55 +0000 (21:06 +0100)]
Fix `Sized` requirement for empty tuples in `program_clauses`

5 years agoAdd builtin impls for `Sized` in `chalk_context::program_clauses`
scalexm [Fri, 23 Nov 2018 21:48:33 +0000 (22:48 +0100)]
Add builtin impls for `Sized` in `chalk_context::program_clauses`

5 years agoRename functions giving WF clauses for builtin types
scalexm [Fri, 23 Nov 2018 21:47:00 +0000 (22:47 +0100)]
Rename functions giving WF clauses for builtin types

5 years agoAdd utilities for creating generic types
scalexm [Fri, 23 Nov 2018 21:43:59 +0000 (22:43 +0100)]
Add utilities for creating generic types

5 years agoReturn an instantiated environment instead of a generic one
scalexm [Fri, 23 Nov 2018 20:03:27 +0000 (21:03 +0100)]
Return an instantiated environment instead of a generic one

5 years agoCorrectly lift empty lists of clauses and goals
scalexm [Fri, 23 Nov 2018 18:47:22 +0000 (19:47 +0100)]
Correctly lift empty lists of clauses and goals

5 years agoFix `visit_ex_clause_with`
scalexm [Fri, 23 Nov 2018 18:45:39 +0000 (19:45 +0100)]
Fix `visit_ex_clause_with`

The sub-visits were incorrectly combined with an `&&` instead of
an `||`.

5 years agoAdd a def-id in `ty::ParamEnv`
scalexm [Sat, 17 Nov 2018 17:56:14 +0000 (18:56 +0100)]
Add a def-id in `ty::ParamEnv`

5 years agoImplement "lifetime juggling" methods from chalk integration trait
scalexm [Fri, 23 Nov 2018 18:42:14 +0000 (19:42 +0100)]
Implement "lifetime juggling" methods from chalk integration trait

Fixes #55097.

5 years agoImplement `is_coinductive`
scalexm [Fri, 23 Nov 2018 18:16:02 +0000 (19:16 +0100)]
Implement `is_coinductive`

Fixes #55096.

5 years agoAuto merge of #56852 - kennytm:test-publish-toolstate-in-ci, r=Mark-Simulacrum
bors [Thu, 27 Dec 2018 17:16:59 +0000 (17:16 +0000)]
Auto merge of #56852 - kennytm:test-publish-toolstate-in-ci, r=Mark-Simulacrum

Added a job to dry-run the publish_toolstate.py once

Closes #56848.

Requires #56847 to be merged first.

5 years agoFix typo in pin documentation
Sean Griffin [Thu, 27 Dec 2018 15:53:43 +0000 (08:53 -0700)]
Fix typo in pin documentation

Affect is a verb, effect is a noun

5 years agoAuto merge of #56838 - Aaron1011:fix/rustdoc-infer-unify, r=nikomatsakis
bors [Thu, 27 Dec 2018 14:35:58 +0000 (14:35 +0000)]
Auto merge of #56838 - Aaron1011:fix/rustdoc-infer-unify, r=nikomatsakis

Call poly_project_and_unify_type on types that contain inference types

Commit f57247c48cb59 (Ensure that Rusdoc discovers all necessary auto
trait bounds) added a check to ensure that we only attempt to unify a
projection predicatre with inference variables. However, the check it
added was too strict - instead of checking that a type *contains* an
inference variable (e.g. '&_', 'MyType<_>'), it required the type to
*be* an inference variable (i.e. only '_' would match).

This commit relaxes the check to use 'ty.has_infer_types', ensuring that
we perform unification wherever possible.

Fixes #56822

5 years agoFix rebase and more CI failures
Vadim Petrochenkov [Thu, 27 Dec 2018 00:07:00 +0000 (03:07 +0300)]
Fix rebase and more CI failures

5 years agoAddress review comments and CI failures
Vadim Petrochenkov [Thu, 20 Dec 2018 23:58:55 +0000 (02:58 +0300)]
Address review comments and CI failures

5 years agoMake sure feature gate errors are recoverable
Vadim Petrochenkov [Thu, 20 Dec 2018 22:47:03 +0000 (01:47 +0300)]
Make sure feature gate errors are recoverable

5 years agoFix `trace_macros` and `log_syntax`
Vadim Petrochenkov [Thu, 20 Dec 2018 00:57:48 +0000 (03:57 +0300)]
Fix `trace_macros` and `log_syntax`

5 years agoGet rid of `Block::recovered`
Vadim Petrochenkov [Wed, 19 Dec 2018 23:33:56 +0000 (02:33 +0300)]
Get rid of `Block::recovered`

5 years agoDo not abort compilation if expansion produces errors
Vadim Petrochenkov [Sun, 16 Dec 2018 17:23:27 +0000 (20:23 +0300)]
Do not abort compilation if expansion produces errors

Fix a number of uncovered deficiencies in diagnostics

5 years agoAST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end
Vadim Petrochenkov [Mon, 17 Dec 2018 01:57:32 +0000 (04:57 +0300)]
AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-end

5 years agoAuto merge of #57133 - SimonSapin:zero, r=oli-obk
bors [Thu, 27 Dec 2018 12:01:08 +0000 (12:01 +0000)]
Auto merge of #57133 - SimonSapin:zero, r=oli-obk

Remove the private generic NonZero<T> wrapper type

Instead, use `#[rustc_layout_scalar_valid_range_start(1)]` directly on relevant libcore types.

5 years agoAuto merge of #57119 - jethrogb:jb/sgx-os-mod2, r=joshtriplett
bors [Thu, 27 Dec 2018 09:21:06 +0000 (09:21 +0000)]
Auto merge of #57119 - jethrogb:jb/sgx-os-mod2, r=joshtriplett

Add `io` and `arch` modules to `std::os::fortanix_sgx`

This PR adds two more (unstable) modules to `std::os::fortanix_sgx` for the `x86_64-fortanix-unknown-sgx` target.

### io
`io` allows conversion between raw file descriptors and Rust types, similar to `std::os::unix::io`.

### arch
`arch` exposes the `ENCLU[EREPORT]` and `ENCLU[EGETKEY]` instructions. The current functions are very likely not going to be the final form of these functions (see also https://github.com/fortanix/rust-sgx/issues/15), but this should be sufficient to enable experimentation in libraries. I tried using the actual types (from the [`sgx-isa` crate](https://crates.io/crates/sgx-isa)) instead of byte arrays, but that would make `std` dependent on the `bitflags` crate which I didn't want to do at this time.

5 years agoAuto merge of #57129 - RalfJung:check-bounds, r=oli-obk
bors [Thu, 27 Dec 2018 06:48:18 +0000 (06:48 +0000)]
Auto merge of #57129 - RalfJung:check-bounds, r=oli-obk

make Alloc::check_bounds_ptr private; you should use Memory::check_bounds_ptr instead

r? @oli-obk

5 years agoAdded a job to dry-run the publish_toolstate.py once
kennytm [Sat, 15 Dec 2018 15:44:46 +0000 (23:44 +0800)]
Added a job to dry-run the publish_toolstate.py once

5 years agoAdd span label to unused string formatting argument
Esteban Küber [Thu, 27 Dec 2018 04:18:41 +0000 (20:18 -0800)]
Add span label to unused string formatting argument

Fix #55350.

5 years agoPoint at correct span for arguments in format strings
Esteban Küber [Thu, 27 Dec 2018 04:05:56 +0000 (20:05 -0800)]
Point at correct span for arguments in format strings

When a format string has escaped whitespace characters format
arguments were shifted by one per each escaped character. Account
for these escaped characters when synthesizing the spans.

Fix #55155.

5 years agoAuto merge of #57069 - estebank:str-err, r=@cramertj
bors [Thu, 27 Dec 2018 02:00:17 +0000 (02:00 +0000)]
Auto merge of #57069 - estebank:str-err, r=@cramertj

Various changes to string format diagnostics

- Point at opening mismatched formatting brace
- Account for differences between raw and regular strings
- Account for differences between the code snippet and `InternedString`
- Add more tests

```
error: invalid format string: expected `'}'`, found `'t'`
  --> $DIR/ifmt-bad-arg.rs:85:1
   |
LL | ninth number: {
   |               - because of this opening brace
LL | tenth number: {}",
   | ^ expected `}` in format string
   |
   = note: if you intended to print `{`, you can escape it using `{{`
```

Fix #53837.

5 years agoVarious changes to string format diagnostics
Esteban Küber [Fri, 21 Dec 2018 06:33:16 +0000 (22:33 -0800)]
Various changes to string format diagnostics

- Point at opening mismatched formatting brace
- Account for differences between raw and regular strings
- Account for differences between the code snippet and `InternedString`
- Add more tests

5 years agoAuto merge of #57124 - sunjay:stable_duration_as_u128, r=Centril
bors [Wed, 26 Dec 2018 22:19:40 +0000 (22:19 +0000)]
Auto merge of #57124 - sunjay:stable_duration_as_u128, r=Centril

Stabilize Duration::{as_millis, as_micros, as_nanos}

Fixes #50202. :tada:

This is the stabilization PR for the `duration_as_u128` feature. I have never made one of these before so please let me know if I missed a step. I followed the [guide in the Rust Forge](https://forge.rust-lang.org/stabilization-guide.html) and also found some old stabilization PRs ([1](https://github.com/rust-lang/rust/pull/57002), [2](https://github.com/rust-lang/rust/pull/56207)) for similar features to base my work on.

5 years agoChanged resolution of enum variants to low priority.
Alexander Regueiro [Wed, 26 Dec 2018 16:38:35 +0000 (16:38 +0000)]
Changed resolution of enum variants to low priority.

5 years agoMinor cosmetic changes
Alexander Regueiro [Wed, 26 Dec 2018 16:15:42 +0000 (16:15 +0000)]
Minor cosmetic changes

5 years agoMinor clean-up
Alexander Regueiro [Wed, 26 Dec 2018 00:07:31 +0000 (00:07 +0000)]
Minor clean-up

5 years agoFixed ICE when type arguments are specified on `Self` type.
Alexander Regueiro [Thu, 20 Dec 2018 18:38:55 +0000 (18:38 +0000)]
Fixed ICE when type arguments are specified on `Self` type.

5 years agoFixed type inference for tuple struct variants.
Alexander Regueiro [Thu, 20 Dec 2018 03:26:07 +0000 (03:26 +0000)]
Fixed type inference for tuple struct variants.

5 years agoFixed handling of unit variants of aliased enums in type NS.
Alexander Regueiro [Tue, 18 Dec 2018 18:59:00 +0000 (18:59 +0000)]
Fixed handling of unit variants of aliased enums in type NS.

5 years agoAdded regression test for using generic parameters on modules.
Alexander Regueiro [Tue, 18 Dec 2018 00:40:22 +0000 (00:40 +0000)]
Added regression test for using generic parameters on modules.

5 years agoFixed several ICEs.
Alexander Regueiro [Mon, 17 Dec 2018 18:49:45 +0000 (18:49 +0000)]
Fixed several ICEs.

5 years agoRemoved unnecessary special handling of `VariantCtor` defs in `instantiate_value_path`.
Alexander Regueiro [Sat, 15 Dec 2018 14:54:33 +0000 (14:54 +0000)]
Removed unnecessary special handling of `VariantCtor` defs in `instantiate_value_path`.

5 years agoExpanded tests for enum variants with generic args.
Alexander Regueiro [Sat, 15 Dec 2018 14:48:52 +0000 (14:48 +0000)]
Expanded tests for enum variants with generic args.

5 years agoFixed issues raised in review.
Alexander Regueiro [Sat, 15 Dec 2018 04:40:09 +0000 (04:40 +0000)]
Fixed issues raised in review.

5 years agoAdded tests for enums & enum aliases with various combinations of generic args.
Alexander Regueiro [Thu, 13 Dec 2018 16:46:34 +0000 (16:46 +0000)]
Added tests for enums & enum aliases with various combinations of generic args.

5 years agoWork-around for shadowing of variant names with assoc const names in `libproc_macro...
Alexander Regueiro [Fri, 7 Dec 2018 02:12:49 +0000 (02:12 +0000)]
Work-around for shadowing of variant names with assoc const names in `libproc_macro/bridge/rpc.rs`.

5 years agoFixed issues raised in first review.
Alexander Regueiro [Thu, 6 Dec 2018 04:22:56 +0000 (04:22 +0000)]
Fixed issues raised in first review.

5 years agoAdded chapter to Unstable Book.
Alexander Regueiro [Mon, 3 Dec 2018 01:08:41 +0000 (01:08 +0000)]
Added chapter to Unstable Book.

5 years agoFixed more tests.
Alexander Regueiro [Fri, 7 Dec 2018 18:15:36 +0000 (18:15 +0000)]
Fixed more tests.

5 years agoFixed tests.
Alexander Regueiro [Thu, 6 Dec 2018 01:02:21 +0000 (01:02 +0000)]
Fixed tests.

5 years agoMade suggestion diagnostics more consistent for enum variant names, relative to metho...
Alexander Regueiro [Mon, 3 Dec 2018 00:56:47 +0000 (00:56 +0000)]
Made suggestion diagnostics more consistent for enum variant names, relative to method names.

5 years agoAdded tests for feature.
Alexander Regueiro [Mon, 3 Dec 2018 00:56:08 +0000 (00:56 +0000)]
Added tests for feature.

5 years agoImplemented variants on type aliases in both ctor and pattern position.
Alexander Regueiro [Mon, 3 Dec 2018 21:50:49 +0000 (21:50 +0000)]
Implemented variants on type aliases in both ctor and pattern position.

5 years agoStore `Ident` rather than just `Name` in HIR types `Item` and `ForeignItem`.
Alexander Regueiro [Sat, 1 Dec 2018 02:47:08 +0000 (02:47 +0000)]
Store `Ident` rather than just `Name` in HIR types `Item` and `ForeignItem`.

5 years agoAdd Unpin to std prelude, not just core
Taylor Cramer [Wed, 26 Dec 2018 20:20:38 +0000 (12:20 -0800)]
Add Unpin to std prelude, not just core

5 years agoRemove the private generic NonZero<T> wrapper type.
Simon Sapin [Wed, 26 Dec 2018 17:27:30 +0000 (18:27 +0100)]
Remove the private generic NonZero<T> wrapper type.

Instead, use `#[rustc_layout_scalar_valid_range_start(1)]` directly
on relevant libcore types.