]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #71166 - GuillaumeGomez:cleanup-e0518, r=Dylan-DPC
Dylan DPC [Wed, 15 Apr 2020 22:39:27 +0000 (00:39 +0200)]
Rollup merge of #71166 - GuillaumeGomez:cleanup-e0518, r=Dylan-DPC

Clean up E0518 explanation

r? @Dylan-DPC

4 years agoRollup merge of #71145 - pfmooney:illumos-triple, r=nagisa
Dylan DPC [Wed, 15 Apr 2020 22:39:25 +0000 (00:39 +0200)]
Rollup merge of #71145 - pfmooney:illumos-triple, r=nagisa

Add illumos triple

This fixes rust-lang/rust#55553 and adds support for `illumos` as a `target_os` on `x86_64`.  In addition to the compile spec and libstd additions, several library dependencies have been bumped in order to permit working builds of cargo and rustup for the new target.

Work originally started by @jasonbking, with subsequent additions by @pfmooney and @jclulow.

4 years agoRollup merge of #70990 - GuillaumeGomez:rustdoc-cleanup, r=ollie27
Dylan DPC [Wed, 15 Apr 2020 22:39:24 +0000 (00:39 +0200)]
Rollup merge of #70990 - GuillaumeGomez:rustdoc-cleanup, r=ollie27

Improve rustdoc source code a bit

Very small clean up. I realized that there were too many nested conditions whereas we could just use `and_then`.

r? @kinnison

cc @ollie27

4 years agoRollup merge of #70774 - GuillaumeGomez:clean-rustdoc-js-tools, r=ollie27
Dylan DPC [Wed, 15 Apr 2020 22:39:22 +0000 (00:39 +0200)]
Rollup merge of #70774 - GuillaumeGomez:clean-rustdoc-js-tools, r=ollie27

End cleanup on rustdoc-js tools

Fixes #70689.

It removes a lot of code, which is pretty nice. :3

We now only have one entry point and a small set of options.

r? @ollie27

4 years agoRollup merge of #70354 - XAMPPRocky:master, r=Mark-Simulacrum
Dylan DPC [Wed, 15 Apr 2020 22:39:17 +0000 (00:39 +0200)]
Rollup merge of #70354 - XAMPPRocky:master, r=Mark-Simulacrum

Update RELEASES.md for 1.43.0

### [Rendered](https://github.com/XAMPPRocky/rust/blob/master/RELEASES.md)

r? @Mark-Simulacrum

cc @rust-lang/release

4 years agoRollup merge of #69903 - estebank:icemation, r=oli-obk
Dylan DPC [Wed, 15 Apr 2020 22:39:13 +0000 (00:39 +0200)]
Rollup merge of #69903 - estebank:icemation, r=oli-obk

Do not ICE in the face of invalid enum discriminant

Fix #67377.

r? @pnkfelix

4 years agoDo not ICE in the face of invalid enum discriminant
Esteban Küber [Tue, 10 Mar 2020 23:24:34 +0000 (16:24 -0700)]
Do not ICE in the face of invalid enum discriminant

4 years agoAuto merge of #71172 - pietroalbini:update-tool-maintainers, r=pietroalbini
bors [Wed, 15 Apr 2020 16:23:48 +0000 (16:23 +0000)]
Auto merge of #71172 - pietroalbini:update-tool-maintainers, r=pietroalbini

Update tool maintainers

Centril is taking a break from the project.

4 years agoupdate tool maintainers
Pietro Albini [Wed, 15 Apr 2020 16:19:02 +0000 (18:19 +0200)]
update tool maintainers

4 years agoClean up E0518 explanation
Guillaume Gomez [Wed, 15 Apr 2020 12:20:40 +0000 (14:20 +0200)]
Clean up E0518 explanation

4 years agoAuto merge of #71162 - Centril:rollup-jzg6ykc, r=Centril
bors [Wed, 15 Apr 2020 07:11:22 +0000 (07:11 +0000)]
Auto merge of #71162 - Centril:rollup-jzg6ykc, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #70891 (unit rvalue, use constant `()` instead of tuple)
 - #71030 (rustc_target: Refactor target specifications related to Windows and UEFI)
 - #71100 (Miri: expand frame hooks)
 - #71116 (Entirely remove `DUMMY_HIR_ID`)

Failed merges:

r? @ghost

4 years agoRollup merge of #71116 - marmeladema:dummy-hir-id-removal, r=eddyb
Mazdak Farrokhzad [Wed, 15 Apr 2020 07:10:05 +0000 (09:10 +0200)]
Rollup merge of #71116 - marmeladema:dummy-hir-id-removal, r=eddyb

Entirely remove `DUMMY_HIR_ID`

Some helpers functions have been introduced to deal with (buggy) cases
where either a `NodeId` or a `DefId` do not have a corresponding `HirId`.
Those cases are tracked in issue #71104.

4 years agoRollup merge of #71100 - RalfJung:miri-frame-hook, r=oli-obk
Mazdak Farrokhzad [Wed, 15 Apr 2020 07:10:03 +0000 (09:10 +0200)]
Rollup merge of #71100 - RalfJung:miri-frame-hook, r=oli-obk

Miri: expand frame hooks

This is needed to make https://github.com/rust-lang/miri/pull/1330 work.

r? @oli-obk @eddyb

4 years agoRollup merge of #71030 - petrochenkov:linkorder2, r=nagisa
Mazdak Farrokhzad [Wed, 15 Apr 2020 07:10:02 +0000 (09:10 +0200)]
Rollup merge of #71030 - petrochenkov:linkorder2, r=nagisa

rustc_target: Refactor target specifications related to Windows and UEFI

- LLD support is improved.
- Code is cleaned up.
- Target specs are organized in a more hierarchical way.
- Possible issues in UWP and UEFI platforms are identified (see FIXMEs).

The code is better read per-commit.

4 years agoRollup merge of #70891 - lcnr:replace-rvalue_aggregate, r=eddyb
Mazdak Farrokhzad [Wed, 15 Apr 2020 07:10:00 +0000 (09:10 +0200)]
Rollup merge of #70891 - lcnr:replace-rvalue_aggregate, r=eddyb

unit rvalue, use constant `()` instead of tuple

fixes #70886

r? @eddyb

4 years agoAuto merge of #71106 - jonas-schievink:remove-call-guard-pass, r=ecstatic-morse,RalfJung
bors [Wed, 15 Apr 2020 03:40:37 +0000 (03:40 +0000)]
Auto merge of #71106 - jonas-schievink:remove-call-guard-pass, r=ecstatic-morse,RalfJung

Don't always run `add_call_guards` pass

It is only needed when `add_retag` runs.

(the pass is run again to split critical edges before codegen, that one is required)

4 years agoUse fcntl() to set nonblock for solarish sockets
Patrick Mooney [Wed, 15 Apr 2020 00:44:06 +0000 (00:44 +0000)]
Use fcntl() to set nonblock for solarish sockets

The ioctl(FIONBIO) method of setting a file descriptor to be
non-blocking does not notify the underlying resource in the same way
that fcntl(F_SETFL, O_NONBLOCK) does on illumos and Solaris.

4 years agoAuto merge of #71151 - Dylan-DPC:rollup-6rt4h7b, r=Dylan-DPC
bors [Wed, 15 Apr 2020 00:39:22 +0000 (00:39 +0000)]
Auto merge of #71151 - Dylan-DPC:rollup-6rt4h7b, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #70657 (Allow `try`-blocks in places where an open delim is expected)
 - #70947 (tighten CTFE safety net for accesses to globals)
 - #70949 (simplify `vec!` macro)
 - #71002 (fix target & runtool args order)
 - #71082 (ptr: introduce len() method on raw slices)
 - #71128 (Remove unused single_step flag)
 - #71133 (Tighten time complexity on the doc of sort_by_key)
 - #71135 (Update books)

Failed merges:

r? @ghost

4 years agoRollup merge of #71135 - ehuss:update-books, r=ehuss
Dylan DPC [Tue, 14 Apr 2020 21:30:01 +0000 (23:30 +0200)]
Rollup merge of #71135 - ehuss:update-books, r=ehuss

Update books

## reference

13 commits in 89dd146154474559536d5d4049a03831c501deea..3ce94caed4cf967106c51ae86be5e098f7875f11
2020-03-31 09:42:10 -0700 to 2020-04-11 17:00:27 +0200
- UB definition: mention size_of_val for determining a reference's span (rust-lang-nursery/reference#793)
- Emphasize that `#[inline]` in all shapes is a hint. (rust-lang-nursery/reference#791)
- Added missing comma to Unions reference (rust-lang-nursery/reference#790)
- Attributes are now allowed on `if` and `if let` (rust-lang-nursery/reference#783)
- `enum`s can now be `#[repr(transparent)]` (rust-lang-nursery/reference#741)
- Undocument `use` paths. (rust-lang-nursery/reference#665)
- Clarify pub(restricted) a bit (rust-lang-nursery/reference#481)
- Add information about || and && to grammar describing `while let`. (rust-lang-nursery/reference#772)
- Document the `automatically_derived` attribute. (rust-lang-nursery/reference#555)
- Fix unstable check. (rust-lang-nursery/reference#743)
- Use common script for link checking. (rust-lang-nursery/reference#765)
- Add a basic style guide. (rust-lang-nursery/reference#787)
- Size fo empty structs in C is zero byte. (rust-lang-nursery/reference#782)

## book

14 commits in c8841f2841a2d26124319ddadd1b6a245f9a1856..f5db319e0b19c22964398d56bc63103d669e1bba
2020-03-22 09:07:01 -0500 to 2020-04-13 08:06:03 -0500
- Update ch01-01-installation.md to require TLS 1.2 (rust-lang/book#2301)
- traits as parameters: Use references instead of moving the values (rust-lang/book#2239)
- Fix a broken link
- Update go docs link (rust-lang/book#2285)
- Add the farsi translation repo link (rust-lang/book#2283)
- Add the missing word to the sentence (ch06-2) (rust-lang/book#2278)
- Fixes hardcoded output (rust-lang/book#2276)
- Use rust-lang/rust linkchecker on CI. (rust-lang/book#2272)
- Add union to the list of keywords (rust-lang/book#2271)
- Clarify the wording (rust-lang/book#2256)
- Improve sentence flow (rust-lang/book#2255)
- Add missing apostrophe (rust-lang/book#2247)
- Update cargo profiles link. (rust-lang/book#2245)
- Add note about chapter 18 in chapter 6 (rust-lang/book#2238)

## rust-by-example

1 commits in a6638463efc7631bc0e8dc67ccd256d4e1b61f1a..c106d1683c3a2b0960f0f0fb01728cbb19807332
2020-04-06 09:39:03 -0500 to 2020-04-09 09:14:39 -0300
- Improve the conversion example (rust-lang/rust-by-example#1329)

## edition-guide

1 commits in 37f9e6848411188a1062ead1bd8ebe4b8aa16899..8204c1d123472cd17f0c1c5c77300ae802eb0271
2020-02-10 14:36:14 +0100 to 2020-04-09 18:55:50 -0700
- Fix forge link. (rust-lang-nursery/edition-guide#200)

## embedded-book

1 commits in d22a9c487c78095afc4584f1d9b4ec43529d713c..668fb07b6160b9c468f598e839c1e044db65de30
2020-03-04 09:46:30 +0000 to 2020-04-13 12:38:16 +0000
- Add triagebot configuration  (rust-embedded/book#232)

4 years agoRollup merge of #71133 - MiSawa:fix-sort-by-key-doc, r=Dylan-DPC
Dylan DPC [Tue, 14 Apr 2020 21:29:59 +0000 (23:29 +0200)]
Rollup merge of #71133 - MiSawa:fix-sort-by-key-doc, r=Dylan-DPC

Tighten time complexity on the doc of sort_by_key

Fixes #71132

4 years agoRollup merge of #71128 - Mark-Simulacrum:clean-expansion, r=petrochenkov
Dylan DPC [Tue, 14 Apr 2020 21:29:58 +0000 (23:29 +0200)]
Rollup merge of #71128 - Mark-Simulacrum:clean-expansion, r=petrochenkov

Remove unused single_step flag

This appears to have never been used ever since its introduction in 61c7569d4 --
the plugin discussed on the PR introducing that commit, 34811, never
materialized.

It's also simple to re-add in the current scheme, but given that macro expansion
is already quite complicated, additional useless state seems good to remove
while we're not using it.

4 years agoRollup merge of #71082 - NeoRaider:ptr_slice_len, r=oli-obk,SimonSapin
Dylan DPC [Tue, 14 Apr 2020 21:29:56 +0000 (23:29 +0200)]
Rollup merge of #71082 - NeoRaider:ptr_slice_len, r=oli-obk,SimonSapin

ptr: introduce len() method on raw slices

It is already possible to extract the pointer part of a raw slice by a
simple cast, but retrieving the length is not possible without relying
on the representation of the raw slice when it is not valid to convert
the raw slice into a slice reference (i.e. the pointer is null or
unaligned).

~Introduce a new function ptr::slice_len() to add this missing feature.~

Introduce a len() method on raw slices to add this missing feature.

4 years agoRollup merge of #71002 - Freax13:fix-target, r=ollie27
Dylan DPC [Tue, 14 Apr 2020 21:29:55 +0000 (23:29 +0200)]
Rollup merge of #71002 - Freax13:fix-target, r=ollie27

fix target & runtool args order

- `TargetTripple::to_string` converts "path triples" to `<target>-<hash>`, but in this case we need the path. Afaict there is no method to get the real triple other than manually matching
- the order of the runtools arguments is inconsistent with the way tests usually pass arguments ie using `runner` key in `.cargo/config`

4 years agoRollup merge of #70949 - WaffleLapkin:simlify_vec_macro, r=petrochenkov
Dylan DPC [Tue, 14 Apr 2020 21:29:53 +0000 (23:29 +0200)]
Rollup merge of #70949 - WaffleLapkin:simlify_vec_macro, r=petrochenkov

simplify `vec!` macro

Simplify `vec!` macro by replacing 2 following branches:
- `($($x:expr),*) => (...)`
- `($($x:expr,)*) => (...)`
with one:
- `($($x:expr),* $(,)?) => (...)`

This is a minor change, however, this will make the documentation cleaner

4 years agoRollup merge of #70947 - RalfJung:ctfe-no-read-mut-global, r=oli-obk
Dylan DPC [Tue, 14 Apr 2020 21:29:52 +0000 (23:29 +0200)]
Rollup merge of #70947 - RalfJung:ctfe-no-read-mut-global, r=oli-obk

tighten CTFE safety net for accesses to globals

Previously, we only rejected reading from all statics. Now we also reject reading from any mutable global. Mutable globals are the true culprit here as their run-time value might be different from their compile-time values. Statics are just the approximation we use for that so far.

Also refactor the code a bit to make it clearer what is being checked and allowed.

r? @oli-obk

4 years agoRollup merge of #70657 - lcnr:unused_delims_try, r=Centril
Dylan DPC [Tue, 14 Apr 2020 21:29:50 +0000 (23:29 +0200)]
Rollup merge of #70657 - lcnr:unused_delims_try, r=Centril

Allow `try`-blocks in places where an open delim is expected

Closes #70490
Closes #56828

r? @Centril

4 years agoAuto merge of #70452 - eddyb:repeat-expr-correct-generics-parent, r=nikomatsakis
bors [Tue, 14 Apr 2020 21:23:40 +0000 (21:23 +0000)]
Auto merge of #70452 - eddyb:repeat-expr-correct-generics-parent, r=nikomatsakis

typeck: always expose repeat count `AnonConst`s' parent in `generics_of`.

This should reduce some of the confusion around #43408, although, if you look at the changed test outputs (for the last commit), they all hit #68436, so nothing new will start compiling.

We can let counts of "repeat expressions" (`N` in `[x; N]`) always have the correct generics parenting, because they're always in a body, so nothing in the `where` clauses or `impl` trait/type of the parent can use it, and therefore no query cycles can occur.

<hr/>

Other potential candidates we might want to apply the same approach to, are:
* ~~(easy) `enum` discriminants (see also #70453)~~ opened #70825
* (trickier) array *type* (not *expression*) lengths nested in:
  * bodies
  * types of (associated or not) `const`/`static`
  * RHS of `type` aliases and associated `type`s
  * `fn` signatures

We should've done so from the start, the only reason we haven't is because I was squeamish about blacklisting some of the cases, but if we whitelist instead we should be fine.
Also, lazy normalization is taking forever :disappointed:.

<hr/>

There's also 5 other commits here:
* "typeck: track any errors injected during writeback and taint tables appropriately." - fixes #66706, as the next commit would otherwise trigger an ICE again
* "typeck: workaround WF hole in `to_const`." - its purpose is to emulate most of #70107's direct effect, at least in the case of repeat expressions, where the count always goes through `to_const`
  * this is the reason no new code can really compile, as the WF checks require #68436 to bypass
  * however, this has more test changes than I hoped, so it should be reviewed separately, and maybe even landed separately (as #70107 might take a while, as it's blocked on a few of my PRs)
* "ty: erase lifetimes early in `ty::Const::eval`." - first attempt at fixing #70773
  * still useful, I believe the new approach is less likely to cause issues long-term
  * I could take this out or move it into another PR if desired or someone else could take over (cc @skinny121)
* "traits/query/normalize: add some `debug!` logging for the result." - debugging aid for #70773
* "borrow_check/type_check: normalize `Aggregate` and `Call` operands." - actually fixes #70773

r? @nikomatsakis cc @pnkfelix @varkor @yodaldevoid @oli-obk @estebank

4 years agoAdd illumos triple
Patrick Mooney [Mon, 13 Apr 2020 23:37:22 +0000 (23:37 +0000)]
Add illumos triple

Co-Authored-By: Jason King <jason.brian.king@gmail.com>
Co-Authored-By: Joshua M. Clulow <jmc@oxide.computer>
4 years agoptr: add tracking issue for len() method on raw slices
Matthias Schiffer [Tue, 14 Apr 2020 19:34:27 +0000 (21:34 +0200)]
ptr: add tracking issue for len() method on raw slices

4 years agoAuto merge of #71138 - ehuss:update-cargo, r=ehuss
bors [Tue, 14 Apr 2020 17:24:34 +0000 (17:24 +0000)]
Auto merge of #71138 - ehuss:update-cargo, r=ehuss

Update cargo

12 commits in 390e8f245ef2cd7ac698b8a76abf029f9abcab0d..74e3a7d5b756d7c0e94399fc29fcd154e792c22a
2020-04-07 17:46:45 +0000 to 2020-04-13 20:41:52 +0000
- Update dependencies to support illumos target (rust-lang/cargo#8093)
- Whitelist another known spurious curl error (rust-lang/cargo#8102)
- Fix nightly test matching rustc "warning" output. (rust-lang/cargo#8098)
- Update default for codegen-units. (rust-lang/cargo#8096)
- Fix freshness when linking is interrupted. (rust-lang/cargo#8087)
- Add `cargo tree` command. (rust-lang/cargo#8062)
- Add "build-finished" JSON message. (rust-lang/cargo#8069)
- Extend -Zpackage-features with more capabilities. (rust-lang/cargo#8074)
- Disallow invalid dependency names through crate renaming (rust-lang/cargo#8090)
- Use the same filename hash for pre-release channels. (rust-lang/cargo#8073)
- Index the commands section (rust-lang/cargo#8081)
- Upgrade to mdBook v0.3.7 (rust-lang/cargo#8083)

4 years agotypeck: always expose repeat count `AnonConst`s' parent in `generics_of`.
Eduard-Mihai Burtescu [Wed, 8 Apr 2020 16:47:09 +0000 (19:47 +0300)]
typeck: always expose repeat count `AnonConst`s' parent in `generics_of`.

4 years agoborrow_check/type_check: normalize `Aggregate` and `Call` operands.
Eduard-Mihai Burtescu [Sat, 4 Apr 2020 18:26:34 +0000 (21:26 +0300)]
borrow_check/type_check: normalize `Aggregate` and `Call` operands.

4 years agotraits/query/normalize: add some `debug!` logging for the result.
Eduard-Mihai Burtescu [Sat, 4 Apr 2020 18:23:38 +0000 (21:23 +0300)]
traits/query/normalize: add some `debug!` logging for the result.

4 years agoty: erase lifetimes early in `ty::Const::eval`.
Eduard-Mihai Burtescu [Sat, 4 Apr 2020 17:08:33 +0000 (20:08 +0300)]
ty: erase lifetimes early in `ty::Const::eval`.

4 years agoUpdate cargo
Eric Huss [Tue, 14 Apr 2020 16:50:52 +0000 (09:50 -0700)]
Update cargo

4 years agoptr: introduce len() method on raw slices
Matthias Schiffer [Mon, 13 Apr 2020 18:58:23 +0000 (20:58 +0200)]
ptr: introduce len() method on raw slices

It is already possible to extract the pointer part of a raw slice by a
simple cast, but retrieving the length is not possible without relying
on the representation of the raw slice when it is not valid to convert
the raw slice into a slice reference (i.e. the pointer is null or
unaligned).

Introduce a len() method on raw slices to add this missing feature.

4 years agoptr: implement "const_slice_ptr" and "mut_slice_ptr" lang items
Matthias Schiffer [Mon, 13 Apr 2020 18:57:35 +0000 (20:57 +0200)]
ptr: implement "const_slice_ptr" and "mut_slice_ptr" lang items

4 years agorustdoc: add "const_slice_ptr" and "mut_slice_ptr" trait impls
Matthias Schiffer [Mon, 13 Apr 2020 19:00:32 +0000 (21:00 +0200)]
rustdoc: add "const_slice_ptr" and "mut_slice_ptr" trait impls

4 years agorustc: add lang items "const_slice_ptr" and "mut_slice_ptr"
Matthias Schiffer [Mon, 13 Apr 2020 18:52:06 +0000 (20:52 +0200)]
rustc: add lang items "const_slice_ptr" and "mut_slice_ptr"

Add lang items for methods on raw slices.

4 years agoallow try as scrutinee, e.g. `match try ...`
Bastian Kauschke [Tue, 14 Apr 2020 15:45:00 +0000 (17:45 +0200)]
allow try as scrutinee, e.g. `match try ...`

4 years agotypeck: workaround WF hole in `to_const`.
Eduard-Mihai Burtescu [Thu, 26 Mar 2020 23:46:24 +0000 (01:46 +0200)]
typeck: workaround WF hole in `to_const`.

4 years agotypeck: track any errors injected during writeback and taint tables appropriately.
Eduard-Mihai Burtescu [Fri, 27 Mar 2020 08:56:02 +0000 (10:56 +0200)]
typeck: track any errors injected during writeback and taint tables appropriately.

4 years agocleanup `is_expr_delims_necessary`
Bastian Kauschke [Tue, 14 Apr 2020 15:29:26 +0000 (17:29 +0200)]
cleanup `is_expr_delims_necessary`

4 years agoUpdate books
Eric Huss [Tue, 14 Apr 2020 15:54:05 +0000 (08:54 -0700)]
Update books

4 years agoTighten time complexity on the doc
mi_sawa [Tue, 14 Apr 2020 14:51:03 +0000 (23:51 +0900)]
Tighten time complexity on the doc

4 years agoRemove unused single_step flag
Mark Rousskov [Mon, 13 Apr 2020 02:01:15 +0000 (22:01 -0400)]
Remove unused single_step flag

This appears to have never been used ever since its introduction in 61c7569d4 --
the plugin discussed on the PR introducing that commit, 34811, never
materialized.

It's also simple to readd in the current scheme, but given that macro expansion
is already quite complicated, additional useless state seems good to remove
while we're not using it.

4 years agoAuto merge of #71125 - Dylan-DPC:rollup-3b8prjh, r=Dylan-DPC
bors [Tue, 14 Apr 2020 14:14:47 +0000 (14:14 +0000)]
Auto merge of #71125 - Dylan-DPC:rollup-3b8prjh, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #71112 (Remove the last remnant of unsigned Neg)
 - #71120 (Clean up E0517 explanation)
 - #71121 (Fix broken link in documentation for String::from_utf8)
 - #71122 (update `FnCtxt::lookup_method` docs)
 - #71124 (Add missing comma)

Failed merges:

r? @ghost

4 years agoRollup merge of #71124 - JOE1994:patch-3, r=Dylan-DPC
Dylan DPC [Tue, 14 Apr 2020 13:35:35 +0000 (15:35 +0200)]
Rollup merge of #71124 - JOE1994:patch-3, r=Dylan-DPC

Add missing comma

Added missing comma in doc comment

4 years agoRollup merge of #71122 - lcnr:update-docs, r=Mark-Simulacrum
Dylan DPC [Tue, 14 Apr 2020 13:35:33 +0000 (15:35 +0200)]
Rollup merge of #71122 - lcnr:update-docs, r=Mark-Simulacrum

update `FnCtxt::lookup_method` docs

Looks like the doc comment was forgotten during a refactor.

4 years agoRollup merge of #71121 - AnthonyMikh:fix_string_doc_link, r=Dylan-DPC
Dylan DPC [Tue, 14 Apr 2020 13:35:32 +0000 (15:35 +0200)]
Rollup merge of #71121 - AnthonyMikh:fix_string_doc_link, r=Dylan-DPC

Fix broken link in documentation for String::from_utf8

4 years agoRollup merge of #71120 - GuillaumeGomez:cleanup-e0517, r=Dylan-DPC
Dylan DPC [Tue, 14 Apr 2020 13:35:30 +0000 (15:35 +0200)]
Rollup merge of #71120 - GuillaumeGomez:cleanup-e0517, r=Dylan-DPC

Clean up E0517 explanation

r? @Dylan-DPC

4 years agoRollup merge of #71112 - cuviper:unsigned-Neg, r=Mark-Simulacrum
Dylan DPC [Tue, 14 Apr 2020 13:35:28 +0000 (15:35 +0200)]
Rollup merge of #71112 - cuviper:unsigned-Neg, r=Mark-Simulacrum

Remove the last remnant of unsigned Neg

It's been gone since #23945, before Rust 1.0. The former wrapping
semantics have also been available as inherent methods for a long time
now. There's no reason to keep this unused macro around.

4 years agoAdd missing comma
Youngsuk Kim [Tue, 14 Apr 2020 13:29:39 +0000 (09:29 -0400)]
Add missing comma

4 years agoupdate docs
Bastian Kauschke [Tue, 14 Apr 2020 12:45:34 +0000 (14:45 +0200)]
update docs

4 years agoFix broken link in documentation for String::from_utf8
AnthonyMikh [Tue, 14 Apr 2020 12:07:57 +0000 (15:07 +0300)]
Fix broken link in documentation for String::from_utf8

4 years agoImprove rustdoc js testers code
Guillaume Gomez [Sat, 11 Apr 2020 15:42:47 +0000 (17:42 +0200)]
Improve rustdoc js testers code

4 years agoClean up E0517 explanation
Guillaume Gomez [Tue, 14 Apr 2020 11:26:17 +0000 (13:26 +0200)]
Clean up E0517 explanation

4 years agoAuto merge of #70893 - tmiasko:llvm-sanitizers, r=cuviper
bors [Tue, 14 Apr 2020 10:04:47 +0000 (10:04 +0000)]
Auto merge of #70893 - tmiasko:llvm-sanitizers, r=cuviper

Update LLVM submodule fixing sanitizers build with glibc 2.31

Fixes #69556.

4 years agoRemove `DUMMY_HIR_ID`
marmeladema [Mon, 13 Apr 2020 16:52:40 +0000 (17:52 +0100)]
Remove `DUMMY_HIR_ID`

4 years agoDo not use `DUMMY_HIR_ID` as placeholder value in node_id_to_hir_id table
marmeladema [Mon, 13 Apr 2020 16:40:06 +0000 (17:40 +0100)]
Do not use `DUMMY_HIR_ID` as placeholder value in node_id_to_hir_id table

Some helpers functions have been introduced to deal with (buggy) cases
where either a `NodeId` or a `DefId` do not have a corresponding `HirId`.
Those cases are tracked in issue #71104.

4 years agomake `vec![,]` uncompilable
Waffle [Tue, 14 Apr 2020 07:27:55 +0000 (10:27 +0300)]
make `vec![,]` uncompilable

Fix regression introduced in commit #3ae2d21

4 years agoupdate 32 bit mir-opt tests
Bastian Kauschke [Tue, 14 Apr 2020 07:14:58 +0000 (09:14 +0200)]
update 32 bit mir-opt tests

4 years agoAuto merge of #70679 - tmandry:issue-68112, r=nikomatsakis
bors [Tue, 14 Apr 2020 06:47:38 +0000 (06:47 +0000)]
Auto merge of #70679 - tmandry:issue-68112, r=nikomatsakis

Improve async-await/generator obligation errors in some cases

Fixes #68112.

This change is best read one commit at a time (I add a test at the beginning and update it in each change after).

The `test2` function is a case I found while writing the test that we don't handle with this code yet. I don't attempt to fix it in this PR, but it's a good candidate for future work.

r? @davidtwco, @nikomatsakis

4 years agoAuto merge of #70643 - Rustin-Liu:rustin-patch-rename, r=eddyb
bors [Tue, 14 Apr 2020 03:11:12 +0000 (03:11 +0000)]
Auto merge of #70643 - Rustin-Liu:rustin-patch-rename, r=eddyb

Rename AssocKind::Method to AssocKind::Fn

Part of https://github.com/rust-lang/rust/issues/60163.

https://github.com/rust-lang/rust/issues/60163#issuecomment-607284413

4 years agoUpdate test after rebase
Tyler Mandry [Tue, 14 Apr 2020 02:14:26 +0000 (19:14 -0700)]
Update test after rebase

4 years agoIncorporate feedback into diagnostics
Tyler Mandry [Wed, 8 Apr 2020 18:54:31 +0000 (11:54 -0700)]
Incorporate feedback into diagnostics

4 years agoFix style nits
Tyler Mandry [Wed, 8 Apr 2020 01:50:27 +0000 (18:50 -0700)]
Fix style nits

4 years agoInclude type info when available for awaited expr
Tyler Mandry [Thu, 2 Apr 2020 02:54:11 +0000 (19:54 -0700)]
Include type info when available for awaited expr

4 years agorustfmt
Tyler Mandry [Thu, 2 Apr 2020 02:14:51 +0000 (19:14 -0700)]
rustfmt

4 years agoDon't double-annotate the same Span
Tyler Mandry [Thu, 2 Apr 2020 02:04:55 +0000 (19:04 -0700)]
Don't double-annotate the same Span

4 years agoUse clearer message when obligation is caused by await expr
Tyler Mandry [Thu, 2 Apr 2020 01:53:00 +0000 (18:53 -0700)]
Use clearer message when obligation is caused by await expr

4 years agoUse "generator" instead of "future" when appropriate
Tyler Mandry [Wed, 25 Mar 2020 04:13:05 +0000 (21:13 -0700)]
Use "generator" instead of "future" when appropriate

4 years agoDon't annotate type when type is opaque
Tyler Mandry [Wed, 25 Mar 2020 02:25:40 +0000 (19:25 -0700)]
Don't annotate type when type is opaque

4 years agoImprove span label
Tyler Mandry [Wed, 25 Mar 2020 01:51:16 +0000 (18:51 -0700)]
Improve span label

4 years agoAdd test for #68112 (existing output)
Tyler Mandry [Wed, 25 Mar 2020 00:23:50 +0000 (17:23 -0700)]
Add test for #68112 (existing output)

4 years agoUse inner/outer generator naming instead of first/last
Tyler Mandry [Wed, 25 Mar 2020 00:06:40 +0000 (17:06 -0700)]
Use inner/outer generator naming instead of first/last

I personally find this clearer.

4 years agoRemove the last remnant of unsigned Neg
Josh Stone [Tue, 14 Apr 2020 01:37:06 +0000 (18:37 -0700)]
Remove the last remnant of unsigned Neg

It's been gone since #23945, before Rust 1.0. The former wrapping
semantics have also been available as inherent methods for a long time
now. There's no reason to keep this unused macro around.

4 years agoAuto merge of #71111 - Dylan-DPC:rollup-esp17qn, r=Dylan-DPC
bors [Mon, 13 Apr 2020 23:54:52 +0000 (23:54 +0000)]
Auto merge of #71111 - Dylan-DPC:rollup-esp17qn, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #70654 (Explain how to work with subtree)
 - #71092 (Remove some usage of `DUMMY_HIR_ID`)
 - #71103 (Add test case for type aliasing `impl Sized`)
 - #71109 (allow const generics in const fn)

Failed merges:

r? @ghost

4 years agoRollup merge of #71109 - lcnr:generics_in_const_fn, r=eddyb
Dylan DPC [Mon, 13 Apr 2020 23:24:18 +0000 (01:24 +0200)]
Rollup merge of #71109 - lcnr:generics_in_const_fn, r=eddyb

allow const generics in const fn

This was explicitly forbidden before. As we were unable to think of a reason
why this should still be the case, this check has been removed.

r? @eddyb
cc @varkor @Centril

4 years agoRollup merge of #71103 - samrat:tait-sized, r=estebank
Dylan DPC [Mon, 13 Apr 2020 23:24:16 +0000 (01:24 +0200)]
Rollup merge of #71103 - samrat:tait-sized, r=estebank

Add test case for type aliasing `impl Sized`

Fixes #71085

4 years agoRollup merge of #71092 - marmeladema:dummy-hir-id-removal, r=eddyb
Dylan DPC [Mon, 13 Apr 2020 23:24:15 +0000 (01:24 +0200)]
Rollup merge of #71092 - marmeladema:dummy-hir-id-removal, r=eddyb

Remove some usage of `DUMMY_HIR_ID`

4 years agoRollup merge of #70654 - oli-obk:subrepo_docs, r=Mark-Simulacrum
Dylan DPC [Mon, 13 Apr 2020 23:24:13 +0000 (01:24 +0200)]
Rollup merge of #70654 - oli-obk:subrepo_docs, r=Mark-Simulacrum

Explain how to work with subtree

cc #70651

r? @centril @RalfJung

This PR just contains the usage documentation, we'll do actual moves in later PRs

4 years agoRename AssocKind::Method to AssocKind::Fn
Rustin-Liu [Wed, 1 Apr 2020 02:09:50 +0000 (10:09 +0800)]
Rename AssocKind::Method to AssocKind::Fn

Rename fn_has_self_argument to fn_has_self_parameter

Rename AssocItemKind::Method to AssocItemKind::Fn

Refine has_no_input_arg

Refine has_no_input_arg

Revert has_no_input_arg

Refine suggestion_descr

Move as_def_kind into AssocKind

Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
Fix tidy check issue

Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
4 years agobless mir opt tests
Bastian Kauschke [Thu, 9 Apr 2020 10:58:36 +0000 (12:58 +0200)]
bless mir opt tests

4 years agounit rvalue: use constant `()` instead of tuple
Bastian Kauschke [Thu, 9 Apr 2020 10:24:53 +0000 (12:24 +0200)]
unit rvalue: use constant `()` instead of tuple

4 years agoallow const generics in const fn
Bastian Kauschke [Mon, 13 Apr 2020 20:32:40 +0000 (22:32 +0200)]
allow const generics in const fn

4 years agoAuto merge of #71105 - Dylan-DPC:rollup-nezezxr, r=Dylan-DPC
bors [Mon, 13 Apr 2020 19:47:23 +0000 (19:47 +0000)]
Auto merge of #71105 - Dylan-DPC:rollup-nezezxr, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #70656 (Improve scrollbar display in rustdoc)
 - #71051 (Suggest .into() over try_into() when it would work)
 - #71087 (Remove `FnCtxt::impl_self_ty`)
 - #71097 (Pattern docs)
 - #71101 (Miri: let machine hook dynamically decide about alignment checks)

Failed merges:

r? @ghost

4 years agoRollup merge of #71101 - RalfJung:miri-alignment-check, r=ecstatic-morse
Dylan DPC [Mon, 13 Apr 2020 18:23:33 +0000 (20:23 +0200)]
Rollup merge of #71101 - RalfJung:miri-alignment-check, r=ecstatic-morse

Miri: let machine hook dynamically decide about alignment checks

This is needed for https://github.com/rust-lang/miri/pull/1332.

4 years agoRollup merge of #71097 - pickfire:pattern-docs, r=Dylan-DPC
Dylan DPC [Mon, 13 Apr 2020 18:23:32 +0000 (20:23 +0200)]
Rollup merge of #71097 - pickfire:pattern-docs, r=Dylan-DPC

Pattern docs

https://doc.rust-lang.org/std/str/pattern/trait.Pattern.html#implementors

4 years agoRollup merge of #71087 - JohnTitor:impl-self-ty, r=eddyb
Dylan DPC [Mon, 13 Apr 2020 18:23:30 +0000 (20:23 +0200)]
Rollup merge of #71087 - JohnTitor:impl-self-ty, r=eddyb

Remove `FnCtxt::impl_self_ty`

Fixes #69489
r? @eddyb cc @Centril

4 years agoRollup merge of #71051 - ryr3:fix_try_into, r=estebank
Dylan DPC [Mon, 13 Apr 2020 18:23:29 +0000 (20:23 +0200)]
Rollup merge of #71051 - ryr3:fix_try_into, r=estebank

Suggest .into() over try_into() when it would work

It would be better to suggest x.into() instead, which is shorter, cannot fail, and doesn't require importing a trait.
Tests have been added and made up to date.
Fixes #70851

4 years agoRollup merge of #70656 - GuillaumeGomez:scrollbar-display, r=kinnison
Dylan DPC [Mon, 13 Apr 2020 18:23:27 +0000 (20:23 +0200)]
Rollup merge of #70656 - GuillaumeGomez:scrollbar-display, r=kinnison

Improve scrollbar display in rustdoc

The scrollbar of the left sidebar in rustdoc looks very bad on firefox (on dark theme). This PR improves it:

<div style="display:inline-block;">
<div style="width:50%;display:inline-block;float:left;">
<image src="https://user-images.githubusercontent.com/3050060/78148412-202b0380-7435-11ea-8ff3-79f02ea8f9ed.png">
</div>
<div style="width:50%;display:inline-block;float:left;">
<image src="https://user-images.githubusercontent.com/3050060/78148437-28833e80-7435-11ea-946b-a6fc9320b705.png">
</div>
</div>

With light theme:

![old-firefox-light](https://user-images.githubusercontent.com/3050060/78148718-7bf58c80-7435-11ea-93d3-2a2cafd5c6ae.png)
![firefox-light](https://user-images.githubusercontent.com/3050060/78148736-7f891380-7435-11ea-8b10-a8898f73b4c9.png)

And on chrome:

![chrome-light](https://user-images.githubusercontent.com/3050060/78148903-ac3d2b00-7435-11ea-9a10-6c0376a675c3.png)
![chrome-dark](https://user-images.githubusercontent.com/3050060/78148907-ae9f8500-7435-11ea-9b89-0397b977753c.png)

Small extra question: should I extend it to all scrollbars? I think it'd be better but just in case...

r? @kinnison

4 years agoDon't always run `add_call_guards` pass
Jonas Schievink [Mon, 13 Apr 2020 18:22:45 +0000 (20:22 +0200)]
Don't always run `add_call_guards` pass

4 years agoRemove usage of `DUMMY_HIR_ID` in `FnCtxt::get_conversion_methods`
marmeladema [Mon, 13 Apr 2020 16:57:39 +0000 (17:57 +0100)]
Remove usage of `DUMMY_HIR_ID` in `FnCtxt::get_conversion_methods`

4 years agoAdd test case for type aliasing `impl Sized`
Samrat Man Singh [Mon, 13 Apr 2020 16:44:08 +0000 (22:14 +0530)]
Add test case for type aliasing `impl Sized`

4 years agoAuto merge of #70989 - eddyb:mir-opt-32-pr-ci, r=Mark-Simulacrum
bors [Mon, 13 Apr 2020 16:28:57 +0000 (16:28 +0000)]
Auto merge of #70989 - eddyb:mir-opt-32-pr-ci, r=Mark-Simulacrum

 ci: run mir-opt tests on PR CI also as 32-bit (for `EMIT_MIR_FOR_EACH_BIT_WIDTH`).

Background: #69916 and [`src/test/mir-opt/README.md`](https://github.com/rust-lang/rust/blob/master/src/test/mir-opt/README.md):
> By default 32 bit and 64 bit targets use the same dump files, which can be problematic in the
presence of pointers in constants or other bit width dependent things. In that case you can add
>
> ```
> // EMIT_MIR_FOR_EACH_BIT_WIDTH
> ```
>
> to your test, causing separate files to be generated for 32bit and 64bit systems.

However, if you change the output of such a test (intentionally or not), or if you add a test and it varies between 32-bit and 64-bit platforms, you have to run this command (for a x64 linux host):
`./x.py test --stage 1 --target x86_64-unknown-linux-gnu --target i686-unknown-linux-gnu --bless  src/test/mir-opt`

Otherwise, bors trying to merge the PR will fail, since we test 32-bit targets there.
But we don't on PR CI, which means there's no way the PR author would know (unless they were burnt by this already and know what to look for).

This PR resolves that by running `mir-opt` tests for ~~`i686-unknown-linux-gnu`~~, on PR CI.
**EDIT**: switched to `armv5te-unknown-linux-gnueabi` to work around LLVM 7 crashes (see https://github.com/rust-lang/compiler-builtins/pull/311#issuecomment-612270089), found during testing.

cc @rust-lang/wg-mir-opt @rust-lang/infra

4 years agofmt
Ralf Jung [Mon, 13 Apr 2020 16:05:05 +0000 (18:05 +0200)]
fmt

4 years agoMiri: let machine hook dynamically decide about alignment checks
Ralf Jung [Mon, 13 Apr 2020 15:59:12 +0000 (17:59 +0200)]
Miri: let machine hook dynamically decide about alignment checks

4 years agoAddress review comments
Vadim Petrochenkov [Sun, 12 Apr 2020 20:36:37 +0000 (23:36 +0300)]
Address review comments

4 years agorustc_target: Introduce `msvc_base`
Vadim Petrochenkov [Sat, 11 Apr 2020 14:30:09 +0000 (17:30 +0300)]
rustc_target: Introduce `msvc_base`

and inherit both `windows_msvc_base` and `uefi_msvc_base` from it.