]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoUpdate books
Eric Huss [Tue, 17 Mar 2020 02:09:54 +0000 (19:09 -0700)]
Update books

4 years agoAuto merge of #68970 - matthewjasper:min-spec, r=nikomatsakis
bors [Mon, 16 Mar 2020 20:49:26 +0000 (20:49 +0000)]
Auto merge of #68970 - matthewjasper:min-spec, r=nikomatsakis

Implement a feature for a sound specialization subset

This implements a new feature (`min_specialization`) that restricts specialization to a subset that is reasonable for the standard library to use.

The plan is to then:

* Update `libcore` and `liballoc` to compile with `min_specialization`.
* Add a lint to forbid use of `feature(specialization)` (and other unsound, type system extending features) in the standard library.
* Fix the soundness issues around `specialization`.
* Remove `min_specialization`

The rest of this is an overview from a comment in this PR

## Basic approach

To enforce this requirement on specializations we take the following approach:
1. Match up the substs for `impl2` so that the implemented trait and self-type match those for `impl1`.
2. Check for any direct use of `'static` in the substs of `impl2`.
3. Check that all of the generic parameters of `impl1` occur at most once in the *unconstrained* substs for `impl2`. A parameter is constrained if its value is completely determined by an associated type projection predicate.
4. Check that all predicates on `impl1` also exist on `impl2` (after matching substs).

## Example

Suppose we have the following always applicable impl:

```rust
impl<T> SpecExtend<T> for std::vec::IntoIter<T> { /* specialized impl */ }
impl<T, I: Iterator<Item=T>> SpecExtend<T> for I { /* default impl */ }
```

We get that the subst for `impl2` are `[T, std::vec::IntoIter<T>]`. `T` is constrained to be `<I as Iterator>::Item`, so we check only `std::vec::IntoIter<T>` for repeated parameters, which it doesn't have. The predicates of `impl1` are only `T: Sized`, which is also a predicate of impl2`. So this specialization is sound.

## Extensions

Unfortunately not all specializations in the standard library are allowed by this. So there are two extensions to these rules that allow specializing on some traits.

### rustc_specialization_trait

If a trait is always applicable, then it's sound to specialize on it. We check trait is always applicable in the same way as impls, except that step 4 is now "all predicates on `impl1` are always applicable". We require that `specialization` or `min_specialization` is enabled to implement these traits.

### rustc_specialization_marker

There are also some specialization on traits with no methods, including the `FusedIterator` trait which is advertised as allowing optimizations. We allow marking marker traits with an unstable attribute that means we ignore them in point 3 of the checks above. This is unsound but we allow it in the short term because it can't cause use after frees with purely safe code in the same way as specializing on traits methods can.

r? @nikomatsakis
cc #31844 #67194

4 years agoAuto merge of #67133 - oli-obk:it_must_be_a_sign, r=eddyb
bors [Mon, 16 Mar 2020 16:31:23 +0000 (16:31 +0000)]
Auto merge of #67133 - oli-obk:it_must_be_a_sign, r=eddyb

Deduplicate pretty printing of constants

r? @eddyb for the pretty printing logic
cc @RalfJung

4 years agoAuto merge of #70040 - Dylan-DPC:rollup-id1k6lz, r=Dylan-DPC
bors [Mon, 16 Mar 2020 13:22:56 +0000 (13:22 +0000)]
Auto merge of #70040 - Dylan-DPC:rollup-id1k6lz, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #67335 (Refactor the `Qualif` trait)
 - #69122 (Backtrace Debug tweaks)
 - #69520 (Make error message clearer about creating new module)
 - #69738 (More Method -> AssocFn renaming)
 - #69867 (Add long error explanation for E0628 )
 - #69989 (resolve/hygiene: `macro_rules` are not "legacy")
 - #70036 (Make article_and_description primarily use def_kind)

Failed merges:

r? @ghost

4 years agoRollup merge of #70036 - mark-i-m:describe-it-4, r=eddyb
Dylan DPC [Mon, 16 Mar 2020 12:16:45 +0000 (13:16 +0100)]
Rollup merge of #70036 - mark-i-m:describe-it-4, r=eddyb

Make article_and_description primarily use def_kind

r? @eddyb

cc @matthewjasper

4 years agoRollup merge of #69989 - petrochenkov:nolegacy, r=eddyb,matthewjasper
Dylan DPC [Mon, 16 Mar 2020 12:16:44 +0000 (13:16 +0100)]
Rollup merge of #69989 - petrochenkov:nolegacy, r=eddyb,matthewjasper

resolve/hygiene: `macro_rules` are not "legacy"

The "modern" vs "legacy" naming was introduced by jseyfried during initial implementation of macros 2.0.
At this point it's clear that `macro_rules` are not going anywhere and won't be deprecated in the near future.
So this PR changes the naming "legacy" (when it implies "macro_rules") to "macro_rules".
This should also help people reading this code because it's wasn't obvious that "legacy" actually meant "macro_rules" in these contexts.

The most contentious renaming here is probably
```
fn modern -> fn normalize_to_macros_2_0
fn modern_and_legacy -> fn normalize_to_macro_rules
```
Other alternatives that I could think of are `normalize_to_opaque`/`normalize_to_semitransparent`, or `strip_non_opaque`/`strip_transparent`, but they seemed less intuitive.
The documentation to these functions can be found in `symbol.rs`.

r? @matthewjasper

4 years agoRollup merge of #69867 - ayushmishra2005:doc/61137-add-long-error-code-e0628, r=Dylan-DPC
Dylan DPC [Mon, 16 Mar 2020 12:16:42 +0000 (13:16 +0100)]
Rollup merge of #69867 - ayushmishra2005:doc/61137-add-long-error-code-e0628, r=Dylan-DPC

Add long error explanation for E0628

Add long explanation for the E0628 error code
Part of #61137

r? @GuillaumeGomez

4 years agoRollup merge of #69738 - mark-i-m:assoc-fn-2, r=eddyb
Dylan DPC [Mon, 16 Mar 2020 12:16:40 +0000 (13:16 +0100)]
Rollup merge of #69738 - mark-i-m:assoc-fn-2, r=eddyb

More Method -> AssocFn renaming

r? @Centril @eddyb

cc #60163

Blocked on #69674

4 years agoRollup merge of #69520 - kornelski:e69492, r=cramertj
Dylan DPC [Mon, 16 Mar 2020 12:16:38 +0000 (13:16 +0100)]
Rollup merge of #69520 - kornelski:e69492, r=cramertj

Make error message clearer about creating new module

This is a partial improvement for #69492

4 years agoRollup merge of #69122 - dtolnay:backtrace, r=cramertj
Dylan DPC [Mon, 16 Mar 2020 12:16:35 +0000 (13:16 +0100)]
Rollup merge of #69122 - dtolnay:backtrace, r=cramertj

Backtrace Debug tweaks

- Change Debug representation of disabled and unsupported backtraces to use \<placeholder\> style, same as what we do for debug printing locked mutexes and mutably borrowed refcells;

    ```diff
    - Error { msg: "...", backtrace: disabled backtrace }
    + Error { msg: "...", backtrace: <disabled> }
    ```

- Remove quotes around unresolved symbol names;

    ```diff
    - Backtrace [{ fn: "<unknown>" }]
    + Backtrace [{ fn: <unknown> }]
    ```

- Add quotes around file paths;

    ```diff
    - Backtrace [{ fn: "krate::main", file: /path/to/main.rs, line: 10 }]
    + Backtrace [{ fn: "krate::main", file: "/path/to/main.rs", line: 10 }]
    ```

- Add test.

4 years agoRollup merge of #67335 - ecstatic-morse:qualif-refactor, r=eddyb
Dylan DPC [Mon, 16 Mar 2020 12:16:30 +0000 (13:16 +0100)]
Rollup merge of #67335 - ecstatic-morse:qualif-refactor, r=eddyb

Refactor the `Qualif` trait

This PR attempts to preserve the existing semantics of the `Qualif` trait while reducing its API to two significant methods with descriptive names, `in_any_value_of_ty` and `in_adt_inherently`. The other `in_*` methods have been made into free functions, since they should never be overloaded. Finally, I changed the bounds on the `in_local` argument to be less restrictive (`FnMut` instead of `Fn`), which addresses a FIXME in the const-checker.

r? @eddyb
cc @pnkfelix @oli-obk

4 years agoAuto merge of #70010 - Amanieu:fix-opt-catch, r=Mark-Simulacrum
bors [Mon, 16 Mar 2020 08:08:51 +0000 (08:08 +0000)]
Auto merge of #70010 - Amanieu:fix-opt-catch, r=Mark-Simulacrum

Add a workaround for catch_unwind in stage1 mingw target

Fixes #70001

cc @petrochenkov

r? @Mark-Simulacrum

4 years agomake article_and_description primarily use def_kind
mark [Mon, 16 Mar 2020 04:31:17 +0000 (23:31 -0500)]
make article_and_description primarily use def_kind

4 years agoAuto merge of #70034 - Dylan-DPC:rollup-5yg771j, r=Dylan-DPC
bors [Mon, 16 Mar 2020 02:52:47 +0000 (02:52 +0000)]
Auto merge of #70034 - Dylan-DPC:rollup-5yg771j, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #69686 (Use `pprust` to print attributes in rustdoc)
 - #69858 (std: on Windows, use GetSystemTimePreciseAsFileTime if it is available)
 - #69917 (Cleanup E0412 and E0422)
 - #69964 (Add Node.js to PR CI image)
 - #69992 (Block version-specific docs from search engines)
 - #69995 (Add more context to the literal overflow message)
 - #69998 (Add long error explanation for E0634)
 - #70014 (Small fixes in rustdoc book)

Failed merges:

r? @ghost

4 years agoMethodData -> AssocFnData
Mark Mansi [Sun, 15 Mar 2020 16:19:17 +0000 (11:19 -0500)]
MethodData -> AssocFnData

4 years agoupdate comment
Mark Mansi [Sat, 7 Mar 2020 00:00:46 +0000 (18:00 -0600)]
update comment

4 years agoRollup merge of #70014 - TimotheeGerber:small-fix-rustdoc-book, r=Dylan-DPC
Dylan DPC [Mon, 16 Mar 2020 00:30:41 +0000 (01:30 +0100)]
Rollup merge of #70014 - TimotheeGerber:small-fix-rustdoc-book, r=Dylan-DPC

Small fixes in rustdoc book

I read the `rustdoc` book today and noticed some small typos/problems. Mainly:

 - `# fn foo() {}` was displayed when not needed because fenced block code type was `text` instead of `rust`;
 - two path separators were missing and some Windows-style separators were not consistent with the rest of them (mainly Linux-style).

Here are my proposed fixes. It is my first PR for the rust project. Don't hesitate to tell me if I am doing it wrong or if you need anything else.

Have a nice day!

4 years agoRollup merge of #69998 - ayushmishra2005:doc/61137-add-long-error-code-e0634, r=Dylan...
Dylan DPC [Mon, 16 Mar 2020 00:30:38 +0000 (01:30 +0100)]
Rollup merge of #69998 - ayushmishra2005:doc/61137-add-long-error-code-e0634, r=Dylan-DPC,GuillaumeGomez

Add long error explanation for E0634

Add long explanation for the E0634 error code
Part of #61137

r? @GuillaumeGomez

4 years agoRollup merge of #69995 - contrun:add-context-to-literal-overflow, r=ecstatic-morse
Dylan DPC [Mon, 16 Mar 2020 00:30:37 +0000 (01:30 +0100)]
Rollup merge of #69995 - contrun:add-context-to-literal-overflow, r=ecstatic-morse

Add more context to the literal overflow message

related to issue https://github.com/rust-lang/rust/issues/63733

4 years agoRollup merge of #69992 - kornelski:robots, r=steveklabnik
Dylan DPC [Mon, 16 Mar 2020 00:30:35 +0000 (01:30 +0100)]
Rollup merge of #69992 - kornelski:robots, r=steveklabnik

Block version-specific docs from search engines

Latest stable, beta and nightly URLs remain accessible because their URLs don't start with a version number. Robots.txt uses simple path prefixes, so it's OK that the disallow rules aren't full directory paths.

Direct links to old docs remain accessible to users, because robots.txt only affects crawlers.

With this change old docs for specific old versions of Rust won't pop up in search results. This is good, because users won't be getting obsolete documentation by accident.

4 years agoRollup merge of #69964 - ollie27:ci_nodejs, r=Mark-Simulacrum,GuillaumeGomez
Dylan DPC [Mon, 16 Mar 2020 00:30:33 +0000 (01:30 +0100)]
Rollup merge of #69964 - ollie27:ci_nodejs, r=Mark-Simulacrum,GuillaumeGomez

Add Node.js to PR CI image

This should allow the `rustdoc-js` and `rustdoc-js-std` test suites to run automatically on PRs.

4 years agoRollup merge of #69917 - GuillaumeGomez:cleanup-e0412, r=Dylan-DPC
Dylan DPC [Mon, 16 Mar 2020 00:30:31 +0000 (01:30 +0100)]
Rollup merge of #69917 - GuillaumeGomez:cleanup-e0412, r=Dylan-DPC

Cleanup E0412 and E0422

r? @Dylan-DPC

4 years agoRollup merge of #69858 - da-x:windows-precise-time, r=Dylan-DPC
Dylan DPC [Mon, 16 Mar 2020 00:30:28 +0000 (01:30 +0100)]
Rollup merge of #69858 - da-x:windows-precise-time, r=Dylan-DPC

std: on Windows, use GetSystemTimePreciseAsFileTime if it is available

This implements #67266.

4 years agoRollup merge of #69686 - varkor:rustdoc-attributes, r=GuillaumeGomez
Dylan DPC [Mon, 16 Mar 2020 00:30:24 +0000 (01:30 +0100)]
Rollup merge of #69686 - varkor:rustdoc-attributes, r=GuillaumeGomez

Use `pprust` to print attributes in rustdoc

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

I'm not sure what the original motivation was for the `render_attribute`, so I may be missing something, but replacing it with `pprust::attribute_to_string` seems to give the intended output (modulo some spacing idiosyncrasies).

r? @GuillaumeGomez

4 years agoMore Method->Fn renaming
Mark Mansi [Thu, 5 Mar 2020 15:57:34 +0000 (09:57 -0600)]
More Method->Fn renaming

4 years agohygiene: `modern` -> `normalize_to_macros_2_0`
Vadim Petrochenkov [Fri, 13 Mar 2020 22:36:46 +0000 (01:36 +0300)]
hygiene: `modern` -> `normalize_to_macros_2_0`

`modern_and_legacy` -> `normalize_to_macro_rules`

4 years agoOther `legacy` -> `macro_rules`
Vadim Petrochenkov [Fri, 13 Mar 2020 22:23:24 +0000 (01:23 +0300)]
Other `legacy` -> `macro_rules`

4 years agoresolve: `Legacy(Scope,Binding)` -> `MacroRules(Scope,Binding)`
Vadim Petrochenkov [Fri, 13 Mar 2020 22:06:36 +0000 (01:06 +0300)]
resolve: `Legacy(Scope,Binding)` -> `MacroRules(Scope,Binding)`

4 years agoast/hir: `MacroDef::legacy` -> `MacroDef::macro_rules`
Vadim Petrochenkov [Fri, 13 Mar 2020 21:52:24 +0000 (00:52 +0300)]
ast/hir: `MacroDef::legacy` -> `MacroDef::macro_rules`

4 years agoAuto merge of #68944 - Zoxc:hir-map, r=eddyb
bors [Sun, 15 Mar 2020 20:40:16 +0000 (20:40 +0000)]
Auto merge of #68944 - Zoxc:hir-map, r=eddyb

Use queries for the HIR map

r? @eddyb cc @michaelwoerister

4 years agoAuto merge of #70024 - Centril:rollup-cppmaxr, r=Centril
bors [Sun, 15 Mar 2020 17:27:47 +0000 (17:27 +0000)]
Auto merge of #70024 - Centril:rollup-cppmaxr, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #69528 (Add undo_leak to reset RefCell borrow state)
 - #69589 (ast: `Mac`/`Macro` -> `MacCall`)
 - #69661 (Implement From<&mut str> for String)
 - #69988 (rustc_metadata: Remove `rmeta::MacroDef`)
 - #70006 (resolve: Fix two issues in fresh binding disambiguation)
 - #70011 (def_collector: Fully visit async functions)
 - #70013 (Return feature gate as a `Symbol` )
 - #70018 (Fix "since" field for `Once::is_complete`'s `#[stable]` attribute)

Failed merges:

r? @ghost

4 years agoAdd FIXME note
varkor [Tue, 3 Mar 2020 23:47:13 +0000 (23:47 +0000)]
Add FIXME note

4 years agoRender full attributes in rustdoc
varkor [Tue, 3 Mar 2020 23:41:32 +0000 (23:41 +0000)]
Render full attributes in rustdoc

4 years agoRollup merge of #70018 - LukasKalbertodt:fix-once-is-complete-since, r=Centril
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:15 +0000 (15:40 +0100)]
Rollup merge of #70018 - LukasKalbertodt:fix-once-is-complete-since, r=Centril

Fix "since" field for `Once::is_complete`'s `#[stable]` attribute

It was accidentally merged with the wrong version in #68945.  Thanks @jplatte for noticing.

This also needs to be beta backported.

4 years agoRollup merge of #70013 - ecstatic-morse:check-consts-feature-gate, r=oli-obk
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:13 +0000 (15:40 +0100)]
Rollup merge of #70013 - ecstatic-morse:check-consts-feature-gate, r=oli-obk

Return feature gate as a `Symbol`

A minor refactoring that will be needed for #68940. That PR is blocked on me changing the error comments in a whole lot of UI tests.

r? @oli-obk

4 years agoRollup merge of #70011 - petrochenkov:asyncice, r=Centril
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:12 +0000 (15:40 +0100)]
Rollup merge of #70011 - petrochenkov:asyncice, r=Centril

def_collector: Fully visit async functions

We forgot to visit attributes previously, it caused ICEs.

Special treatment of async functions is also moved from `visit_item` to `visit_fn` to reuse more of the default visitor.

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

4 years agoRollup merge of #70006 - petrochenkov:fresh, r=Centril
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:10 +0000 (15:40 +0100)]
Rollup merge of #70006 - petrochenkov:fresh, r=Centril

resolve: Fix two issues in fresh binding disambiguation

Prevent fresh bindings from shadowing ambiguity items.
Fixes https://github.com/rust-lang/rust/issues/46079

Correctly treat const generic parameters in fresh binding disambiguation.
Fixes https://github.com/rust-lang/rust/issues/68853

4 years agoRollup merge of #69988 - petrochenkov:nomacrodef, r=Centril
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:08 +0000 (15:40 +0100)]
Rollup merge of #69988 - petrochenkov:nomacrodef, r=Centril

rustc_metadata: Remove `rmeta::MacroDef`

And other related cleanups.

Follow-up to https://github.com/rust-lang/rust/pull/66364.
r? @Centril

4 years agoRollup merge of #69661 - lopopolo:string-from-mut-str, r=sfackler
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:07 +0000 (15:40 +0100)]
Rollup merge of #69661 - lopopolo:string-from-mut-str, r=sfackler

Implement From<&mut str> for String

I ran into this missing impl when trying to do `String::from` on the result returned from this API in the `uuid` crate:

https://docs.rs/uuid/0.8.1/uuid/adapter/struct.Hyphenated.html#method.encode_lower

I wasn't sure what to put in the stability annotation. I'd appreciate some help with that :)

4 years agoRollup merge of #69589 - petrochenkov:maccall, r=Centril
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:05 +0000 (15:40 +0100)]
Rollup merge of #69589 - petrochenkov:maccall, r=Centril

ast: `Mac`/`Macro` -> `MacCall`

It's now obvious that these refer to macro calls rather than to macro definitions.

It's also a single name instead of two different names in different places.

`rustc_expand` usually calls macro calls in a wide sense (including attributes and derives) "macro invocations", but structures and variants renamed in this PR are only relevant to fn-like macros, so it's simpler and clearer to just call them calls.

cc https://github.com/rust-lang/rust/pull/63586#discussion_r314232513
r? @eddyb

4 years agoRollup merge of #69528 - HeroicKatora:finalize-ref-cell, r=dtolnay
Mazdak Farrokhzad [Sun, 15 Mar 2020 14:40:03 +0000 (15:40 +0100)]
Rollup merge of #69528 - HeroicKatora:finalize-ref-cell, r=dtolnay

Add undo_leak to reset RefCell borrow state

This method is complementary for the feature cell_leak added in an
earlier PR. It allows *safely* reverting the effects of leaking a borrow guard by
statically proving that such a guard could not longer exist. This was
not added to the existing `get_mut` out of concern of impacting the
complexity of the otherwise pure pointer cast and because the name
`get_mut` poorly communicates the intent of resetting remaining borrows.

This is a follow-up to #68712 and uses the same tracking issue, #69099,
as these methods deal with the same mechanism and the idea came up
[in a review comment](https://github.com/rust-lang/rust/pull/68712#discussion_r384670041).

@dtolnay who reviewed the prior PR.
cc @RalfJung

4 years agoAuto merge of #69961 - RalfJung:miri, r=RalfJung
bors [Sun, 15 Mar 2020 14:18:14 +0000 (14:18 +0000)]
Auto merge of #69961 - RalfJung:miri, r=RalfJung

update miri

r? @ghost
Cc @oli-obk

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

4 years agoConsider well-formed predicates in min-specialization
Matthew Jasper [Mon, 9 Mar 2020 21:59:13 +0000 (21:59 +0000)]
Consider well-formed predicates in min-specialization

4 years agoUse min_specialization in libstd and libproc_macro
Matthew Jasper [Sat, 8 Feb 2020 20:54:33 +0000 (20:54 +0000)]
Use min_specialization in libstd and libproc_macro

4 years agoImplement soundness check for min_specialization
Matthew Jasper [Sat, 8 Feb 2020 20:14:02 +0000 (20:14 +0000)]
Implement soundness check for min_specialization

4 years agoAvoid ICEs when we emit errors constructing the specialization graph
Matthew Jasper [Sat, 8 Feb 2020 20:10:06 +0000 (20:10 +0000)]
Avoid ICEs when we emit errors constructing the specialization graph

4 years agoAdd attributes to allow specializing on traits
Matthew Jasper [Sat, 8 Feb 2020 17:56:25 +0000 (17:56 +0000)]
Add attributes to allow specializing on traits

4 years agoAdd `min_specialization` feature
Matthew Jasper [Sat, 8 Feb 2020 17:07:36 +0000 (17:07 +0000)]
Add `min_specialization` feature

Currently the only difference between it and `specialization` is that
it only allows specializing functions.

4 years agoAuto merge of #70016 - Dylan-DPC:rollup-5k7lxs3, r=Dylan-DPC
bors [Sun, 15 Mar 2020 10:52:37 +0000 (10:52 +0000)]
Auto merge of #70016 - Dylan-DPC:rollup-5k7lxs3, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #69357 (Emit 1-based column numbers in debuginfo)
 - #69471 (Remove `sip::Hasher::short_write`.)
 - #69498 (Change "method" to "associated function")
 - #69967 (Remove a few `Rc`s from RegionInferenceCtxt)
 - #69987 (Add self to .mailmap)
 - #69991 (fix E0117 message out of sync)
 - #69993 (Add long error explanation for E0693)

Failed merges:

r? @ghost

4 years agoupdate miri
Ralf Jung [Sun, 15 Mar 2020 10:51:09 +0000 (11:51 +0100)]
update miri

4 years agoresolve: Prevent fresh bindings from shadowing ambiguity items
Vadim Petrochenkov [Sat, 14 Mar 2020 16:44:11 +0000 (19:44 +0300)]
resolve: Prevent fresh bindings from shadowing ambiguity items

Correctly treat const generic parameters in fresh binding disambiguation

4 years agoFix "since" field for `Once::is_complete`'s `#[stable]` attribute
Lukas Kalbertodt [Sun, 15 Mar 2020 09:19:26 +0000 (10:19 +0100)]
Fix "since" field for `Once::is_complete`'s `#[stable]` attribute

It was accidentally merged with the wrong version.

4 years agoAdd more context to the literal overflow message
YI [Sat, 14 Mar 2020 03:57:04 +0000 (11:57 +0800)]
Add more context to the literal overflow message

4 years agoRollup merge of #69993 - ayushmishra2005:doc/61137-add-long-error-code-e0693, r=Dylan-DPC
Dylan DPC [Sun, 15 Mar 2020 01:44:23 +0000 (02:44 +0100)]
Rollup merge of #69993 - ayushmishra2005:doc/61137-add-long-error-code-e0693, r=Dylan-DPC

Add long error explanation for E0693

Add long explanation for the E0693 error code
Part of #61137

r? @GuillaumeGomez

4 years agoRollup merge of #69991 - contrun:fix-69980, r=Dylan-DPC
Dylan DPC [Sun, 15 Mar 2020 01:44:22 +0000 (02:44 +0100)]
Rollup merge of #69991 - contrun:fix-69980, r=Dylan-DPC

fix E0117 message out of sync

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

4 years agoRollup merge of #69987 - kraai:mailmap, r=nikomatsakis
Dylan DPC [Sun, 15 Mar 2020 01:44:20 +0000 (02:44 +0100)]
Rollup merge of #69987 - kraai:mailmap, r=nikomatsakis

Add self to .mailmap

The variants are only used for [rust-lang/rust-clippy](https://github.com/rust-lang/rust-clippy), but it seems like <https://thanks.rust-lang.org/> only uses this `.mailmap`.

4 years agoRollup merge of #69967 - mark-i-m:rinfctx, r=matthewjasper
Dylan DPC [Sun, 15 Mar 2020 01:44:18 +0000 (02:44 +0100)]
Rollup merge of #69967 - mark-i-m:rinfctx, r=matthewjasper

Remove a few `Rc`s from RegionInferenceCtxt

fixes https://github.com/rust-lang/rust/issues/55853

r? @matthewjasper

4 years agoRollup merge of #69498 - mark-i-m:describe-it-2, r=matthewjasper
Dylan DPC [Sun, 15 Mar 2020 01:44:17 +0000 (02:44 +0100)]
Rollup merge of #69498 - mark-i-m:describe-it-2, r=matthewjasper

Change "method" to "associated function"

r? @matthewjasper

cc @Centril @eddyb #67742

I'm opening this mostly as a test to see what the diagnostic changes would be. It seems that this makes them somewhat more verbose, and I'm not sure it's worth it...

The relevant changes are the last two commits (it is rebased on top of #67742)

4 years agoRollup merge of #69471 - nnethercote:rm-sip-Hasher-short_write, r=dtolnay
Dylan DPC [Sun, 15 Mar 2020 01:44:15 +0000 (02:44 +0100)]
Rollup merge of #69471 - nnethercote:rm-sip-Hasher-short_write, r=dtolnay

Remove `sip::Hasher::short_write`.

`sip::Hasher::short_write` is currently unused. It is called by
`sip::Hasher::write_{u8,usize}`, but those methods are also unused,
because `DefaultHasher`, `SipHasher` and `SipHasher13` don't implement
any of the `write_xyz` methods, so all their write operations end up
calling `sip::Hasher::write`.

(I confirmed this by inserting a `panic!` in `sip::Hasher::short_write`
and running the tests -- they all passed.)

The alternative would be to add all the missing `write_xyz` methods.
This does give some significant speed-ups, but it hurts compile times a
little in some cases. See #69152 for details. This commit does the
conservative thing and doesn't change existing behaviour.

r? @rust-lang/libs

4 years agoRollup merge of #69357 - tmiasko:debuginfo-column, r=michaelwoerister
Dylan DPC [Sun, 15 Mar 2020 01:44:13 +0000 (02:44 +0100)]
Rollup merge of #69357 - tmiasko:debuginfo-column, r=michaelwoerister

Emit 1-based column numbers in debuginfo

* Use byte offsets instead of char position offsets. Resolves #67360.
* Use 1-based offsets instead of 0-based ones. Resolves #65437.
* Consistently omit column information for msvc targets, matching clang behaviour (previously columns have been omitted from `DILocation`, but not from `DILexicalBlock`).

4 years agoUpdate src/librustc_error_codes/error_codes/E0634.md
Ayush Mishra [Sun, 15 Mar 2020 01:19:54 +0000 (06:49 +0530)]
Update src/librustc_error_codes/error_codes/E0634.md

Co-Authored-By: Dylan DPC <dylan.dpc@gmail.com>
4 years agoUpdate src/librustc_error_codes/error_codes/E0634.md
Ayush Mishra [Sun, 15 Mar 2020 01:19:45 +0000 (06:49 +0530)]
Update src/librustc_error_codes/error_codes/E0634.md

Co-Authored-By: Dylan DPC <dylan.dpc@gmail.com>
4 years agodef_collector: Fully visit async functions
Vadim Petrochenkov [Sat, 14 Mar 2020 19:22:29 +0000 (22:22 +0300)]
def_collector: Fully visit async functions

4 years agoReturn feature gate as a `Symbol`
Dylan MacKenzie [Sat, 14 Mar 2020 22:59:10 +0000 (15:59 -0700)]
Return feature gate as a `Symbol`

4 years agoUpdate ui tests
Guillaume Gomez [Sat, 14 Mar 2020 22:51:45 +0000 (23:51 +0100)]
Update ui tests

4 years agoFix punctuation in rustdoc book
Timothée Gerber [Sat, 14 Mar 2020 22:40:29 +0000 (23:40 +0100)]
Fix punctuation in rustdoc book

4 years agoChange fenced code block type in rustdoc book
Timothée Gerber [Sat, 14 Mar 2020 22:31:34 +0000 (23:31 +0100)]
Change fenced code block type in rustdoc book

4 years agoSimplify `Qualif` interface
Dylan MacKenzie [Fri, 13 Dec 2019 21:20:16 +0000 (13:20 -0800)]
Simplify `Qualif` interface

4 years agoClean up E0412 and E0422 explanations
Guillaume Gomez [Wed, 11 Mar 2020 12:06:54 +0000 (13:06 +0100)]
Clean up E0412 and E0422 explanations

4 years agoClean up path separator in rustdoc book
Timothée Gerber [Sat, 14 Mar 2020 22:04:33 +0000 (23:04 +0100)]
Clean up path separator in rustdoc book

4 years agoAdd some comments to the new queries
John Kåre Alsaker [Wed, 11 Mar 2020 14:20:24 +0000 (15:20 +0100)]
Add some comments to the new queries

4 years agoAdd test for #69596
John Kåre Alsaker [Tue, 10 Mar 2020 07:26:13 +0000 (08:26 +0100)]
Add test for #69596

4 years agoDon't try to print missing HIR ids
John Kåre Alsaker [Thu, 20 Feb 2020 18:24:44 +0000 (19:24 +0100)]
Don't try to print missing HIR ids

4 years agoUpdate tests
John Kåre Alsaker [Thu, 13 Feb 2020 10:17:49 +0000 (11:17 +0100)]
Update tests

4 years agoUpdate ich_nested_items.rs
John Kåre Alsaker [Wed, 12 Feb 2020 17:50:30 +0000 (18:50 +0100)]
Update ich_nested_items.rs

4 years agoReintroduce workaround for #62649
John Kåre Alsaker [Wed, 12 Feb 2020 17:11:32 +0000 (18:11 +0100)]
Reintroduce workaround for #62649

4 years agoFormat function_interfaces.rs
John Kåre Alsaker [Wed, 12 Feb 2020 15:01:24 +0000 (16:01 +0100)]
Format function_interfaces.rs

4 years agoReplace `Hir` with `hir_owner` in tests
John Kåre Alsaker [Wed, 12 Feb 2020 15:00:15 +0000 (16:00 +0100)]
Replace `Hir` with `hir_owner` in tests

4 years agoReplace `HirBody` with `hir_owner_items` in tests
John Kåre Alsaker [Wed, 12 Feb 2020 14:34:10 +0000 (15:34 +0100)]
Replace `HirBody` with `hir_owner_items` in tests

4 years agoCreate the `hir_to_node_id` map before `TyCtxt`
John Kåre Alsaker [Wed, 12 Feb 2020 14:11:33 +0000 (15:11 +0100)]
Create the `hir_to_node_id` map before `TyCtxt`

4 years agoOptimize the HIR map
John Kåre Alsaker [Mon, 10 Feb 2020 16:00:49 +0000 (17:00 +0100)]
Optimize the HIR map

4 years agoDon't hash HIR with bodies thrice
John Kåre Alsaker [Mon, 10 Feb 2020 13:29:21 +0000 (14:29 +0100)]
Don't hash HIR with bodies thrice

4 years agoFix HIR map validation
John Kåre Alsaker [Sun, 9 Feb 2020 16:11:02 +0000 (17:11 +0100)]
Fix HIR map validation

4 years agoIndex HIR after creating TyCtxt
John Kåre Alsaker [Sun, 9 Feb 2020 14:32:00 +0000 (15:32 +0100)]
Index HIR after creating TyCtxt

4 years agoOnly hash the Hir owner (including its bodies)
John Kåre Alsaker [Sun, 9 Feb 2020 11:13:08 +0000 (12:13 +0100)]
Only hash the Hir owner (including its bodies)

4 years agoRemove `input_task`
John Kåre Alsaker [Sun, 9 Feb 2020 09:31:13 +0000 (10:31 +0100)]
Remove `input_task`

4 years agoRemove `Hir` and `HirBody` dep nodes
John Kåre Alsaker [Sat, 8 Feb 2020 04:30:45 +0000 (05:30 +0100)]
Remove `Hir` and `HirBody` dep nodes

4 years agoClean up the collector
John Kåre Alsaker [Sat, 8 Feb 2020 04:18:34 +0000 (05:18 +0100)]
Clean up the collector

4 years agoRemove `AllLocalTraitImpls`
John Kåre Alsaker [Sat, 8 Feb 2020 03:26:12 +0000 (04:26 +0100)]
Remove `AllLocalTraitImpls`

4 years agoRemove the `map` field from `Map`
John Kåre Alsaker [Sat, 8 Feb 2020 03:24:42 +0000 (04:24 +0100)]
Remove the `map` field from `Map`

4 years agoUpdate `trait_impls`
John Kåre Alsaker [Sat, 8 Feb 2020 03:14:29 +0000 (04:14 +0100)]
Update `trait_impls`

4 years agoRemove comments
John Kåre Alsaker [Sat, 8 Feb 2020 02:30:57 +0000 (03:30 +0100)]
Remove comments

4 years agoUpdate `find_entry`
John Kåre Alsaker [Fri, 7 Feb 2020 18:17:48 +0000 (19:17 +0100)]
Update `find_entry`

4 years agoUpdate `is_hir_id_module`
John Kåre Alsaker [Fri, 7 Feb 2020 18:09:19 +0000 (19:09 +0100)]
Update `is_hir_id_module`

4 years agoUpdate `find`
John Kåre Alsaker [Fri, 7 Feb 2020 18:01:27 +0000 (19:01 +0100)]
Update `find`

4 years agoUpdate `get_parent_node`
John Kåre Alsaker [Fri, 7 Feb 2020 17:46:21 +0000 (18:46 +0100)]
Update `get_parent_node`

4 years agoUpdate `visit_item_likes_in_module`
John Kåre Alsaker [Fri, 7 Feb 2020 17:25:36 +0000 (18:25 +0100)]
Update `visit_item_likes_in_module`

4 years agoUpdate `krate_attrs` and `get_module`
John Kåre Alsaker [Fri, 7 Feb 2020 15:43:36 +0000 (16:43 +0100)]
Update `krate_attrs` and `get_module`

4 years agoUpdate `body_owner` and `maybe_body_owned_by`
John Kåre Alsaker [Fri, 7 Feb 2020 15:10:50 +0000 (16:10 +0100)]
Update `body_owner` and `maybe_body_owned_by`

4 years agoUpdate `fn_decl_by_hir_id` and `fn_sig_by_hir_id`
John Kåre Alsaker [Fri, 7 Feb 2020 14:34:39 +0000 (15:34 +0100)]
Update `fn_decl_by_hir_id` and `fn_sig_by_hir_id`