]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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 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 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 agoUse `CRATE_HIR_ID` instead of `DUMMY_HIR_ID` when appropriate.
marmeladema [Mon, 13 Apr 2020 10:09:25 +0000 (11:09 +0100)]
Use `CRATE_HIR_ID` instead of `DUMMY_HIR_ID` when appropriate.

Those usage ends up forwarded to a `ObligationClause` which uses
`CRATE_HIR_ID` for dummy value as seen in `ObligationClause::dummy`.

4 years agoAdd examples to Pattern docs
Ivan Tham [Mon, 13 Apr 2020 14:25:15 +0000 (22:25 +0800)]
Add examples to Pattern docs

4 years agoAdd period to Pattern docs
Ivan Tham [Mon, 13 Apr 2020 14:24:58 +0000 (22:24 +0800)]
Add period to Pattern docs

4 years agoAuto merge of #70961 - ecstatic-morse:into-def-id, r=eddyb
bors [Mon, 13 Apr 2020 12:50:43 +0000 (12:50 +0000)]
Auto merge of #70961 - ecstatic-morse:into-def-id, r=eddyb

Take `impl Into<DefId>` for query methods on `TyCtxt`

Alternative implementation of #70956. cc #70853.

4 years agoJust `unwrap()` instead of `unwrap_or(DUMMY_HIR_ID)`.
marmeladema [Sun, 12 Apr 2020 21:49:34 +0000 (22:49 +0100)]
Just `unwrap()` instead of `unwrap_or(DUMMY_HIR_ID)`.

A valid hir id should always be returned in this case.

4 years agoRemove usage of `DUMMY_HIR_ID` in some visitors
marmeladema [Mon, 13 Apr 2020 10:12:57 +0000 (11:12 +0100)]
Remove usage of `DUMMY_HIR_ID` in some visitors

4 years agoRemove useless calls to `assemble_extension_candidates_for_traits_in_scope`
marmeladema [Sun, 12 Apr 2020 20:22:30 +0000 (21:22 +0100)]
Remove useless calls to `assemble_extension_candidates_for_traits_in_scope`

Calls to `assemble_extension_candidates_for_traits_in_scope` with
`DUMMY_HIR_ID` as `expr_hir_id` are useless because the first thing
that this function does is to return `Ok(())` in this case.

4 years agoAuto merge of #70882 - tmiasko:llvm-version-suffix, r=Mark-Simulacrum
bors [Mon, 13 Apr 2020 07:34:11 +0000 (07:34 +0000)]
Auto merge of #70882 - tmiasko:llvm-version-suffix, r=Mark-Simulacrum

Make LLVM version suffix independent of rustc version on dev channel

Remove rustc version from LLVM version suffix on dev channel,
avoiding the need for full rebuilds when switching between
branches with different LLVM submodule & rustc version.

Note: To avoid full rebuild, on subsequent LLVM submodule update, copy the
current value of `LLVM_VERSION_SUFFIX` from `build/*/llvm/build/CMakeCache.txt`,
to `version-suffix` in `config.toml`.

4 years agoAuto merge of #71056 - matthiaskrgr:submodule_upd, r=Dylan-DPC
bors [Mon, 13 Apr 2020 04:16:08 +0000 (04:16 +0000)]
Auto merge of #71056 - matthiaskrgr:submodule_upd, r=Dylan-DPC

submodules: update clippy from d342cee7 to af5940b7

Changes:
````
Allow UUID style formatting for `inconsistent_digit_grouping` lint
rustup https://github.com/rust-lang/rust/pull/70986
rustup https://github.com/rust-lang/rust/pull/69745
Rustup to https://github.com/rust-lang/rust/pull/70913
compare with the second largest instead of the smallest variant
Revert "Downgrade new_ret_no_self to pedantic"
Check for clone-on-copy in argument positions
Check fn header along with decl when suggesting to implement trait
Downgrade implicit_hasher to pedantic
Move cognitive_complexity to nursery
Run fmt and update test
Use int assoc consts in MANUAL_SATURATING_ARITHMETIC
Use int assoc consts in checked_conversions lint
Use primitive type assoc consts in more tests
Use integer assoc consts in more lint example code
Don't import primitive type modules
Use assoc const NAN for zero_div_zero lint
Fix float cmp to use assoc fxx::EPSILON
Fix NAN comparison lint to use assoc NAN
Refine lint message.
Lint on opt.as_ref().map(|x| &**x).
Include OpAssign in suspicious_op_assign_impl
result_map_or_into_option: fix syntax error in example
result_map_or_into: fix dogfood_clippy error => {h,l}int
CONTRIBUTING.md: fix broken triage link
result_map_or_into_option: fix `cargo dev fmt --check` errors
result_map_or_into_option: move arg checks into tuple assignment
result_map_or_into_option: add `opt.map_or(None, |_| Some(y))` test
result_map_or_into_option: destructure lint tuple or return early
result_map_or_into_option: add good and bad examples
result_map_or_into_option: explicitly note absence of known problems
Downgrade new_ret_no_self to pedantic
Downgrade unreadable_literal to pedantic
Update CONTRIBUTING.md
Rename rustc -> rustc_middle in doc links
result_map_or_into_option: add lint to catch manually adpating Result -> Option
Move matches test in matches module
Run update_lints
Make lint modules private
Don't filter lints in code generation functions
Build lint lists once and the reuse them to update files
Get rid of Lint::is_internal method
Clean up update_lints
Downgrade inefficient_to_string to pedantic
Downgrade trivially_copy_pass_by_ref to pedantic
Downgrade let_unit_value to pedantic
````
Fixes #70993

r? @Dylan-DPC

4 years agoRemove `FnCtxt::impl_self_ty`
Yuki Okushi [Mon, 13 Apr 2020 02:36:37 +0000 (11:36 +0900)]
Remove `FnCtxt::impl_self_ty`

4 years agoAuto merge of #71023 - mati865:mingw-unwind-linking-cleanup, r=Amanieu
bors [Mon, 13 Apr 2020 00:59:36 +0000 (00:59 +0000)]
Auto merge of #71023 - mati865:mingw-unwind-linking-cleanup, r=Amanieu

[windows] Add testscase for self-contained executables and fix pthread linking

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

4 years agoAuto merge of #71079 - Dylan-DPC:rollup-g7yh3sn, r=Dylan-DPC
bors [Sun, 12 Apr 2020 21:48:24 +0000 (21:48 +0000)]
Auto merge of #71079 - Dylan-DPC:rollup-g7yh3sn, r=Dylan-DPC

Rollup of 4 pull requests

Successful merges:

 - #67766 (Fix warning for unused variables in or pattern (issue #67691))
 - #71013 (Pass the `PlaceElem::Index` local to `visit_local`)
 - #71064 (fix issue 69130)
 - #71069 (Remove some usage of `DUMMY_HIR_ID`)

Failed merges:

r? @ghost

4 years agoRollup merge of #71069 - marmeladema:dummy-hir-id-obligation-clause, r=eddyb
Dylan DPC [Sun, 12 Apr 2020 21:47:41 +0000 (23:47 +0200)]
Rollup merge of #71069 - marmeladema:dummy-hir-id-obligation-clause, r=eddyb

Remove some usage of `DUMMY_HIR_ID`

Use `ObligationClause::dummy()` when appropriate or replace `hir::DUMMY_HIR_ID`by `hir::CRATE_HIR_ID`, as used in `ObligationClause::dummy()`.

4 years agoRollup merge of #71064 - dwrensha:issue-69130, r=eddyb
Dylan DPC [Sun, 12 Apr 2020 21:47:39 +0000 (23:47 +0200)]
Rollup merge of #71064 - dwrensha:issue-69130, r=eddyb

fix issue 69130

Closes #69130.

4 years agoRollup merge of #71013 - jonas-schievink:visit-projection, r=eddyb
Dylan DPC [Sun, 12 Apr 2020 21:47:38 +0000 (23:47 +0200)]
Rollup merge of #71013 - jonas-schievink:visit-projection, r=eddyb

Pass the `PlaceElem::Index` local to `visit_local`

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

cc @rust-lang/wg-mir-opt

r? @spastorino

4 years agoRollup merge of #67766 - sapir:fix-unused-in-or-pattern-warning, r=matthewjasper
Dylan DPC [Sun, 12 Apr 2020 21:47:36 +0000 (23:47 +0200)]
Rollup merge of #67766 - sapir:fix-unused-in-or-pattern-warning, r=matthewjasper

Fix warning for unused variables in or pattern (issue #67691)

Is this a good way to fix it?

Also, the tests fail, the "fixed" code output says `{ i, j }` instead of `{ i, j: _ }`, how can I fix that?

4 years agoRemove usage of `DUMMY_HIR_ID` in `Scope::hir_id`
marmeladema [Sun, 12 Apr 2020 19:59:13 +0000 (20:59 +0100)]
Remove usage of `DUMMY_HIR_ID` in `Scope::hir_id`

4 years agoRemove usage of `DUMMY_HIR_ID` in `CheckAttrVisitor::check_inline`
marmeladema [Sun, 12 Apr 2020 19:57:43 +0000 (20:57 +0100)]
Remove usage of `DUMMY_HIR_ID` in `CheckAttrVisitor::check_inline`

4 years agoRemove usage of `DUMMY_HIR_ID` in `CheckLoopVisitor`
marmeladema [Sun, 12 Apr 2020 18:20:07 +0000 (19:20 +0100)]
Remove usage of `DUMMY_HIR_ID` in `CheckLoopVisitor`

4 years agoRemove usage of `DUMMY_HIR_ID` in calls to `ObligationClause::misc`
marmeladema [Sun, 12 Apr 2020 17:42:45 +0000 (18:42 +0100)]
Remove usage of `DUMMY_HIR_ID` in calls to `ObligationClause::misc`

Use `ObligationClause::dummy()` when appropriate or replace
`hir::DUMMY_HIR_ID` by `hir::CRATE_HIR_ID`, as used in
`ObligationClause::dummy()`.

4 years ago[windows-gnu] Link pthread statically
Mateusz Mikuła [Sun, 12 Apr 2020 16:11:11 +0000 (18:11 +0200)]
[windows-gnu] Link pthread statically

4 years agoAuto merge of #71059 - Dylan-DPC:rollup-zgu6jmx, r=Dylan-DPC
bors [Sun, 12 Apr 2020 18:09:46 +0000 (18:09 +0000)]
Auto merge of #71059 - Dylan-DPC:rollup-zgu6jmx, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #71029 (Partial work on building with Cargo)
 - #71034 (Clean up E0515 explanation)
 - #71041 (Update links of `rustc guide`)
 - #71048 (Normalize source when loading external foreign source into SourceMap)
 - #71053 (Add some basic docs to `sym` and `kw` modules)
 - #71057 (Clean up E0516 explanation)

Failed merges:

r? @ghost

4 years agofix issue 69130
David Renshaw [Sun, 12 Apr 2020 15:36:37 +0000 (11:36 -0400)]
fix issue 69130

4 years agoRollup merge of #71057 - GuillaumeGomez:cleanup-e0516, r=Dylan-DPC
Dylan DPC [Sun, 12 Apr 2020 12:49:10 +0000 (14:49 +0200)]
Rollup merge of #71057 - GuillaumeGomez:cleanup-e0516, r=Dylan-DPC

Clean up E0516 explanation

r? @Dylan-DPC

4 years agoRollup merge of #71053 - phansch:update_kw_sym_docs, r=Dylan-DPC
Dylan DPC [Sun, 12 Apr 2020 12:49:08 +0000 (14:49 +0200)]
Rollup merge of #71053 - phansch:update_kw_sym_docs, r=Dylan-DPC

Add some basic docs to `sym` and `kw` modules

I was looking into improving some Clippy documentation but was missing a
place that explains the `kw` and `sym` modules from rustc.

This adds some very basic usage documentation to these modules.

4 years agoRollup merge of #71048 - arlosi:normalize_ext_src, r=eddyb
Dylan DPC [Sun, 12 Apr 2020 12:49:06 +0000 (14:49 +0200)]
Rollup merge of #71048 - arlosi:normalize_ext_src, r=eddyb

Normalize source when loading external foreign source into SourceMap

The compiler normalizes source when reading files initially (removes BOMs, etc), but not when loading external sources.

This leads to the external source matching according to the `src_hash`, but differing internally because it was not normalized.

Fixes #70874.

4 years agoRollup merge of #71041 - JohnTitor:rustc-dev-guide, r=jonas-schievink
Dylan DPC [Sun, 12 Apr 2020 12:49:05 +0000 (14:49 +0200)]
Rollup merge of #71041 - JohnTitor:rustc-dev-guide, r=jonas-schievink

Update links of `rustc guide`

Picks up the things we left behind in the transition, hopefully they're last ones.

r? @spastorino

4 years agoRollup merge of #71034 - GuillaumeGomez:cleanup-e0515, r=Dylan-DPC
Dylan DPC [Sun, 12 Apr 2020 12:49:03 +0000 (14:49 +0200)]
Rollup merge of #71034 - GuillaumeGomez:cleanup-e0515, r=Dylan-DPC

Clean up E0515 explanation

r? @Dylan-DPC