]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoReduce genericity in Filter and FilterMap
Josh Stone [Fri, 12 Jul 2019 00:17:54 +0000 (17:17 -0700)]
Reduce genericity in Filter and FilterMap

4 years agoRemove genericity in StepBy::size_hint
Josh Stone [Thu, 11 Jul 2019 23:03:21 +0000 (16:03 -0700)]
Remove genericity in StepBy::size_hint

4 years agoReduce genericity in Copied and Cloned
Josh Stone [Thu, 11 Jul 2019 22:27:56 +0000 (15:27 -0700)]
Reduce genericity in Copied and Cloned

4 years agoAvoid closures in the default <Zip as ZipImpl>::next
Josh Stone [Thu, 11 Jul 2019 21:49:15 +0000 (14:49 -0700)]
Avoid closures in the default <Zip as ZipImpl>::next

4 years agoReduce genericity in FlattenCompat
Josh Stone [Thu, 11 Jul 2019 21:03:48 +0000 (14:03 -0700)]
Reduce genericity in FlattenCompat

4 years agoAvoid closures in OnceWith and Successors
Josh Stone [Thu, 11 Jul 2019 20:14:09 +0000 (13:14 -0700)]
Avoid closures in OnceWith and Successors

4 years agoReduce genericity in Iterator::last
Josh Stone [Thu, 11 Jul 2019 19:57:25 +0000 (12:57 -0700)]
Reduce genericity in Iterator::last

4 years agoReduce the genericity of Map folds
Josh Stone [Mon, 8 Jul 2019 23:16:24 +0000 (16:16 -0700)]
Reduce the genericity of Map folds

4 years agoAdd codegen tests for the genericity of fold closures
Josh Stone [Mon, 8 Jul 2019 22:15:19 +0000 (15:15 -0700)]
Add codegen tests for the genericity of fold closures

4 years agoExplicitly test Iterator::position overflows
Josh Stone [Mon, 8 Jul 2019 19:10:58 +0000 (12:10 -0700)]
Explicitly test Iterator::position overflows

4 years agoExplicitly test Iterator::count overflows
Josh Stone [Mon, 8 Jul 2019 19:03:21 +0000 (12:03 -0700)]
Explicitly test Iterator::count overflows

4 years agoUse if-let in is_sorted_by
Josh Stone [Sat, 6 Jul 2019 01:28:27 +0000 (18:28 -0700)]
Use if-let in is_sorted_by

4 years agoReduce the genericity of closures in the iterator traits
Josh Stone [Sat, 6 Jul 2019 01:06:06 +0000 (18:06 -0700)]
Reduce the genericity of closures in the iterator traits

By default, closures inherit the generic parameters of their scope,
including `Self`. However, in most cases, the closures used to implement
iterators don't need to be generic on the iterator type, only its `Item`
type. We can reduce this genericity by redirecting such closures through
local functions.

This does make the closures more cumbersome to write, but it will
hopefully reduce duplication in their monomorphizations, as well as
their related type lengths.

4 years agoAuto merge of #63483 - RalfJung:invalid-value, r=Centril
bors [Mon, 12 Aug 2019 12:43:33 +0000 (12:43 +0000)]
Auto merge of #63483 - RalfJung:invalid-value, r=Centril

Improve invalid_value lint message

The lint now explains which type is involved and why it cannot be initialized this way. It also points at the innermost struct/enum field that has an offending type, if any.

See https://github.com/erlepereira/x11-rs/issues/99#issuecomment-520311911 for how this helps in some real-world code hitting this lint.

4 years agomore informative error message from invalid_value lint
Ralf Jung [Mon, 12 Aug 2019 07:24:13 +0000 (09:24 +0200)]
more informative error message from invalid_value lint

4 years agoAuto merge of #63489 - Centril:rollup-uuf6z1s, r=Centril
bors [Mon, 12 Aug 2019 08:58:48 +0000 (08:58 +0000)]
Auto merge of #63489 - Centril:rollup-uuf6z1s, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #62108 (Use sharded maps for queries)
 - #63297 (Improve pointer offset method docs)
 - #63406 (Suggest using a qualified path in patterns with inconsistent bindings)
 - #63431 (Revert "Simplify MIR generation for logical ops")
 - #63449 (resolve: Remove remaining special cases from built-in macros)
 - #63461 (docs: add stdlib env::var(_os) panic)
 - #63473 (Regression test for #56870)
 - #63474 (Add tests for issue #53598 and #57700)
 - #63480 (Fixes #63477)

Failed merges:

r? @ghost

4 years agoRollup merge of #63480 - OptimisticPeach:patch-1, r=Centril
Mazdak Farrokhzad [Mon, 12 Aug 2019 08:58:24 +0000 (10:58 +0200)]
Rollup merge of #63480 - OptimisticPeach:patch-1, r=Centril

Fixes #63477

Adds a closing parenthesis.

4 years agoRollup merge of #63474 - adamAndMath:master, r=Centril
Mazdak Farrokhzad [Mon, 12 Aug 2019 08:58:22 +0000 (10:58 +0200)]
Rollup merge of #63474 - adamAndMath:master, r=Centril

Add tests for issue #53598 and #57700

Closes #53598 and #57700

4 years agoRollup merge of #63473 - adrian-budau:master, r=Centril
Mazdak Farrokhzad [Mon, 12 Aug 2019 08:58:21 +0000 (10:58 +0200)]
Rollup merge of #63473 - adrian-budau:master, r=Centril

Regression test for #56870

Closes #56870.

4 years agoRollup merge of #63461 - tommilligan:doc-var-panic, r=joshtriplett
Mazdak Farrokhzad [Mon, 12 Aug 2019 08:58:19 +0000 (10:58 +0200)]
Rollup merge of #63461 - tommilligan:doc-var-panic, r=joshtriplett

docs: add stdlib env::var(_os) panic

Closes #63456

4 years agoRollup merge of #63449 - petrochenkov:builtinagain, r=eddyb
Mazdak Farrokhzad [Mon, 12 Aug 2019 08:58:18 +0000 (10:58 +0200)]
Rollup merge of #63449 - petrochenkov:builtinagain, r=eddyb

resolve: Remove remaining special cases from built-in macros

Edition and definition sites of the macros are now also taken from the `#[rustc_builtin_macro]` definitions in `libcore`.

---
The edition switch may be a breaking change for `Rustc{Encodable,Decodable}` derives if they are used in combination with the unstable crate `serialize` from sysroot like this
```rust
extern crate serialize;
use serialize as rustc_serialize;

#[derive(RustcEncodable)]
struct S;
```
(see the updated `ui-fulldeps` tests).

4 years agoRollup merge of #63431 - andjo403:revert_mir_simplification, r=matthewjasper
Mazdak Farrokhzad [Mon, 12 Aug 2019 08:58:16 +0000 (10:58 +0200)]
Rollup merge of #63431 - andjo403:revert_mir_simplification, r=matthewjasper

Revert "Simplify MIR generation for logical ops"

This reverts commit e38e954a0d249f88d0a55504f70d6055e865a931.

llvm were not able to optimize the code that well with the simplified mir.

Closes: #62993
4 years agoRollup merge of #63406 - jakubadamw:resolve-inconsistent-names-suggest-qualified...
Mazdak Farrokhzad [Mon, 12 Aug 2019 08:58:15 +0000 (10:58 +0200)]
Rollup merge of #63406 - jakubadamw:resolve-inconsistent-names-suggest-qualified-path, r=petrochenkov

Suggest using a qualified path in patterns with inconsistent bindings

A program like the following one:

```rust
enum E { A, B, C }
fn f(x: E) -> bool {
    match x {
        A | B => false,
        C => true
    }
}
```

is rejected by the compiler due to `E` variant paths not being in scope.
In this case `A`, `B` are resolved as pattern bindings and consequently
the pattern is considered invalid as the inner or-patterns do not bind
to the same set of identifiers.

This is expected but the compiler errors that follow could be surprising
or confusing to some users. This commit adds a help note explaining that
if the user desired to match against variants or consts, they should use
a qualified path. The help note is restricted to cases where the identifier
starts with an upper-case sequence so as to reduce the false negatives.

Since this happens during resolution, there's no clean way to check what
it is the patterns match against. The syntactic criterium, however, is in line
with the convention that's assumed by the `non-camel-case-types` lint.

Fixes #50831.

4 years agoRollup merge of #63297 - RalfJung:ptr_offset, r=dtolnay
Mazdak Farrokhzad [Mon, 12 Aug 2019 08:58:13 +0000 (10:58 +0200)]
Rollup merge of #63297 - RalfJung:ptr_offset, r=dtolnay

Improve pointer offset method docs

Cc @rkruppe @gnzlbg

4 years agoRollup merge of #62108 - Zoxc:sharded-queries, r=oli-obk
Mazdak Farrokhzad [Mon, 12 Aug 2019 08:58:12 +0000 (10:58 +0200)]
Rollup merge of #62108 - Zoxc:sharded-queries, r=oli-obk

Use sharded maps for queries

Based on https://github.com/rust-lang/rust/pull/61779.

r? @Gankro

4 years agoFixes #63477
OptimisticPeach [Mon, 12 Aug 2019 04:15:14 +0000 (00:15 -0400)]
Fixes #63477

Adds a closing parenthesis.

4 years agoAuto merge of #63469 - Centril:refactor-parser, r=petrochenkov
bors [Mon, 12 Aug 2019 02:35:55 +0000 (02:35 +0000)]
Auto merge of #63469 - Centril:refactor-parser, r=petrochenkov

libsyntax: Refactor `parser.rs` into reasonably sized logical units

Here we split `parser.rs` (~7.9 KLOC) into more reasonably sized files (all < 1.8 KLOC):

- `./src/libsyntax/parse/`
   - `parser.rs`
   - `parser/`
      - `pat.rs`
      - `expr.rs`
      - `stmt.rs`
      - `ty.rs`
      - `path.rs`
      - `generics.rs`
      - `item.rs`
      - `module.rs`

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

r? @petrochenkov

4 years agoAuto merge of #63472 - Xanewok:update-rls, r=Mark-Simulacrum
bors [Sun, 11 Aug 2019 22:53:30 +0000 (22:53 +0000)]
Auto merge of #63472 - Xanewok:update-rls, r=Mark-Simulacrum

Update RLS

This update includes the ability to warn on deprecated config keys.
It's important to be able to warn the user whenever they're using
an old configuration rather than giving them a cryptic "unknown
configuration error"

cc https://github.com/rust-lang/rls-vscode/issues/639

Since we removed a config value in the current nightly, it'd be
very good if this change can make also make it before cutting the
next release.

4 years agoMove tests into type-alias-impl-trait
Adam [Sun, 11 Aug 2019 20:30:21 +0000 (22:30 +0200)]
Move tests into type-alias-impl-trait

4 years agoAdd test for issue 53598 and 57700
Adam [Sun, 11 Aug 2019 20:17:28 +0000 (22:17 +0200)]
Add test for issue 53598 and 57700

4 years agoRegression test for #56870
Adrian Budau [Sun, 11 Aug 2019 19:44:42 +0000 (22:44 +0300)]
Regression test for #56870

4 years agoAuto merge of #63471 - Mark-Simulacrum:rollup-m756lnx, r=Mark-Simulacrum
bors [Sun, 11 Aug 2019 19:19:33 +0000 (19:19 +0000)]
Auto merge of #63471 - Mark-Simulacrum:rollup-m756lnx, r=Mark-Simulacrum

Rollup of 8 pull requests

Successful merges:

 - #61969 (Add #[repr(transparent)] for several types)
 - #63346 (Lint on some incorrect uses of mem::zeroed / mem::uninitialized)
 - #63433 (Miri shouldn't look at types)
 - #63440 (rename RUST_CTFE_BACKTRACE to RUSTC_CTFE_BACKTRACE)
 - #63441 (Derive Debug for CrateInfo)
 - #63442 (Add an example to show how to insert item to a sorted vec)
 - #63453 (rustdoc: general cleanup)
 - #63464 (Copy ty::Instance instead of passing by reference)

Failed merges:

r? @ghost

4 years agoRollup merge of #63464 - Mark-Simulacrum:deref-instance, r=eddyb
Mark Rousskov [Sun, 11 Aug 2019 19:18:49 +0000 (15:18 -0400)]
Rollup merge of #63464 - Mark-Simulacrum:deref-instance, r=eddyb

Copy ty::Instance instead of passing by reference

ty::Instance is small and Copy, we should not be adding additional
indirection.

Fixes #63409.

r? @eddyb

4 years agoRollup merge of #63453 - Mark-Simulacrum:rustdoc-clean-2, r=GuillaumeGomez
Mark Rousskov [Sun, 11 Aug 2019 19:18:47 +0000 (15:18 -0400)]
Rollup merge of #63453 - Mark-Simulacrum:rustdoc-clean-2, r=GuillaumeGomez

rustdoc: general cleanup

Almost all commits stand alone; but all commits can be reviewed individually.

4 years agoRollup merge of #63442 - lzutao:vec-bin-search-insert, r=Mark-Simulacrum
Mark Rousskov [Sun, 11 Aug 2019 19:18:46 +0000 (15:18 -0400)]
Rollup merge of #63442 - lzutao:vec-bin-search-insert, r=Mark-Simulacrum

Add an example to show how to insert item to a sorted vec

Closes #61684
cc #61742
r? @Mark-Simulacrum, @jonas-schievink

4 years agoRollup merge of #63441 - bjorn3:patch-1, r=Mark-Simulacrum
Mark Rousskov [Sun, 11 Aug 2019 19:18:44 +0000 (15:18 -0400)]
Rollup merge of #63441 - bjorn3:patch-1, r=Mark-Simulacrum

Derive Debug for CrateInfo

4 years agoRollup merge of #63440 - RalfJung:ctfe-backtrace, r=oli-obk
Mark Rousskov [Sun, 11 Aug 2019 19:18:43 +0000 (15:18 -0400)]
Rollup merge of #63440 - RalfJung:ctfe-backtrace, r=oli-obk

rename RUST_CTFE_BACKTRACE to RUSTC_CTFE_BACKTRACE

This matches `RUSTC_LOG`. Both affect only rustc, not any Rust program.

4 years agoRollup merge of #63433 - RalfJung:miri-call, r=oli-obk
Mark Rousskov [Sun, 11 Aug 2019 19:18:41 +0000 (15:18 -0400)]
Rollup merge of #63433 - RalfJung:miri-call, r=oli-obk

Miri shouldn't look at types

r? @oli-obk

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

4 years agoRollup merge of #63346 - RalfJung:zeroed-lint, r=eddyb
Mark Rousskov [Sun, 11 Aug 2019 19:18:40 +0000 (15:18 -0400)]
Rollup merge of #63346 - RalfJung:zeroed-lint, r=eddyb

Lint on some incorrect uses of mem::zeroed / mem::uninitialized

Cc https://github.com/rust-lang/rust/issues/62825 and https://internals.rust-lang.org/t/make-mem-uninitialized-and-mem-zeroed-panic-for-some-types-where-0-is-a-niche/10605

This does not yet handle `NonNull`/`NonZero*`, but it is a start.

I also improved some doc issues I hit on the way, and added a useful helper to `TyS`.

EDIT: I added the relnotes label mostly as a proposal -- I think this is worth mentioning, but leave the decision up to the release team.

4 years agoRollup merge of #61969 - MikailBag:master, r=Centril
Mark Rousskov [Sun, 11 Aug 2019 19:18:38 +0000 (15:18 -0400)]
Rollup merge of #61969 - MikailBag:master, r=Centril

Add #[repr(transparent)] for several types

In some functions, types mentioned in this PR are transmuted into their inner value.
Example for `PathBuf`: https://github.com/rust-lang/rust/blob/master/src/libstd/path.rs#L1132.
This PR adds `#[repr(transparent)]` to those types, so their correct behavior doesn't depend on compiler details. (As far as I understand, currently that line, converting `PathBuf` to `Vec<u8>`, is UB).

4 years agoUpdate RLS
Igor Matuszewski [Sun, 11 Aug 2019 19:10:16 +0000 (21:10 +0200)]
Update RLS

This update includes the ability to warn on deprecated config keys.
It's important to be able to warn the user whenever they're using
an old configuration rather than giving them a cryptic "unknown
configuration error"

cc https://github.com/rust-lang/rls-vscode/issues/639

Since we removed a config value in the current nightly, it'd be
very good if this change can make also make it before cutting the
next release.

4 years agoparser: {check,expect}_lifetime into ty.rs
Mazdak Farrokhzad [Sun, 11 Aug 2019 18:46:34 +0000 (20:46 +0200)]
parser: {check,expect}_lifetime into ty.rs

4 years agoparser: move into generics.rs
Mazdak Farrokhzad [Sun, 11 Aug 2019 18:44:09 +0000 (20:44 +0200)]
parser: move into generics.rs

4 years agoparser: move into stmt.rs
Mazdak Farrokhzad [Sun, 11 Aug 2019 18:32:29 +0000 (20:32 +0200)]
parser: move into stmt.rs

4 years agoparser: move parse_fn_block_decl into expr.rs
Mazdak Farrokhzad [Sun, 11 Aug 2019 18:04:09 +0000 (20:04 +0200)]
parser: move parse_fn_block_decl into expr.rs

4 years agoparser: move parse_ident_or_underscore into item.rs
Mazdak Farrokhzad [Sun, 11 Aug 2019 18:00:38 +0000 (20:00 +0200)]
parser: move parse_ident_or_underscore into item.rs

4 years agoparser: split into {ty, path}.rs
Mazdak Farrokhzad [Sun, 11 Aug 2019 17:59:27 +0000 (19:59 +0200)]
parser: split into {ty, path}.rs

4 years agoparser: split into {item,module}.rs
Mazdak Farrokhzad [Sun, 11 Aug 2019 16:34:42 +0000 (18:34 +0200)]
parser: split into {item,module}.rs

4 years agoCopy ty::Instance instead of passing by reference
Mark Rousskov [Sun, 11 Aug 2019 14:54:38 +0000 (10:54 -0400)]
Copy ty::Instance instead of passing by reference

ty::Instance is small and Copy, we should not be adding additional
indirection.

4 years agoDerive Debug for NativeLibrary and NativeLibraryKind
bjorn3 [Sun, 11 Aug 2019 14:51:36 +0000 (16:51 +0200)]
Derive Debug for NativeLibrary and NativeLibraryKind

4 years agoReduce nesting in externalfiles implementation
Mark Rousskov [Sat, 10 Aug 2019 22:39:50 +0000 (18:39 -0400)]
Reduce nesting in externalfiles implementation

Utilize `?` instead of and_then/map operators

4 years agoDrop RefCell from IdMap in markdown rendering
Mark Rousskov [Sat, 10 Aug 2019 22:36:04 +0000 (18:36 -0400)]
Drop RefCell from IdMap in markdown rendering

4 years agoRemove fmt::Display impls on Markdown structs
Mark Rousskov [Sat, 10 Aug 2019 22:27:17 +0000 (18:27 -0400)]
Remove fmt::Display impls on Markdown structs

These impls prevent ergonomic use of the config (e.g., forcing us to use
RefCell) despite all usecases for these structs only using their Display
impls once.

4 years agoRemove thread-local for playground config
Mark Rousskov [Sat, 10 Aug 2019 22:07:07 +0000 (18:07 -0400)]
Remove thread-local for playground config

4 years agoRemove unnecessary channel
Mark Rousskov [Sat, 10 Aug 2019 21:16:01 +0000 (17:16 -0400)]
Remove unnecessary channel

4 years agoUse a HashSet instead of Vec
Mark Rousskov [Sat, 10 Aug 2019 21:10:13 +0000 (17:10 -0400)]
Use a HashSet instead of Vec

4 years agoDon't store all traits in DocContext
Mark Rousskov [Sat, 10 Aug 2019 20:59:21 +0000 (16:59 -0400)]
Don't store all traits in DocContext

This is already a query so we're just needlessly copying the data
around.

4 years agoStore typed Passes
Mark Rousskov [Sat, 10 Aug 2019 20:43:39 +0000 (16:43 -0400)]
Store typed Passes

4 years agoReplace Arc with Rc around external_traits
Mark Rousskov [Sat, 10 Aug 2019 20:19:25 +0000 (16:19 -0400)]
Replace Arc with Rc around external_traits

4 years agoRemove ReentrantMutex
Mark Rousskov [Sat, 10 Aug 2019 19:20:21 +0000 (15:20 -0400)]
Remove ReentrantMutex

This drops the parking_lot dependency; the ReentrantMutex type appeared
to be unused (at least, no compilation failures occurred).

This is technically a possible change in behavior of its users, as
lock() would wait on other threads releasing their guards, but since we
didn't actually remove any threading or such in this code, it appears
that we never used that behavior (the behavior change is only noticeable
if the type previously was used in two threads, in a single thread
ReentrantMutex is useless).

4 years agoUse entry API in store_path
Mark Rousskov [Sat, 10 Aug 2019 17:52:45 +0000 (13:52 -0400)]
Use entry API in store_path

4 years agoRemove crate_name from DocContext
Mark Rousskov [Sat, 10 Aug 2019 17:44:23 +0000 (13:44 -0400)]
Remove crate_name from DocContext

tcx.crate_name is the appropriate way to retrieve the crate name.

4 years agoMove def_id_to_path to use site in visit_ast
Mark Rousskov [Sat, 10 Aug 2019 17:37:31 +0000 (13:37 -0400)]
Move def_id_to_path to use site in visit_ast

4 years agorustdoc: Replace HirVec with slices in doctree
Mark Rousskov [Sat, 10 Aug 2019 17:25:50 +0000 (13:25 -0400)]
rustdoc: Replace HirVec with slices in doctree

4 years agoAuto merge of #63446 - Centril:refactor-lowering, r=oli-obk
bors [Sun, 11 Aug 2019 13:37:37 +0000 (13:37 +0000)]
Auto merge of #63446 - Centril:refactor-lowering, r=oli-obk

Refactor and categorize lowering wrt. items / exprs

Split lowering into more files along the lines of "expression related" and "item related".
Also refactor huge methods into smaller ones.

A next step might be to introduce "type related" and merge patterns and statements combined with expressions into "value related". There's still more work to do but the PR was getting too big :)

r? @oli-obk

4 years agoparser: split into pat.rs
Mazdak Farrokhzad [Sun, 11 Aug 2019 13:24:37 +0000 (15:24 +0200)]
parser: split into pat.rs

4 years agodocs: add stdlib env::var(_os) panic
Tom Milligan [Sun, 11 Aug 2019 11:49:02 +0000 (12:49 +0100)]
docs: add stdlib env::var(_os) panic

4 years agoparser: split into expr.rs
Mazdak Farrokhzad [Sun, 11 Aug 2019 11:14:30 +0000 (13:14 +0200)]
parser: split into expr.rs

4 years agoupdate clippy
Ralf Jung [Sun, 11 Aug 2019 10:06:12 +0000 (12:06 +0200)]
update clippy

4 years agonote down some more future plans
Ralf Jung [Wed, 7 Aug 2019 14:23:11 +0000 (16:23 +0200)]
note down some more future plans

4 years agoallow the lint if a few UB-demonstrating doc tests
Ralf Jung [Wed, 7 Aug 2019 09:59:23 +0000 (11:59 +0200)]
allow the lint if a few UB-demonstrating doc tests

4 years agoproper doc comment for 'recovered' field of variant
Ralf Jung [Wed, 7 Aug 2019 09:52:40 +0000 (11:52 +0200)]
proper doc comment for 'recovered' field of variant

Curtesy of petrochenkov

4 years agonote a FIXME
Ralf Jung [Wed, 7 Aug 2019 08:09:42 +0000 (10:09 +0200)]
note a FIXME

4 years agoadd tuple_fields convenience method and use it in a few places
Ralf Jung [Wed, 7 Aug 2019 07:01:53 +0000 (09:01 +0200)]
add tuple_fields convenience method and use it in a few places

4 years agofix a comment
Ralf Jung [Wed, 7 Aug 2019 06:43:42 +0000 (08:43 +0200)]
fix a comment

4 years agowarn for more cases
Ralf Jung [Wed, 7 Aug 2019 06:42:50 +0000 (08:42 +0200)]
warn for more cases

4 years agoadd basic lint testing for misuse of mem::zeroed and mem::uninitialized
Ralf Jung [Tue, 6 Aug 2019 21:11:52 +0000 (23:11 +0200)]
add basic lint testing for misuse of mem::zeroed and mem::uninitialized

4 years agoAuto merge of #63343 - ishitatsuyuki:revert-62150, r=RalfJung
bors [Sun, 11 Aug 2019 09:58:01 +0000 (09:58 +0000)]
Auto merge of #63343 - ishitatsuyuki:revert-62150, r=RalfJung

Back out #62150

Ref: #62825

cc @RalfJung

4 years agoAuto merge of #63413 - RalfJung:miri, r=oli-obk
bors [Sun, 11 Aug 2019 02:05:40 +0000 (02:05 +0000)]
Auto merge of #63413 - RalfJung:miri, r=oli-obk

update Miri

With https://github.com/rust-lang/rust/pull/63404 landed, we need https://github.com/rust-lang/miri/pull/898 to avoid failures in https://github.com/RalfJung/miri-test-libstd.

r? @oli-obk

4 years agoAuto merge of #63250 - petrochenkov:descrate, r=davidtwco
bors [Sat, 10 Aug 2019 22:29:20 +0000 (22:29 +0000)]
Auto merge of #63250 - petrochenkov:descrate, r=davidtwco

diagnostics: Describe crate root modules in `DefKind::Mod` as "crate"

Or we can use "extern crate" like resolve previously did sometimes, not sure.

r? @davidtwco

4 years agoApply suggestions from code review
Jakub Adam Wieczorek [Fri, 9 Aug 2019 20:21:45 +0000 (20:21 +0000)]
Apply suggestions from code review

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoSuggest using a qualified path in patterns with inconsistent bindings
Jakub Adam Wieczorek [Fri, 9 Aug 2019 09:43:26 +0000 (09:43 +0000)]
Suggest using a qualified path in patterns with inconsistent bindings

A program like the following one:

```rust
enum E { A, B, C }
fn f(x: E) -> bool {
    match x {
        A | B => false,
        C => true
    }
}
```

is rejected by the compiler due to `E` variant paths not being in scope.
In this case `A`, `B` are resolved as pattern bindings and consequently
the pattern is considered invalid as the inner or-patterns do not bind
to the same set of identifiers.

This is expected but the compiler errors that follow could be surprising
or confusing to some users. This commit adds a help note explaining that
if the user desired to match against variants or consts, they should use
a qualified path. The note is restricted to cases where the identifier
starts with an upper-case sequence so as to reduce the false negatives.

Since this happens during resolution, there's no clean way to check what
the patterns match against. The syntactic criterium, however, is in line
with the convention that's assumed by the `non-camel-case-types` lint.

4 years agoUpdate cargo
Vadim Petrochenkov [Sat, 10 Aug 2019 20:19:09 +0000 (23:19 +0300)]
Update cargo

4 years agodiagnostics: Describe crate root modules in `DefKind::Mod` as "crate"
Vadim Petrochenkov [Sat, 3 Aug 2019 23:07:35 +0000 (02:07 +0300)]
diagnostics: Describe crate root modules in `DefKind::Mod` as "crate"

4 years agoresolve: Remove remaining special cases from built-in macros
Vadim Petrochenkov [Sat, 10 Aug 2019 15:38:27 +0000 (18:38 +0300)]
resolve: Remove remaining special cases from built-in macros

4 years agolowering: move lower_arg -> item.rs
Mazdak Farrokhzad [Sat, 10 Aug 2019 18:23:34 +0000 (20:23 +0200)]
lowering: move lower_arg  -> item.rs

4 years agolowering: move scope & capture_clause stuff -> expr.rs
Mazdak Farrokhzad [Sat, 10 Aug 2019 18:21:15 +0000 (20:21 +0200)]
lowering: move scope & capture_clause stuff  -> expr.rs

4 years agolowering: refactor into item.rs
Mazdak Farrokhzad [Sat, 10 Aug 2019 18:13:12 +0000 (20:13 +0200)]
lowering: refactor into item.rs

4 years agolowering: move {lower_arm,arm} -> expr.rs
Mazdak Farrokhzad [Sat, 10 Aug 2019 15:48:09 +0000 (17:48 +0200)]
lowering: move {lower_arm,arm}  -> expr.rs

4 years agolowering: move field -> expr.rs
Mazdak Farrokhzad [Sat, 10 Aug 2019 15:40:35 +0000 (17:40 +0200)]
lowering: move field  -> expr.rs

4 years agolowering: refactor label/dest -> expr.rs
Mazdak Farrokhzad [Sat, 10 Aug 2019 15:37:10 +0000 (17:37 +0200)]
lowering: refactor label/dest  -> expr.rs

4 years agolowering: move lower_{unop,binop} -> expr.rs
Mazdak Farrokhzad [Sat, 10 Aug 2019 15:28:04 +0000 (17:28 +0200)]
lowering: move lower_{unop,binop} -> expr.rs

4 years agolowering: move lower_field -> expr.rs
Mazdak Farrokhzad [Sat, 10 Aug 2019 15:26:11 +0000 (17:26 +0200)]
lowering: move lower_field -> expr.rs

4 years agolowering: move expr builder methods -> expr.rs
Mazdak Farrokhzad [Sat, 10 Aug 2019 15:22:39 +0000 (17:22 +0200)]
lowering: move expr builder methods -> expr.rs

4 years agolowering: move make_async_expr -> expr.rs
Mazdak Farrokhzad [Sat, 10 Aug 2019 14:42:14 +0000 (16:42 +0200)]
lowering: move make_async_expr -> expr.rs

4 years agolowering: extract lower_expr_let
Mazdak Farrokhzad [Sat, 10 Aug 2019 13:42:08 +0000 (15:42 +0200)]
lowering: extract lower_expr_let

4 years agolowering: extract lower_expr_if
Mazdak Farrokhzad [Sat, 10 Aug 2019 13:37:02 +0000 (15:37 +0200)]
lowering: extract lower_expr_if

4 years agolowering: extract lower_expr_while_in_loop_scope
Mazdak Farrokhzad [Sat, 10 Aug 2019 13:28:57 +0000 (15:28 +0200)]
lowering: extract lower_expr_while_in_loop_scope

4 years agolowering: move wrap_in_try_constructor -> expr.rs
Mazdak Farrokhzad [Sat, 10 Aug 2019 13:11:22 +0000 (15:11 +0200)]
lowering: move wrap_in_try_constructor -> expr.rs

4 years agolowering: extract lower_expr_try_block
Mazdak Farrokhzad [Sat, 10 Aug 2019 13:09:18 +0000 (15:09 +0200)]
lowering: extract lower_expr_try_block