]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoChange `next_point` when `shrink_to_hi` is more appropriate
Esteban Küber [Fri, 10 Jan 2020 19:22:33 +0000 (11:22 -0800)]
Change `next_point` when `shrink_to_hi` is more appropriate

4 years agoinline `impl AsRef<Path> for PathBuf`
Lzu Tao [Fri, 10 Jan 2020 19:18:17 +0000 (19:18 +0000)]
inline `impl AsRef<Path> for PathBuf`

4 years agoinline `impl AsRef<OsStr> for OsString`
Lzu Tao [Fri, 10 Jan 2020 19:06:18 +0000 (19:06 +0000)]
inline `impl AsRef<OsStr> for OsString`

4 years agoFix invalid bounding box
Esteban Küber [Fri, 10 Jan 2020 19:03:26 +0000 (11:03 -0800)]
Fix invalid bounding box

4 years agoFix `next_point` to be unicode aware
Esteban Küber [Fri, 10 Jan 2020 19:02:47 +0000 (11:02 -0800)]
Fix `next_point` to be unicode aware

4 years agoInline `impl From<OsString> for PathBuf`
Lzu Tao [Fri, 10 Jan 2020 19:02:14 +0000 (19:02 +0000)]
Inline `impl From<OsString> for PathBuf`

4 years agoInline `AsRef<Path> for str`
Lzu Tao [Fri, 10 Jan 2020 18:56:30 +0000 (18:56 +0000)]
Inline `AsRef<Path> for str`

4 years agoInline PathBuf::deref to make it zero cost
Lzu Tao [Fri, 10 Jan 2020 18:48:15 +0000 (18:48 +0000)]
Inline PathBuf::deref to make it zero cost

4 years agoUpdate E0185.md
Dylan DPC [Fri, 10 Jan 2020 18:26:00 +0000 (23:56 +0530)]
Update E0185.md

4 years agoInline to make OsStr::is_empty zero cost
Lzu Tao [Fri, 10 Jan 2020 18:20:40 +0000 (18:20 +0000)]
Inline to make OsStr::is_empty zero cost

4 years agoAuto merge of #67996 - JohnTitor:clippy-up, r=JohnTitor
bors [Fri, 10 Jan 2020 16:53:17 +0000 (16:53 +0000)]
Auto merge of #67996 - JohnTitor:clippy-up, r=JohnTitor

Update Clippy

Fixes #67994

r? @ghost

4 years agoClarify suggestion for E0013
varkor [Fri, 10 Jan 2020 13:31:36 +0000 (13:31 +0000)]
Clarify suggestion for E0013

4 years agomake use of pointer::is_null
Lzu Tao [Fri, 10 Jan 2020 12:52:00 +0000 (12:52 +0000)]
make use of pointer::is_null

4 years agoAuto merge of #67397 - michaelwoerister:query-keys-in-self-profiling, r=wesleywiser
bors [Fri, 10 Jan 2020 12:18:46 +0000 (12:18 +0000)]
Auto merge of #67397 - michaelwoerister:query-keys-in-self-profiling, r=wesleywiser

self-profiling: Support recording query keys

This PR makes self-profiling able to record query keys. The implementation is not as efficient as it could be yet (all query keys except for `DefId`s cause string data to be duplicated) and the rendered strings could be nicer too. But the implementation is functional and introduces the basic framework for emitting per-query-invocation event data.

I tried to add proper documentation on how everything works. Let me know if more documentation is needed.

r? @wesleywiser

@Mark-Simulacrum, heads up: This updates `measureme` to 0.7.0 which means that `summarize` on perf.rlo needs to be update accordingly once this is merged.

4 years agoPrefer llvm-skip-rebuild flag value over config.toml
Matthew Healy [Thu, 9 Jan 2020 22:13:57 +0000 (23:13 +0100)]
Prefer llvm-skip-rebuild flag value over config.toml

4 years agoMatch llvm-skip-rebuild flag
Matthew Healy [Thu, 9 Jan 2020 21:51:38 +0000 (22:51 +0100)]
Match llvm-skip-rebuild flag

4 years agoFix some rebasing fallout.
Michael Woerister [Fri, 10 Jan 2020 09:32:16 +0000 (10:32 +0100)]
Fix some rebasing fallout.

4 years agoUpdate measureme to 0.7.1 in order to fix compilation error on big-endian platforms.
Michael Woerister [Fri, 3 Jan 2020 11:01:53 +0000 (12:01 +0100)]
Update measureme to 0.7.1 in order to fix compilation error on big-endian platforms.

4 years agoRun 'x.py fmt'.
Michael Woerister [Fri, 3 Jan 2020 10:49:14 +0000 (11:49 +0100)]
Run 'x.py fmt'.

4 years agoself-profile: Fix issue with handling query blocking.
Michael Woerister [Wed, 18 Dec 2019 15:39:06 +0000 (16:39 +0100)]
self-profile: Fix issue with handling query blocking.

4 years agoInitial support for recording query keys in self-profiling data.
Michael Woerister [Tue, 17 Dec 2019 13:44:07 +0000 (14:44 +0100)]
Initial support for recording query keys in self-profiling data.

4 years agoUse 'relaxed' memory ordering for simple atomic counters in dep-graph.
Michael Woerister [Fri, 13 Dec 2019 13:46:10 +0000 (14:46 +0100)]
Use 'relaxed' memory ordering for simple atomic counters in dep-graph.

4 years agoself-profile: Switch to new approach for event_id generation that enables query-invoc...
Michael Woerister [Fri, 13 Dec 2019 13:44:08 +0000 (14:44 +0100)]
self-profile: Switch to new approach for event_id generation that enables query-invocation-specific event_ids.

4 years agoImprove E0185 wording
Guillaume Gomez [Fri, 10 Jan 2020 09:05:49 +0000 (10:05 +0100)]
Improve E0185 wording

4 years agoRebase fallout
Oliver Scherer [Thu, 9 Jan 2020 14:32:14 +0000 (15:32 +0100)]
Rebase fallout

4 years agoRemove an outdated comment
Oliver Scherer [Thu, 9 Jan 2020 13:46:32 +0000 (14:46 +0100)]
Remove an outdated comment

4 years agoAdd regression tests for promotion mir expansion
Oliver Scherer [Thu, 9 Jan 2020 09:33:49 +0000 (10:33 +0100)]
Add regression tests for promotion mir expansion

4 years agoErrors in promoteds may only cause lints not hard errors
Oliver Scherer [Wed, 8 Jan 2020 20:31:08 +0000 (21:31 +0100)]
Errors in promoteds may only cause lints not hard errors

4 years agoPromoteds also need param envs.
Oliver Scherer [Wed, 8 Jan 2020 19:50:59 +0000 (20:50 +0100)]
Promoteds also need param envs.

This also allows us to use the `const_eval` query again without causing cycles

4 years agoDo not store lint_root
Santiago Pastorino [Wed, 1 Jan 2020 15:35:50 +0000 (12:35 -0300)]
Do not store lint_root

4 years agoAdd span_bug that notes that shuffle indices must be constant
Santiago Pastorino [Thu, 19 Dec 2019 17:14:36 +0000 (14:14 -0300)]
Add span_bug that notes that shuffle indices must be constant

4 years agoMake Place Copy
Santiago Pastorino [Thu, 19 Dec 2019 17:10:48 +0000 (14:10 -0300)]
Make Place Copy

4 years agoUse re_erased instead of re_static
Santiago Pastorino [Thu, 19 Dec 2019 17:09:04 +0000 (14:09 -0300)]
Use re_erased instead of re_static

4 years agoNo need to use local.into here
Santiago Pastorino [Fri, 13 Dec 2019 19:23:38 +0000 (16:23 -0300)]
No need to use local.into here

4 years agoFix print const on librustdoc
Santiago Pastorino [Fri, 13 Dec 2019 19:23:23 +0000 (16:23 -0300)]
Fix print const on librustdoc

4 years agoRemove PlaceBase enum and make Place base field be local: Local
Santiago Pastorino [Wed, 11 Dec 2019 19:50:03 +0000 (16:50 -0300)]
Remove PlaceBase enum and make Place base field be local: Local

4 years agoRemove Static from PlaceBase
Santiago Pastorino [Wed, 11 Dec 2019 13:39:24 +0000 (10:39 -0300)]
Remove Static from PlaceBase

4 years agoRemove unused param_env parameter
Santiago Pastorino [Wed, 11 Dec 2019 05:07:04 +0000 (02:07 -0300)]
Remove unused param_env parameter

4 years agoUse if let instead of match with one meaningful arm
Santiago Pastorino [Wed, 11 Dec 2019 04:57:01 +0000 (01:57 -0300)]
Use if let instead of match with one meaningful arm

4 years agoRemove StaticKind
Santiago Pastorino [Wed, 11 Dec 2019 04:53:46 +0000 (01:53 -0300)]
Remove StaticKind

4 years agoRemove StaticKind::Promoted
Santiago Pastorino [Wed, 11 Dec 2019 04:27:33 +0000 (01:27 -0300)]
Remove StaticKind::Promoted

4 years agoAdd promoted_operand closure to reuse code across different
Santiago Pastorino [Wed, 11 Dec 2019 03:11:12 +0000 (00:11 -0300)]
Add promoted_operand closure to reuse code across different

4 years agoPromote `Argument`s to constants instead of statics
Santiago Pastorino [Wed, 11 Dec 2019 03:09:49 +0000 (00:09 -0300)]
Promote `Argument`s to constants instead of statics

4 years agoPromote `Repeat`s to constants instead of statics
Santiago Pastorino [Tue, 10 Dec 2019 23:40:29 +0000 (20:40 -0300)]
Promote `Repeat`s to constants instead of statics

4 years agoPromote `Ref`s to constants instead of static
Santiago Pastorino [Fri, 22 Nov 2019 20:26:09 +0000 (17:26 -0300)]
Promote `Ref`s to constants instead of static

4 years agoRevert const_eval call to use const_eval_raw to avoid const validation cycles
Santiago Pastorino [Tue, 31 Dec 2019 14:47:33 +0000 (11:47 -0300)]
Revert const_eval call to use const_eval_raw to avoid const validation cycles

4 years agoAllow specifying LLVM args in target specifications
Jethro Beekman [Thu, 9 Jan 2020 15:40:40 +0000 (16:40 +0100)]
Allow specifying LLVM args in target specifications

4 years agonix syntax::errors & prefer rustc_errors over errors
Mazdak Farrokhzad [Thu, 9 Jan 2020 10:18:47 +0000 (11:18 +0100)]
nix syntax::errors & prefer rustc_errors over errors

4 years agoIntroduce `#![feature(half_open_range_patterns)]`.
Mazdak Farrokhzad [Wed, 11 Dec 2019 09:04:34 +0000 (10:04 +0100)]
Introduce `#![feature(half_open_range_patterns)]`.

This feature adds `X..`, `..X`, and `..=X` patterns.

4 years agoDo not ICE on unicode next point
Esteban Küber [Fri, 10 Jan 2020 06:10:18 +0000 (22:10 -0800)]
Do not ICE on unicode next point

Use `shrink_to_hi` instead of `next_point`
Fix #68000.

4 years agoAuto merge of #68078 - Centril:rollup-qvq052k, r=Centril
bors [Fri, 10 Jan 2020 02:09:41 +0000 (02:09 +0000)]
Auto merge of #68078 - Centril:rollup-qvq052k, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #66463 (Point at opaque and closure type definitions in type errors)
 - #67501 (Reduce special treatment for zsts)
 - #67820 (Parse the syntax described in RFC 2632)
 - #67922 (rustc_ast_lowering: misc cleanup & rustc dep reductions)
 - #68071 (Extend support of `_` in type parameters)
 - #68073 (expect `fn` after `const unsafe` / `const extern`)

Failed merges:

r? @ghost

4 years agoRollup merge of #68073 - Centril:fix-68062, r=estebank
Mazdak Farrokhzad [Fri, 10 Jan 2020 01:47:36 +0000 (02:47 +0100)]
Rollup merge of #68073 - Centril:fix-68062, r=estebank

expect `fn` after `const unsafe` / `const extern`

Fixes #68062

r? @estebank @petrochenkov
cc @Aaron1011

4 years agoRollup merge of #68071 - estebank:ice-67995, r=Centril
Mazdak Farrokhzad [Fri, 10 Jan 2020 01:47:34 +0000 (02:47 +0100)]
Rollup merge of #68071 - estebank:ice-67995, r=Centril

Extend support of `_` in type parameters

 - Account for `impl Trait<_>`.
 - Provide a reasonable `Span` for empty `Generics` in `impl`s.
 - Account for `fn foo<_>(_: _) {}` to suggest `fn foo<T>(_: T) {}`.
 - Fix #67995. Follow up to #67597.

4 years agoRollup merge of #67922 - Centril:lowering-cleanup, r=petrochenkov
Mazdak Farrokhzad [Fri, 10 Jan 2020 01:47:33 +0000 (02:47 +0100)]
Rollup merge of #67922 - Centril:lowering-cleanup, r=petrochenkov

rustc_ast_lowering: misc cleanup & rustc dep reductions

- The first two commits do some code simplification.
- The next three do some file splitting (getting `lib.rs` below the 3kloc tidy lint).
- The remaining commits reduce the number of `rustc::` imports. This works towards making lowering independent of the `rustc` crate.

r? @oli-obk cc @Zoxc

4 years agoRollup merge of #67820 - ecstatic-morse:const-trait, r=oli-obk
Mazdak Farrokhzad [Fri, 10 Jan 2020 01:47:32 +0000 (02:47 +0100)]
Rollup merge of #67820 - ecstatic-morse:const-trait, r=oli-obk

Parse the syntax described in RFC 2632

This adds support for both `impl const Trait for Ty` and `?const Trait` bound syntax from rust-lang/rfcs#2632 to the parser. For now, both modifiers end up in a newly-added `constness` field on `ast::TraitRef`, although this may change once the implementation is fleshed out.

I was planning on using `delay_span_bug` when this syntax is encountered during lowering, but I can't write `should-ice` UI tests. I emit a normal error instead, which causes duplicates when the feature gate is not enabled (see the `.stderr` files for the feature gate tests). Not sure what the desired approach is; Maybe just do nothing when the syntax is encountered with the feature gate is enabled?

@oli-obk I went with `const_trait_impl` and `const_trait_bound_opt_out` for the names of these features. Are these to your liking?

cc #67792 #67794

r? @Centril

4 years agoRollup merge of #67501 - oli-obk:test-slice-patterns, r=RalfJung
Mazdak Farrokhzad [Fri, 10 Jan 2020 01:47:30 +0000 (02:47 +0100)]
Rollup merge of #67501 - oli-obk:test-slice-patterns, r=RalfJung

Reduce special treatment for zsts

addresses https://github.com/rust-lang/rust/pull/67467#discussion_r360650846

cc @RalfJung

4 years agoRollup merge of #66463 - estebank:point-at-closure-and-opaque-types, r=Centril
Mazdak Farrokhzad [Fri, 10 Jan 2020 01:47:29 +0000 (02:47 +0100)]
Rollup merge of #66463 - estebank:point-at-closure-and-opaque-types, r=Centril

Point at opaque and closure type definitions in type errors

Fixes #57266, fixes #67117.

4 years agoAdd test for `?const` in nested impl/dyn trait
Dylan MacKenzie [Mon, 6 Jan 2020 00:34:26 +0000 (16:34 -0800)]
Add test for `?const` in nested impl/dyn trait

4 years agoMake `bound_context` more like neighboring functions
Dylan MacKenzie [Mon, 6 Jan 2020 00:33:26 +0000 (16:33 -0800)]
Make `bound_context` more like neighboring functions

4 years agoAdd test for `?const` and `?` on the same bound
Dylan MacKenzie [Sun, 5 Jan 2020 05:47:11 +0000 (21:47 -0800)]
Add test for `?const` and `?` on the same bound

4 years agoCall all visit methods on trait definitions
Dylan MacKenzie [Sun, 5 Jan 2020 02:34:10 +0000 (18:34 -0800)]
Call all visit methods on trait definitions

4 years agoAdd tests for RFC 2632
Dylan MacKenzie [Fri, 3 Jan 2020 00:31:30 +0000 (16:31 -0800)]
Add tests for RFC 2632

4 years agoCheck for `?const` in invalid contexts during AST validation
Dylan MacKenzie [Sun, 5 Jan 2020 00:29:45 +0000 (16:29 -0800)]
Check for `?const` in invalid contexts during AST validation

4 years agoReject `const` in inherent impls
Dylan MacKenzie [Sat, 4 Jan 2020 00:32:01 +0000 (16:32 -0800)]
Reject `const` in inherent impls

4 years agoError when new syntax is lowered
Dylan MacKenzie [Fri, 3 Jan 2020 00:35:07 +0000 (16:35 -0800)]
Error when new syntax is lowered

This means the new syntax will always fail to compile, even when the
feature gate is enabled. These checks will be removed in a later PR
once the implementation is done.

4 years agoParse `?const Trait` bound syntax
Dylan MacKenzie [Thu, 2 Jan 2020 23:50:18 +0000 (15:50 -0800)]
Parse `?const Trait` bound syntax

The grammar also handles `?const ?Trait` even though this is
semantically redundant.

4 years agoParse `impl const Trait for Ty` syntax
Dylan MacKenzie [Thu, 2 Jan 2020 23:49:45 +0000 (15:49 -0800)]
Parse `impl const Trait for Ty` syntax

4 years agoAdd a `constness` field to `ast::TraitRef`
Dylan MacKenzie [Thu, 2 Jan 2020 23:47:27 +0000 (15:47 -0800)]
Add a `constness` field to `ast::TraitRef`

This is used for both the `?const` syntax in bounds as well as the `impl
const Trait` syntax. I also considered handling these separately by
adding a variant of `TraitBoundModifier` and a field to
`ItemKind::Impl`, but this approach was less intrusive.

4 years agoAdd `const_trait_bound_opt_out` feature gate
Dylan MacKenzie [Thu, 2 Jan 2020 23:46:30 +0000 (15:46 -0800)]
Add `const_trait_bound_opt_out` feature gate

4 years agoAdd `const_trait_impl` feature gate
Dylan MacKenzie [Thu, 2 Jan 2020 23:45:48 +0000 (15:45 -0800)]
Add `const_trait_impl` feature gate

4 years agorustbuild: Cleanup book generation
Oliver Middleton [Thu, 9 Jan 2020 23:45:06 +0000 (23:45 +0000)]
rustbuild: Cleanup book generation

The Cargo book can be generated the same way as the other books.

4 years agoreview comments: more tests
Esteban Küber [Thu, 9 Jan 2020 22:53:17 +0000 (14:53 -0800)]
review comments: more tests

4 years agoUpdate Clippy
Yuki Okushi [Wed, 8 Jan 2020 07:47:57 +0000 (16:47 +0900)]
Update Clippy

4 years agoAdd llvm-skip-rebuild to opts
Matthew Healy [Thu, 9 Jan 2020 21:19:33 +0000 (22:19 +0100)]
Add llvm-skip-rebuild to opts

4 years agoExtend support of `_` in type parameters
Esteban Küber [Thu, 9 Jan 2020 21:46:37 +0000 (13:46 -0800)]
Extend support of `_` in type parameters

 - Account for `impl Trait<_>`.
 - Provide a reasonable `Span` for empty `Generics` in `impl`s.
 - Account for `fn foo<_>(_: _) {}` to suggest `fn foo<T>(_: T) {}`.
 - Fix #67995.

4 years agoTweak timers
John Kåre Alsaker [Thu, 9 Jan 2020 22:19:20 +0000 (23:19 +0100)]
Tweak timers

4 years agoexpect `fn` after `const unsafe` / `const extern`
Mazdak Farrokhzad [Thu, 9 Jan 2020 22:00:28 +0000 (23:00 +0100)]
expect `fn` after `const unsafe` / `const extern`

4 years agoFix ICE #68058
Yuki Okushi [Thu, 9 Jan 2020 21:52:22 +0000 (06:52 +0900)]
Fix ICE #68058

4 years agoLabel unmarked time
John Kåre Alsaker [Thu, 9 Jan 2020 02:48:00 +0000 (03:48 +0100)]
Label unmarked time

4 years agoPrecompile CGUs while the main thread has the implicit job server token
John Kåre Alsaker [Wed, 8 Jan 2020 05:05:26 +0000 (06:05 +0100)]
Precompile CGUs while the main thread has the implicit job server token

4 years agoCompile some CGUs in parallel at the start of codegen
John Kåre Alsaker [Sun, 5 Jan 2020 01:10:23 +0000 (02:10 +0100)]
Compile some CGUs in parallel at the start of codegen

4 years agoclean up E0185 explanation
Guillaume Gomez [Thu, 9 Jan 2020 21:25:58 +0000 (22:25 +0100)]
clean up E0185 explanation

4 years agoAuto merge of #68067 - JohnTitor:rollup-vsj5won, r=JohnTitor
bors [Thu, 9 Jan 2020 19:21:58 +0000 (19:21 +0000)]
Auto merge of #68067 - JohnTitor:rollup-vsj5won, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #66254 (Make Layout::new const)
 - #67122 (Do not deduplicate diagnostics in UI tests)
 - #67358 (Add HashSet::get_or_insert_owned)
 - #67725 (Simplify into_key_slice_mut)
 - #67935 (Relax the Sized bounds on Pin::map_unchecked(_mut))
 - #67967 (Delay bug to prevent ICE in MIR borrowck)
 - #67975 (Export public scalar statics in wasm)
 - #68006 (Recognise riscv64 in compiletest)
 - #68040 (Cleanup)
 - #68054 (doc: add Null-unchecked version section to mut pointer as_mut method)

Failed merges:

 - #67258 (Introduce `X..`, `..X`, and `..=X` range patterns)

r? @ghost

4 years agoRollup merge of #68054 - tspiteri:null-unchecked-as_mut, r=cramertj
Yuki Okushi [Thu, 9 Jan 2020 19:18:43 +0000 (04:18 +0900)]
Rollup merge of #68054 - tspiteri:null-unchecked-as_mut, r=cramertj

doc: add Null-unchecked version section to mut pointer as_mut method

The [`as_ref`](https://doc.rust-lang.org/std/primitive.pointer.html#method.as_ref-1) method already has a *Null-unchecked version* section, its example is a modification of the example in the main `as_ref` section. Similarly the example in this PR is a modification of the example in main [`as_mut`](https://doc.rust-lang.org/std/primitive.pointer.html#method.as_mut) section.

Fixes #68032.

4 years agoRollup merge of #68040 - sinkuu:unused, r=petrochenkov
Yuki Okushi [Thu, 9 Jan 2020 19:18:42 +0000 (04:18 +0900)]
Rollup merge of #68040 - sinkuu:unused, r=petrochenkov

Cleanup

4 years agoRollup merge of #68006 - infinity0:master, r=nikomatsakis
Yuki Okushi [Thu, 9 Jan 2020 19:18:40 +0000 (04:18 +0900)]
Rollup merge of #68006 - infinity0:master, r=nikomatsakis

Recognise riscv64 in compiletest

Otherwise tests can't run, fails with "Cannot determine Architecture from triple"

4 years agoRollup merge of #67975 - EmbarkStudios:export-statics-wasm, r=alexcrichton
Yuki Okushi [Thu, 9 Jan 2020 19:18:39 +0000 (04:18 +0900)]
Rollup merge of #67975 - EmbarkStudios:export-statics-wasm, r=alexcrichton

Export public scalar statics in wasm

Fixes #67453

I am not sure which export level statics should get when exporting them in wasm. This small change fixes the issue that I had, but this might not be the correct way to implement this.

4 years agoRollup merge of #67967 - JohnTitor:fix-ice-0107, r=matthewjasper
Yuki Okushi [Thu, 9 Jan 2020 19:18:37 +0000 (04:18 +0900)]
Rollup merge of #67967 - JohnTitor:fix-ice-0107, r=matthewjasper

Delay bug to prevent ICE in MIR borrowck

Fixes #67947

r? @matthewjasper

4 years agoRollup merge of #67935 - Thomasdezeeuw:issue_67669, r=withoutboats
Yuki Okushi [Thu, 9 Jan 2020 19:18:36 +0000 (04:18 +0900)]
Rollup merge of #67935 - Thomasdezeeuw:issue_67669, r=withoutboats

Relax the Sized bounds on Pin::map_unchecked(_mut)

Fixes #67669.

4 years agoRollup merge of #67725 - ssomers:into_key_slice_mut, r=RalfJung
Yuki Okushi [Thu, 9 Jan 2020 19:18:34 +0000 (04:18 +0900)]
Rollup merge of #67725 - ssomers:into_key_slice_mut, r=RalfJung

Simplify into_key_slice_mut

Remove a rare and tiny but superfluous run-time check from into_key_slice_mut.

In #67459, I wrote that "`get_mut` [...] does visit `into_key_slice_mut`" and that was wrong. No function that operates on a map that (still) has a shared root ever dives into `into_key_slice_mut`.  So it's more clear to remove the (previously existing, and always incomplete) code it has for dealing with shared roots, as well as a petty performance improvement for those using exotically aligned key types.

~~Also, some testing of the `range` function initially added to #67686 but hardly related.~~

r? @RalfJung

4 years agoRollup merge of #67358 - cuviper:get_or_insert_owned, r=LukasKalbertodt
Yuki Okushi [Thu, 9 Jan 2020 19:18:32 +0000 (04:18 +0900)]
Rollup merge of #67358 - cuviper:get_or_insert_owned, r=LukasKalbertodt

Add HashSet::get_or_insert_owned

This is an extension for tracking issue #60896. The more-general `get_or_insert_with` has potential for misuse, so we might remove it, but I think `get_or_insert_owned` covers most use cases.

4 years agoRollup merge of #67122 - petrochenkov:nodedup, r=estebank
Yuki Okushi [Thu, 9 Jan 2020 19:18:30 +0000 (04:18 +0900)]
Rollup merge of #67122 - petrochenkov:nodedup, r=estebank

Do not deduplicate diagnostics in UI tests

Error reporting infrastructure deduplicates identical diagnostics with identical spans.

While it's preferable to do this in "release"/"user-facing" mode, it sometimes brings [confusion](https://github.com/rust-lang/rust/pull/50682#issuecomment-390949878) and hides details that may be important during development.

Do we run some passes multiple times when we could do it once?
How many times we run them exactly? Can this number be large? Can the multiplied error construction be expensive? Can speculative checks be made cheaper if they don't report errors?

*Relying* on this mechanism to deduplicate some specific error never looks like a proper solution to me personally.

In this PR I attempt to disable this deduplication by applying `-Z deduplicate-diagnostics=no` to UI tests.

4 years agoRollup merge of #66254 - CAD97:patch-1, r=KodrAus
Yuki Okushi [Thu, 9 Jan 2020 19:18:29 +0000 (04:18 +0900)]
Rollup merge of #66254 - CAD97:patch-1, r=KodrAus

Make Layout::new const

This seems like a reasonable change to make. If we don't provide `Layout::new::<T>` as `const`, then users can just instead do the more error prone `Layout::from_size_align_unchecked(mem::size_of::<T>(), mem::align_of::<T>())` for the same effect and an extra `unsafe { }` incantation.

4 years agoAddress review comments + Update NLL tests
Vadim Petrochenkov [Wed, 8 Jan 2020 20:16:57 +0000 (23:16 +0300)]
Address review comments + Update NLL tests

4 years agoMark Layout::new as const stable
CAD97 [Tue, 17 Dec 2019 19:55:46 +0000 (14:55 -0500)]
Mark Layout::new as const stable

4 years agoMake Layout::new const
Christopher Durham [Sat, 9 Nov 2019 18:43:11 +0000 (13:43 -0500)]
Make Layout::new const

4 years agoUpdate tests
Vadim Petrochenkov [Wed, 8 Jan 2020 17:02:10 +0000 (20:02 +0300)]
Update tests

4 years agocompiletest: Do not deduplicate diagnostics in UI tests
Vadim Petrochenkov [Wed, 8 Jan 2020 12:07:26 +0000 (15:07 +0300)]
compiletest: Do not deduplicate diagnostics in UI tests

4 years agoAuto merge of #68047 - pietroalbini:fix-toolstate-again, r=Mark-Simulacrum
bors [Thu, 9 Jan 2020 16:10:01 +0000 (16:10 +0000)]
Auto merge of #68047 - pietroalbini:fix-toolstate-again, r=Mark-Simulacrum

ci: another take at fixing toolstate

Seems like the variable showed by `$(ciCheckoutPath)` on Azure Pipelines was wrong, making the toolstate script fail. This commit changes that function to return the variable previously used by the toolstate script. Other uses of the function were audited, and there should be no conflict.

Failure log: https://dev.azure.com/rust-lang/rust/_build/results?buildId=17933
r? @Mark-Simulacrum

4 years agodoc: add Null-unchecked version section to mut pointer as_mut method
Trevor Spiteri [Thu, 9 Jan 2020 13:51:58 +0000 (14:51 +0100)]
doc: add Null-unchecked version section to mut pointer as_mut method

The as_ref method already has a Null-unchecked version section, its
example is a modification of the example in the main as_ref section.
Similarly the example in this commit is a modification of the example
in main as_mut section.