]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoUnresolved link -> incompatible link kind
Joshua Nelson [Wed, 5 Aug 2020 03:39:18 +0000 (23:39 -0400)]
Unresolved link -> incompatible link kind

Clearly it has been resolved, because we say on the next line what it
resolved to.

3 years agoGive a much better error message if the struct failed to resolve
Joshua Nelson [Wed, 5 Aug 2020 03:31:36 +0000 (23:31 -0400)]
Give a much better error message if the struct failed to resolve

3 years agoitem -> link
Joshua Nelson [Mon, 3 Aug 2020 12:39:46 +0000 (08:39 -0400)]
item -> link

3 years agoKeep the previous behavior of `register_res`
Joshua Nelson [Mon, 3 Aug 2020 03:18:24 +0000 (23:18 -0400)]
Keep the previous behavior of `register_res`

Now that we're returning the `Res` of the associated item,
not the trait itself, it got confused.

3 years agoDon't mark associated items as traits
Joshua Nelson [Mon, 3 Aug 2020 02:37:21 +0000 (22:37 -0400)]
Don't mark associated items as traits

This caused the following false positive:

```
warning: unresolved link to `Default::default`
 --> /home/joshua/rustc2/default.rs:1:14
  |
1 | /// Link to [Default::default()]
  |              ^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(broken_intra_doc_links)]` on by default
note: this item resolved to a trait, which did not match the disambiguator 'fn'
 --> /home/joshua/rustc2/default.rs:1:14
  |
1 | /// Link to [Default::default()]
  |              ^^^^^^^^^^^^^^^^^^
```

3 years agoDisallow linking to items with a mismatched disambiguator
Joshua Nelson [Mon, 3 Aug 2020 00:45:24 +0000 (20:45 -0400)]
Disallow linking to items with a mismatched disambiguator

3 years agoAuto merge of #74826 - matklad:mbe-fragment, r=petrochenkov
bors [Sun, 2 Aug 2020 19:48:44 +0000 (19:48 +0000)]
Auto merge of #74826 - matklad:mbe-fragment, r=petrochenkov

Introduce NonterminalKind for more type-safe mbe parsing

It encapsulate the (part of) the interface between the parser and
macro by example (macro_rules) parser.

The second bit is somewhat more general `parse_ast_fragment`, which is
the reason why we keep some `parse_xxx` functions as public.

3 years agoAuto merge of #74963 - JohnTitor:ptn-ice, r=petrochenkov
bors [Sun, 2 Aug 2020 18:01:27 +0000 (18:01 +0000)]
Auto merge of #74963 - JohnTitor:ptn-ice, r=petrochenkov

Fix ICEs with `@ ..` binding

This reverts #74557 and introduces an alternative fix while ensuring that #74954 is not broken.
The diagnostics are verbose though, it fixes three related issues.
cc #74954, #74539, and #74702

3 years agoAuto merge of #75060 - JohnTitor:rollup-aq8sfxf, r=JohnTitor
bors [Sun, 2 Aug 2020 16:06:54 +0000 (16:06 +0000)]
Auto merge of #75060 - JohnTitor:rollup-aq8sfxf, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #74686 (BTreeMap: remove into_slices and its unsafe block)
 - #74762 (BTreeMap::drain_filter should not touch the root during iteration)
 - #74781 (Clean up E0733 explanation)
 - #74874 (BTreeMap: define forget_type only when relevant)
 - #74974 (Make tests faster in Miri)
 - #75010 (Update elasticlunr-rs and ammonia transitive deps)
 - #75041 (Replaced log with tracing crate)
 - #75044 (Clean up E0744 explanation)
 - #75054 (Rename rustc_middle::cstore::DepKind to CrateDepKind)
 - #75057 (Avoid dumping rustc invocations to stdout)

Failed merges:

 - #74827 (Move bulk of BTreeMap::insert method down to new method on handle)

r? @ghost

3 years agoRollup merge of #75057 - Mark-Simulacrum:avoid-long-print, r=alexcrichton
Yuki Okushi [Sun, 2 Aug 2020 16:05:28 +0000 (01:05 +0900)]
Rollup merge of #75057 - Mark-Simulacrum:avoid-long-print, r=alexcrichton

Avoid dumping rustc invocations to stdout

These are quite long, usually, and in most cases not interesting. On smaller
terminals they can take up more than a full page of output, hiding the error
diagnostics emitted.

3 years agoRollup merge of #75054 - cjgillot:rename-depkind, r=petrochenkov
Yuki Okushi [Sun, 2 Aug 2020 16:05:27 +0000 (01:05 +0900)]
Rollup merge of #75054 - cjgillot:rename-depkind, r=petrochenkov

Rename rustc_middle::cstore::DepKind to CrateDepKind

It is ambiguous with DepGraph's own DepKind.

3 years agoRollup merge of #75044 - GuillaumeGomez:cleanup-e0744, r=pickfire
Yuki Okushi [Sun, 2 Aug 2020 16:05:25 +0000 (01:05 +0900)]
Rollup merge of #75044 - GuillaumeGomez:cleanup-e0744, r=pickfire

Clean up E0744 explanation

r? @Dylan-DPC

3 years agoRollup merge of #75041 - pawanbisht62:feature/replace-log-with-tracing, r=oli-obk
Yuki Okushi [Sun, 2 Aug 2020 16:05:23 +0000 (01:05 +0900)]
Rollup merge of #75041 - pawanbisht62:feature/replace-log-with-tracing, r=oli-obk

Replaced log with tracing crate

Issue #74747

3 years agoRollup merge of #75010 - Aaron1011:feature/remove-old-deps, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:22 +0000 (01:05 +0900)]
Rollup merge of #75010 - Aaron1011:feature/remove-old-deps, r=Mark-Simulacrum

Update elasticlunr-rs and ammonia transitive deps

This removes all dependencies on pre-1.0 proc-macro ecosystem crates
(syn, quote, and proc-macro2)

3 years agoRollup merge of #74974 - RalfJung:miri-tests, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:20 +0000 (01:05 +0900)]
Rollup merge of #74974 - RalfJung:miri-tests, r=Mark-Simulacrum

Make tests faster in Miri

Reduce some test iteration counts in Miri.

3 years agoRollup merge of #74874 - ssomers:btree_cleanup_8, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:18 +0000 (01:05 +0900)]
Rollup merge of #74874 - ssomers:btree_cleanup_8, r=Mark-Simulacrum

BTreeMap: define forget_type only when relevant

Similar to `forget_node_type` for handles.
No effect on generated code, apart maybe from the superfluous calls that might not have been optimized away.

r? @Mark-Simulacrum

3 years agoRollup merge of #74781 - GuillaumeGomez:cleanup-e0733, r=jyn514
Yuki Okushi [Sun, 2 Aug 2020 16:05:15 +0000 (01:05 +0900)]
Rollup merge of #74781 - GuillaumeGomez:cleanup-e0733, r=jyn514

Clean up E0733 explanation

r? @Dylan-DPC

3 years agoRollup merge of #74762 - ssomers:btree_no_root_in_remove_kv_tracking, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:13 +0000 (01:05 +0900)]
Rollup merge of #74762 - ssomers:btree_no_root_in_remove_kv_tracking, r=Mark-Simulacrum

BTreeMap::drain_filter should not touch the root during iteration

Although Miri doesn't point it out, I believe there is undefined behaviour using `drain_filter` when draining the 11th-last element from a tree that was larger. When this happens, the last remaining child nodes are merged, the root becomes empty and is popped from the tree. That last step establishes a mutable reference to the node elected root and writes a pointer in `node::Root`, while iteration continues to visit the same node.

This is mostly code from #74437, slightly adapted.

3 years agoRollup merge of #74686 - ssomers:btree_cleanup_3, r=Mark-Simulacrum
Yuki Okushi [Sun, 2 Aug 2020 16:05:12 +0000 (01:05 +0900)]
Rollup merge of #74686 - ssomers:btree_cleanup_3, r=Mark-Simulacrum

BTreeMap: remove into_slices and its unsafe block

A small tweak to make BTreeMap code shorter and less unsafe.

r? @Mark-Simulacrum

3 years agoAvoid dumping rustc invocations to stdout
Mark Rousskov [Sun, 2 Aug 2020 14:54:13 +0000 (10:54 -0400)]
Avoid dumping rustc invocations to stdout

These are quite long, usually, and in most cases not interesting. On smaller
terminals they can take up more than a full page of output, hiding the error
diagnostics emitted.

3 years agoRename rustc_middle::cstore::DepKind to DependencyKind.
Camille GILLOT [Sun, 2 Aug 2020 12:24:22 +0000 (14:24 +0200)]
Rename rustc_middle::cstore::DepKind to DependencyKind.

3 years agoAuto merge of #74675 - pietroalbini:aarch64-ci-fallible, r=Mark-Simulacrum
bors [Sun, 2 Aug 2020 14:08:48 +0000 (14:08 +0000)]
Auto merge of #74675 - pietroalbini:aarch64-ci-fallible, r=Mark-Simulacrum

Add fallible AArch64 CI builder

This adds the `aarch64-gnu` CI builder to the `auto-fallible` job, as a first step in the process of actually gating on it.

r? @Mark-Simulacrum

3 years agoAuto merge of #74210 - estebank:type-ascriptomatic, r=petrochenkov
bors [Sun, 2 Aug 2020 12:20:09 +0000 (12:20 +0000)]
Auto merge of #74210 - estebank:type-ascriptomatic, r=petrochenkov

Deduplicate `::` -> `:` typo errors

Deduplicate errors caused by the same type ascription typo, including
ones suggested during parsing that would get reported again during
resolve. Fix #70382.

3 years agoFormatting: don't mix mod and use
Aleksey Kladov [Sun, 2 Aug 2020 12:05:19 +0000 (14:05 +0200)]
Formatting: don't mix mod and use

Seems to be a fallout from rustfmt transition

3 years agoUse NonterminalKind for MetaVarDecl
Aleksey Kladov [Sat, 1 Aug 2020 15:45:17 +0000 (17:45 +0200)]
Use NonterminalKind for MetaVarDecl

This is more type safe and allows us to remove a few dead branches

3 years agoIntroduce NonterminalKind
Aleksey Kladov [Mon, 27 Jul 2020 12:04:54 +0000 (14:04 +0200)]
Introduce NonterminalKind

It encapsulate the (part of) the interface between the parser and
macro by example (macro_rules) parser.

The second bit is somewhat more general `parse_ast_fragment`, which is
the reason why we keep some `parse_xxx` functions as public.

3 years agoClean up E0744 explanation
Guillaume Gomez [Sun, 2 Aug 2020 11:26:02 +0000 (13:26 +0200)]
Clean up E0744 explanation

3 years agoClean up E0733 explanation
Guillaume Gomez [Sun, 26 Jul 2020 15:38:47 +0000 (17:38 +0200)]
Clean up E0733 explanation

3 years agoAuto merge of #74972 - second-state:wasi-right-fix, r=KodrAus
bors [Sun, 2 Aug 2020 09:41:17 +0000 (09:41 +0000)]
Auto merge of #74972 - second-state:wasi-right-fix, r=KodrAus

Fix std::fs::File::metadata permission on WASI target

Previously `std::fs::File::metadata` on wasm32-wasi would call `fd_filestat_get`
to get metadata associated with fd, but that fd is opened without
RIGHTS_FD_FILESTAT_GET right, so it will failed on correctly implemented WASI
environment.

This change instead to add the missing rights when opening an fd.

3 years agoReplace from log to tracing
bishtpawan [Sun, 2 Aug 2020 07:54:08 +0000 (13:24 +0530)]
Replace from log to tracing

3 years agoAuto merge of #74899 - sajattack:libc_0.2.74_bump, r=jonas-schievink
bors [Sun, 2 Aug 2020 07:23:14 +0000 (07:23 +0000)]
Auto merge of #74899 - sajattack:libc_0.2.74_bump, r=jonas-schievink

bump libc version to 0.2.74

3 years agoReplace from log to tracing in libsrustrustc_ast_lowering, librustc_ast_passes, libru...
bishtpawan [Sun, 2 Aug 2020 06:51:39 +0000 (12:21 +0530)]
Replace from log to tracing in libsrustrustc_ast_lowering, librustc_ast_passes, librustc_ast_pretty

3 years agoAuto merge of #75004 - Aaron1011:move-probably-equal, r=petrochenkov
bors [Sun, 2 Aug 2020 05:34:40 +0000 (05:34 +0000)]
Auto merge of #75004 - Aaron1011:move-probably-equal, r=petrochenkov

Move 'probably equal' methods to librustc_parse

This is preparation for PR #73084

3 years agoAuto merge of #74785 - euclio:deprecation-kinds, r=petrochenkov
bors [Sun, 2 Aug 2020 03:47:29 +0000 (03:47 +0000)]
Auto merge of #74785 - euclio:deprecation-kinds, r=petrochenkov

report kind of deprecated item in message

This is important for fields, which are incorrectly referred to as
"items".

3 years agoUpdate elasticlunr-rs and ammonia transitive deps
Aaron Hill [Sat, 1 Aug 2020 14:11:15 +0000 (10:11 -0400)]
Update elasticlunr-rs and ammonia transitive deps

This removes all dependencies on pre-1.0 proc-macro ecosystem crates
(syn, quote, and proc-macro2)

3 years agoMove 'probably equal' methods to librustc_parse
Aaron Hill [Sat, 1 Aug 2020 11:59:02 +0000 (07:59 -0400)]
Move 'probably equal' methods to librustc_parse

This is preparation for PR #73084

3 years agoAuto merge of #75033 - Manishearth:rollup-d8afil1, r=Manishearth
bors [Sun, 2 Aug 2020 01:04:54 +0000 (01:04 +0000)]
Auto merge of #75033 - Manishearth:rollup-d8afil1, r=Manishearth

Rollup of 5 pull requests

Successful merges:

 - #74602 (Clarify the doc for MaybeUninit::zeroed on incorrect use)
 - #74720 (Clean up E0728 explanation)
 - #74992 (fix rustdoc generic param order)
 - #75015 (Add Vec::spare_capacity_mut)
 - #75022 (Use a slice pattern instead of rchunks_exact(_).next())

Failed merges:

r? @ghost

3 years agoRollup merge of #75022 - cuviper:sliced-rchunk, r=lcnr
Manish Goregaokar [Sun, 2 Aug 2020 00:42:18 +0000 (17:42 -0700)]
Rollup merge of #75022 - cuviper:sliced-rchunk, r=lcnr

Use a slice pattern instead of rchunks_exact(_).next()

This is a minor cleanup, but trying a single-use `rchunks` iterator can
be more directly matched with a slice pattern, `[.., a, b]`.

3 years agoRollup merge of #75015 - Amanieu:vec_spare, r=sfackler
Manish Goregaokar [Sun, 2 Aug 2020 00:42:16 +0000 (17:42 -0700)]
Rollup merge of #75015 - Amanieu:vec_spare, r=sfackler

Add Vec::spare_capacity_mut

Returns the remaining spare capacity of the vector as a slice of `MaybeUninit<T>`.

As suggested by @sfackler in https://github.com/rust-lang/rust/pull/70967#issuecomment-612659006.

r? @sfackler

3 years agoRollup merge of #74992 - lcnr:fix-generic-param-order, r=GuillaumeGomez
Manish Goregaokar [Sun, 2 Aug 2020 00:42:15 +0000 (17:42 -0700)]
Rollup merge of #74992 - lcnr:fix-generic-param-order, r=GuillaumeGomez

fix rustdoc generic param order

fixes #61292

r? @varkor cc @GuillaumeGomez

3 years agoRollup merge of #74720 - GuillaumeGomez:cleanup-e0728, r=jyn514
Manish Goregaokar [Sun, 2 Aug 2020 00:42:13 +0000 (17:42 -0700)]
Rollup merge of #74720 - GuillaumeGomez:cleanup-e0728, r=jyn514

Clean up E0728 explanation

r? @Dylan-DPC

3 years agoRollup merge of #74602 - poliorcetics:maybe-uninit-zeroed-doc-clarification, r=jyn514
Manish Goregaokar [Sun, 2 Aug 2020 00:42:11 +0000 (17:42 -0700)]
Rollup merge of #74602 - poliorcetics:maybe-uninit-zeroed-doc-clarification, r=jyn514

Clarify the doc for MaybeUninit::zeroed on incorrect use

Fixes #74343.

@rustbot modify labels: C-enhancement, T-doc

3 years agoAuto merge of #74605 - rust-lang:vec-leak, r=Amanieu
bors [Sat, 1 Aug 2020 22:29:30 +0000 (22:29 +0000)]
Auto merge of #74605 - rust-lang:vec-leak, r=Amanieu

Stabilize Vec::leak as a method

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

The signature is changed to a method rather than an associated function:

```diff
-pub fn leak<'a>(vec: Vec<T>) -> &'a mut [T]
+pub fn leak<'a>(self) -> &'a mut [T]
```

The reason for `Box::leak` not to be a method (`Deref` to an arbitrary `T` which might have its own, different `leak` method) does not apply.

3 years agoBTreeMap::drain_filter no longer touches the root during iteration
Stein Somers [Tue, 14 Jul 2020 09:32:50 +0000 (11:32 +0200)]
BTreeMap::drain_filter no longer touches the root during iteration

3 years agoAuto merge of #74726 - oli-obk:tracing, r=Mark-Simulacrum
bors [Sat, 1 Aug 2020 20:43:12 +0000 (20:43 +0000)]
Auto merge of #74726 - oli-obk:tracing, r=Mark-Simulacrum

Move from `log` to `tracing`

The only visible change is that we now get timestamps in our logs:

```
Jul 24 18:41:01.065 TRACE rustc_mir::transform::const_prop: skipping replace of Rvalue::Use(const () because it is already a const
Jul 24 18:41:01.065 TRACE rustc_mir::transform::const_prop: propagated into _2
Jul 24 18:41:01.065 TRACE rustc_mir::transform::const_prop: visit_constant: const ()
```

This PR was explicitly designed to be as low-impact as possible. We can now move to using the name `tracing` insteads of `log` on a crate-by-crate basis and use any of the other tracing features where desirable.

As far as I can tell this will allow tools to seamlessly keep working (since they are using `rustc_driver::init_log...`).

This is the first half of step 1 of the accepted `tracing` MCP (https://github.com/rust-lang/compiler-team/issues/331)

3 years agoAuto merge of #75016 - Manishearth:rollup-x553g7j, r=Manishearth
bors [Sat, 1 Aug 2020 18:52:30 +0000 (18:52 +0000)]
Auto merge of #75016 - Manishearth:rollup-x553g7j, r=Manishearth

Rollup of 6 pull requests

Successful merges:

 - #74977 (Clean up E0741 error explanation)
 - #74981 (Some fixes for `plugin.md` in unstable-book)
 - #74983 (Replace a recursive algorithm with an iterative one and a stack.)
 - #74995 (Update the WASI libc build to LLVM 10.)
 - #74996 (submodules: update cargo from 974eb438d to 2d5c2381e)
 - #75007 (Clean up E0743 explanation)

Failed merges:

r? @ghost

3 years agoUse a slice pattern instead of rchunks_exact(_).next()
Josh Stone [Sat, 1 Aug 2020 18:41:59 +0000 (11:41 -0700)]
Use a slice pattern instead of rchunks_exact(_).next()

This is a minor cleanup, but trying a single-use `rchunks` iterator can
be more directly matched with a slice pattern, `[.., a, b]`.

3 years agoMore benchmarks of BTreeMap mutation
Stein Somers [Sat, 1 Aug 2020 11:10:12 +0000 (13:10 +0200)]
More benchmarks of BTreeMap mutation

3 years agoReword incorrect use of zeroed()
Alexis Bourget [Sat, 1 Aug 2020 17:28:19 +0000 (19:28 +0200)]
Reword incorrect use of zeroed()

3 years agoAdd Vec::spare_capacity_mut
Amanieu d'Antras [Sat, 1 Aug 2020 16:03:04 +0000 (17:03 +0100)]
Add Vec::spare_capacity_mut

3 years agoRollup merge of #75007 - GuillaumeGomez:cleanup-e0743, r=pickfire
Manish Goregaokar [Sat, 1 Aug 2020 16:30:19 +0000 (09:30 -0700)]
Rollup merge of #75007 - GuillaumeGomez:cleanup-e0743, r=pickfire

Clean up E0743 explanation

r? @Dylan-DPC

3 years agoRollup merge of #74996 - matthiaskrgr:submodule_upd, r=ehuss
Manish Goregaokar [Sat, 1 Aug 2020 16:30:18 +0000 (09:30 -0700)]
Rollup merge of #74996 - matthiaskrgr:submodule_upd, r=ehuss

submodules: update cargo from 974eb438d to 2d5c2381e

Changes:
````
Use the same index location on nightly as beta
relax deprecated diagnostic message check
Don't print to raw stderr in test
Emit the `test` field in cargo metadata
````

r? @ehuss

Trying to get the fix to the registry-index-hash upstream soonish.

3 years agoRollup merge of #74995 - sunfishcode:update-llvm, r=alexcrichton
Manish Goregaokar [Sat, 1 Aug 2020 16:30:16 +0000 (09:30 -0700)]
Rollup merge of #74995 - sunfishcode:update-llvm, r=alexcrichton

Update the WASI libc build to LLVM 10.

Among other things, this brings in [the `__main_argc_argv`] patch,
which simplifies the interaction between the compiler and WASI libc's
startup code, which will help work on reactor support.

[the `__main_argc_argv` patch]: https://github.com/llvm/llvm-project/commit/00072c08c75050ae2c835b7bb0e505475dbcd7b9

r? @alexcrichton

3 years agoRollup merge of #74983 - oli-obk:mir_opt_goto_chain, r=ecstatic-morse
Manish Goregaokar [Sat, 1 Aug 2020 16:30:14 +0000 (09:30 -0700)]
Rollup merge of #74983 - oli-obk:mir_opt_goto_chain, r=ecstatic-morse

Replace a recursive algorithm with an iterative one and a stack.

fixes #74931

3 years agoRollup merge of #74981 - giraffate:fix_sample_codes_in_unstable_book_plugin, r=Guilli...
Manish Goregaokar [Sat, 1 Aug 2020 16:30:13 +0000 (09:30 -0700)]
Rollup merge of #74981 - giraffate:fix_sample_codes_in_unstable_book_plugin, r=GuilliameGomez

Some fixes for `plugin.md` in unstable-book

- sample codes not working
I referred to https://github.com/rust-lang/rust/blob/master/src/test/ui-fulldeps/auxiliary/lint-plugin-test.rs and https://github.com/rust-lang/rust/blob/master/src/test/ui-fulldeps/lint-plugin.rs.

- broken link
https://github.com/rust-lang/rust/blob/master/src/librustc/lint/builtin.rs -> https://github.com/rust-lang/rust/blob/master/src/librustc_session/lint/builtin.rs

3 years agoRollup merge of #74977 - GuillaumeGomez:cleanup-e0741, r=pickfire
Manish Goregaokar [Sat, 1 Aug 2020 16:30:11 +0000 (09:30 -0700)]
Rollup merge of #74977 - GuillaumeGomez:cleanup-e0741, r=pickfire

Clean up E0741 error explanation

r? @Dylan-DPC

3 years agoRemove chrono feature from tracing
Oliver Scherer [Sat, 1 Aug 2020 14:24:52 +0000 (16:24 +0200)]
Remove chrono feature from tracing

3 years agoClean up E0743 explanation
Guillaume Gomez [Sat, 1 Aug 2020 13:19:00 +0000 (15:19 +0200)]
Clean up E0743 explanation

3 years agoDefine forget_type only when relevant
Stein Somers [Sun, 26 Jul 2020 13:01:43 +0000 (15:01 +0200)]
Define forget_type only when relevant

3 years agoAuto merge of #74993 - sunfishcode:update-wasi-libc, r=alexcrichton
bors [Sat, 1 Aug 2020 11:25:31 +0000 (11:25 +0000)]
Auto merge of #74993 - sunfishcode:update-wasi-libc, r=alexcrichton

Update the bundled wasi-libc with libstd

This just updates WASI libc, in preparation for WASI reactor support in
a separate change.

r? @alexcrichton

3 years agoAuto merge of #74582 - Lezzz:rename-hair, r=nikomatsakis
bors [Sat, 1 Aug 2020 09:25:03 +0000 (09:25 +0000)]
Auto merge of #74582 - Lezzz:rename-hair, r=nikomatsakis

Rename HAIR to THIR (Typed HIR).

r? @nikomatsakis

Originally suggested by @eddyb

3 years agoAuto merge of #74373 - lcnr:array_chunks, r=withoutboats
bors [Sat, 1 Aug 2020 06:54:14 +0000 (06:54 +0000)]
Auto merge of #74373 - lcnr:array_chunks, r=withoutboats

add `slice::array_chunks` to std

Now that #74113 has landed, these methods are suddenly usable. A rebirth of #72334

Tests are directly copied from `chunks_exact` and some additional tests for type inference.

r? @withoutboats as you are both part of t-libs and working on const generics. closes #60735

3 years agoadd tracking issue
Bastian Kauschke [Sat, 1 Aug 2020 05:49:24 +0000 (07:49 +0200)]
add tracking issue

3 years agoReplace a recursive algorithm with an iterative one and a stack.
Oliver Scherer [Fri, 31 Jul 2020 16:40:25 +0000 (18:40 +0200)]
Replace a recursive algorithm with an iterative one and a stack.

3 years agoAuto merge of #74945 - dingxiangfei2009:promote-static-ref-deref, r=oli-obk
bors [Sat, 1 Aug 2020 04:34:05 +0000 (04:34 +0000)]
Auto merge of #74945 - dingxiangfei2009:promote-static-ref-deref, r=oli-obk

[mir] Special treatment for dereferencing a borrow to a static definition

Fix #70584.

As suggested by @oli-obk in this [comment](https://github.com/rust-lang/rust/issues/70584#issuecomment-626009260), one can chase the definition of the local variable being de-referenced and check if it is a true static variable. If that is the case, `validate_place` will admit the promotion.

This is my first time to contribute to `rustc`, and I have two questions.
1. A generalization to some extent is applied to decide if the promotion is possible in the static context. In case that there are more projection operations preceding the de-referencing, `validate_place` recursively decent into inner projection operations. I have put thoughts into its correctness but I am not totally sure about it.
2. I have a hard time to find a good place for the test case. This patch has to do with MIR, but this test case would look out of place compared to other tests in `src/test/ui/mir` or `src/test/ui/borrowck` because it does not generate errors while others do. It is tentatively placed in `src/test/ui/statics` for now.

Thank you for any comments and suggestions!

3 years agoAuto merge of #74717 - davidtwco:issue-74636-polymorphized-closures-inherited-params...
bors [Sat, 1 Aug 2020 02:48:34 +0000 (02:48 +0000)]
Auto merge of #74717 - davidtwco:issue-74636-polymorphized-closures-inherited-params, r=oli-obk

mir: add `used_generic_parameters_needs_subst`

Fixes #74636.

This PR adds a `used_generic_parameters_needs_subst` helper function which checks whether a type needs substitution, but only for parameters that the `unused_generic_params` query considers used. This is used in the MIR interpreter to make the check for some pointer casts and for reflection intrinsics more precise.

I've opened this as a draft PR because this might not be the approach we want to fix this issue and we have to decide what to do about the reflection case.

r? @eddyb
cc @lcnr @wesleywiser

3 years agoAuto merge of #74994 - JohnTitor:rollup-eknaekv, r=JohnTitor
bors [Fri, 31 Jul 2020 23:52:46 +0000 (23:52 +0000)]
Auto merge of #74994 - JohnTitor:rollup-eknaekv, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #74644 (Remove `linked_list_extras` methods.)
 - #74968 (Run all tests if have no specified tests)
 - #74982 (1.45.2 release notes)
 - #74984 (Miri: fix ICE when unwinding past topmost stack frame)
 - #74986 (fix part of comparison that would always evaluate to "true", probably an oversight)
 - #74991 (Fix Const-Generic Cycle ICE #74199)

Failed merges:

r? @ghost

3 years agosubmodules: update cargo from 974eb438d to 2d5c2381e
Matthias Krüger [Fri, 31 Jul 2020 23:41:36 +0000 (01:41 +0200)]
submodules: update cargo from 974eb438d to 2d5c2381e

Changes:
````
Use the same index location on nightly as beta
relax deprecated diagnostic message check
Don't print to raw stderr in test
Emit the `test` field in cargo metadata
````

3 years agoUpdate the WASI libc build to LLVM 10.
Dan Gohman [Fri, 31 Jul 2020 23:07:08 +0000 (16:07 -0700)]
Update the WASI libc build to LLVM 10.

Among other things, this brings in [the `__main_argc_argv`] patch,
which simplifies the interaction between the compiler and WASI libc's
startup code, which will help work on reactor support.

[the `__main_argc_argv` patch]: https://github.com/llvm/llvm-project/commit/00072c08c75050ae2c835b7bb0e505475dbcd7b9

3 years agoRollup merge of #74991 - JulianKnodt:74199, r=lcnr
Yuki Okushi [Fri, 31 Jul 2020 23:02:12 +0000 (08:02 +0900)]
Rollup merge of #74991 - JulianKnodt:74199, r=lcnr

Fix Const-Generic Cycle ICE #74199

This PR intends to fix the bug in Issue #74199 by following the suggestion provided of ignoring the error that causes the ICE.

This does not fix the underlying cycle detection issue, but fixes the ICE.
Also adds a test to check that it doesn't causes an ICE but returns a valid error for now.

r? @lcnr

Edit: Also it's funny how this PR number is an anagram of the issue number

3 years agoRollup merge of #74986 - matthiaskrgr:cmp_true, r=oli-obk
Yuki Okushi [Fri, 31 Jul 2020 23:02:11 +0000 (08:02 +0900)]
Rollup merge of #74986 - matthiaskrgr:cmp_true, r=oli-obk

fix part of comparison that would always evaluate to "true", probably an oversight

cc  @jumbatm

3 years agoRollup merge of #74984 - RalfJung:miri-unwind-top, r=oli-obk
Yuki Okushi [Fri, 31 Jul 2020 23:02:09 +0000 (08:02 +0900)]
Rollup merge of #74984 - RalfJung:miri-unwind-top, r=oli-obk

Miri: fix ICE when unwinding past topmost stack frame

Fixes https://github.com/rust-lang/miri/issues/1389

3 years agoRollup merge of #74982 - jonas-schievink:relnotes-1.45.2, r=Mark-Simulacrum
Yuki Okushi [Fri, 31 Jul 2020 23:02:07 +0000 (08:02 +0900)]
Rollup merge of #74982 - jonas-schievink:relnotes-1.45.2, r=Mark-Simulacrum

1.45.2 release notes

(for master)

cc https://github.com/rust-lang/rust/pull/74958

3 years agoRollup merge of #74968 - lzutao:no-args, r=Mark-Simulacrum
Yuki Okushi [Fri, 31 Jul 2020 23:02:06 +0000 (08:02 +0900)]
Rollup merge of #74968 - lzutao:no-args, r=Mark-Simulacrum

Run all tests if have no specified tests

The behaviour was changed in https://github.com/rust-lang/rust/pull/74905#discussion_r463259562
cc @alex if you could check it again, thank you.

3 years agoRollup merge of #74644 - crlf0710:drop_old_stuff, r=Amanieu
Yuki Okushi [Fri, 31 Jul 2020 23:02:04 +0000 (08:02 +0900)]
Rollup merge of #74644 - crlf0710:drop_old_stuff, r=Amanieu

Remove `linked_list_extras` methods.

Removing these in favor of the `Cursor` API in https://github.com/rust-lang/rust/issues/58533 .
Closes #27794.

r? @Amanieu

3 years agoRename HAIR to THIR (Typed HIR).
Valentin Lazureanu [Tue, 21 Jul 2020 09:09:27 +0000 (09:09 +0000)]
Rename HAIR to THIR (Typed HIR).

3 years agofix rustdoc generic param order
Bastian Kauschke [Fri, 31 Jul 2020 21:51:19 +0000 (23:51 +0200)]
fix rustdoc generic param order

3 years agoUpdate the bundled wasi-libc with libstd
Dan Gohman [Fri, 31 Jul 2020 21:47:19 +0000 (14:47 -0700)]
Update the bundled wasi-libc with libstd

This just updates WASI libc, in preparation for WASI reactor support in
a separate change.

3 years agoAdded in explicit check for the type being matched
kadmin [Fri, 31 Jul 2020 21:33:55 +0000 (21:33 +0000)]
Added in explicit check for the type being matched

3 years agoRemoved error check in order to prevent ICE
kadmin [Fri, 31 Jul 2020 21:12:05 +0000 (21:12 +0000)]
Removed error check in order to prevent ICE

3 years agoDon't register a tracing dispatcher if no tracing env var was set.
Oliver Scherer [Tue, 28 Jul 2020 13:49:04 +0000 (15:49 +0200)]
Don't register a tracing dispatcher if no tracing env var was set.

3 years agoDisable log support
Oliver Scherer [Sun, 26 Jul 2020 11:01:51 +0000 (13:01 +0200)]
Disable log support

3 years agoUpdate error index generator to tracing
Oliver Scherer [Sat, 25 Jul 2020 15:19:17 +0000 (17:19 +0200)]
Update error index generator to tracing

3 years agoMake rustdoc share the logger initialization routine with rustc.
Oliver Scherer [Sat, 25 Jul 2020 13:50:51 +0000 (15:50 +0200)]
Make rustdoc share the logger initialization routine with rustc.

3 years agoAdd tracing libs to list of permitted dependencies
Oliver Scherer [Fri, 24 Jul 2020 19:35:14 +0000 (21:35 +0200)]
Add tracing libs to list of permitted dependencies

3 years agoMove from `log` to `tracing`
Oliver Scherer [Fri, 24 Jul 2020 18:42:00 +0000 (20:42 +0200)]
Move from `log` to `tracing`

3 years agofix part of comparison that would always evaluate to "true", probably an oversight
Matthias Krüger [Fri, 31 Jul 2020 19:23:39 +0000 (21:23 +0200)]
fix part of comparison that would always evaluate to "true", probably an oversight

3 years agoMiri: fix ICE when unwinding past topmost stack frame
Ralf Jung [Fri, 31 Jul 2020 18:46:05 +0000 (20:46 +0200)]
Miri: fix ICE when unwinding past topmost stack frame

3 years agoReduce verbosity of some type ascription errors
Esteban Küber [Thu, 9 Jul 2020 20:49:55 +0000 (13:49 -0700)]
Reduce verbosity of some type ascription errors

* Deduplicate type ascription LHS errors
* Remove duplicated `:` -> `::` suggestion from parse error
* Tweak wording to be more accurate
* Modify `current_type_ascription` to reduce span wrangling
* remove now unnecessary match arm
* Add run-rustfix to appropriate tests

3 years agoAuto merge of #65989 - Aaron1011:fix/normalize-param-env, r=nikomatsakis
bors [Fri, 31 Jul 2020 18:14:59 +0000 (18:14 +0000)]
Auto merge of #65989 - Aaron1011:fix/normalize-param-env, r=nikomatsakis

Normalize all opaque types when converting ParamEnv to Reveal::All

When we normalize a type using a ParamEnv with a reveal mode of
RevealMode::All, we will normalize opaque types to their underlying
types (e.g. `type MyOpaque = impl Foo` -> `StructThatImplsFoo`).
However, the ParamEnv may still have predicates referring to the
un-normalized opaque type (e.g. `<T as MyTrait<MyOpaque>>`). This can
cause trait projection to fail, since a type containing normalized
opaque types will not match up with the un-normalized type in the
`ParamEnv`.

To fix this, we now explicitly normalize all opaque types in
caller_bounds of a `ParamEnv` when changing its mode to
`RevealMode::All`. This ensures that all predicatse will refer to the
underlying types of any opaque types involved, allowing them to be
matched up properly during projection. To reflect the fact that
normalization is occuring, `ParamEnv::with_reveal_all` is renamed to
`ParamEnv::with_reveal_all_normalized`

Fixes #65918

3 years agoRemove `linked_list_extras` methods.
Charles Lew [Wed, 22 Jul 2020 17:30:54 +0000 (01:30 +0800)]
Remove `linked_list_extras` methods.

3 years ago1.45.2 release notes
Mark Rousskov [Thu, 30 Jul 2020 20:12:02 +0000 (16:12 -0400)]
1.45.2 release notes

3 years agointerp: needs_subst -> ensure_monomorphic_enough
David Wood [Fri, 24 Jul 2020 12:16:54 +0000 (13:16 +0100)]
interp: needs_subst -> ensure_monomorphic_enough

This commit adds a `ensure_monomorphic_enough` utility function which
checks whether a type needs substitution, but only for parameters
that the `unused_generic_params` query considers used.

`ensure_monomorphic_enough` is then used throughout interpret where
`needs_subst` checks previously existed (in particular, for some
pointer casts and for reflection intrinsics more precise).

Signed-off-by: David Wood <david@davidtw.co>
3 years agoSome fixes for `plugin.md` in unstable-book
Takayuki Nakata [Fri, 31 Jul 2020 14:53:05 +0000 (23:53 +0900)]
Some fixes for `plugin.md` in unstable-book

- sample codes not working
- broken link

3 years agoAuto merge of #74844 - asomers:freebsd-profiler, r=pietroalbini
bors [Fri, 31 Jul 2020 12:27:13 +0000 (12:27 +0000)]
Auto merge of #74844 - asomers:freebsd-profiler, r=pietroalbini

Enable the profiler on FreeBSD

FreeBSD has been doing this in our own package builds for two months
now.

https://svnweb.freebsd.org/ports?view=revision&revision=535771

3 years agoexpand comments
Ralf Jung [Fri, 31 Jul 2020 12:03:42 +0000 (14:03 +0200)]
expand comments

3 years agoClean up E0741 error explanation
Guillaume Gomez [Fri, 31 Jul 2020 11:15:47 +0000 (13:15 +0200)]
Clean up E0741 error explanation

3 years agoAuto merge of #74965 - JohnTitor:sort-params, r=estebank
bors [Fri, 31 Jul 2020 10:16:57 +0000 (10:16 +0000)]
Auto merge of #74965 - JohnTitor:sort-params, r=estebank

Presort restrictions to make output consistent

The const test part is already adjusted so this should fix #74886.
r? @estebank

3 years agoAdd the proper tests
Ding Xiang Fei [Fri, 31 Jul 2020 10:04:13 +0000 (18:04 +0800)]
Add the proper tests

3 years agoalso reduce some libcore test iteration counts
Ralf Jung [Fri, 31 Jul 2020 09:52:53 +0000 (11:52 +0200)]
also reduce some libcore test iteration counts