]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoRollup merge of #81501 - calebcartwright:update-rustfmt, r=sanxiyn
Yuki Okushi [Sat, 30 Jan 2021 04:36:56 +0000 (13:36 +0900)]
Rollup merge of #81501 - calebcartwright:update-rustfmt, r=sanxiyn

update rustfmt to v1.4.34

Short summary: Various formatting fixes (several const generic related) and introduction of `imports_granularity` config option

Long summary copied from changelog:

#### Changed
- `merge_imports` configuration has been deprecated in favor of the new `imports_granularity` option. Any existing usage of `merge_imports` will be automatically mapped to the corresponding value on `imports_granularity` with a warning message printed to encourage users to update their config files.

#### Added
- New `imports_granularity` option has been added which succeeds `merge_imports`. This new option supports several additional variants which allow users to merge imports at different levels (crate or module), and even flatten imports to have a single use statement per item. ([PR rust-lang/rustfmt#4634](https://github.com/rust-lang/rustfmt/pull/4634), [PR rust-lang/rustfmt#4639](https://github.com/rust-lang/rustfmt/pull/4639))

See the section on the configuration site for more information
https://rust-lang.github.io/rustfmt/?version=v1.4.33&search=#imports_granularity

#### Fixed
- Fix erroneous removal of `const` keyword on const trait impl ([rust-lang/rustfmt#4084](https://github.com/rust-lang/rustfmt/issues/4084))
- Fix incorrect span usage wit const generics in supertraits ([rust-lang/rustfmt#4204](https://github.com/rust-lang/rustfmt/issues/4204))
- Use correct span for const generic params ([rust-lang/rustfmt#4263](https://github.com/rust-lang/rustfmt/issues/4263))
- Correct span on const generics to include type bounds ([rust-lang/rustfmt#4310](https://github.com/rust-lang/rustfmt/issues/4310))
- Idempotence issue on blocks containing only empty statements ([rust-lang/rustfmt#4627](https://github.com/rust-lang/rustfmt/issues/4627) and [#3868](https://github.com/rust-lang/rustfmt/issues/3868))
- Fix issue with semicolon placement on required functions that have a trailing comment that ends in a line-style comment before the semicolon ([rust-lang/rustfmt#4646](https://github.com/rust-lang/rustfmt/issues/4646))
- Avoid shared interned cfg_if symbol since rustfmt can re-initialize the rustc_ast globals on multiple inputs ([rust-lang/rustfmt#4656](https://github.com/rust-lang/rustfmt/issues/4656))
- Don't insert trailing comma on (base-less) rest in struct literals within macros ([rust-lang/rustfmt#4675](https://github.com/rust-lang/rustfmt/issues/4675))

3 years agoRollup merge of #81499 - SOF3:patch-1, r=sanxiyn
Yuki Okushi [Sat, 30 Jan 2021 04:36:55 +0000 (13:36 +0900)]
Rollup merge of #81499 - SOF3:patch-1, r=sanxiyn

Updated Vec::splice documentation

Replacing with equal number of values does not increase the length of the vec.

Reference: https://stackoverflow.com/a/62559271/3990767

3 years agoRollup merge of #81495 - camelid:rustdoc-output_format-optional, r=GuillaumeGomez
Yuki Okushi [Sat, 30 Jan 2021 04:36:53 +0000 (13:36 +0900)]
Rollup merge of #81495 - camelid:rustdoc-output_format-optional, r=GuillaumeGomez

rustdoc: Remove unnecessary optional

Previously, the HTML output format was represented by both
`Some(OutputFormat::Html)` and `None` so there's no need to have an
optional. Instead, `OutputFormat::Html` is explicitly the default and we
no longer have a "tri-state enum".

r? `````@GuillaumeGomez`````

3 years agoRollup merge of #81473 - sanxiyn:write-only-field, r=oli-obk
Yuki Okushi [Sat, 30 Jan 2021 04:36:52 +0000 (13:36 +0900)]
Rollup merge of #81473 - sanxiyn:write-only-field, r=oli-obk

Warn write-only fields

cc `@Boscop's` example in #49256.

3 years agoRollup merge of #81468 - est31:cfg_version, r=petrochenkov
Yuki Okushi [Sat, 30 Jan 2021 04:36:50 +0000 (13:36 +0900)]
Rollup merge of #81468 - est31:cfg_version, r=petrochenkov

cfg(version): treat nightlies as complete

This PR makes cfg(version) treat the nightlies
for version 1.n.0 as 1.n.0, even though that nightly
version might not have all stabilizations and features
of the released 1.n.0. This is done for greater
convenience for people who want to test a newly
stabilized feature on nightly, or in other words,
give newly stabilized features as many eyeballs
as possible.

For users who wish to pin nightlies, this commit adds
a -Z assume-incomplete-release option that they can
enable if they run into any issues due to this change.
Implements the suggestion in https://github.com/rust-lang/rust/issues/64796#issuecomment-640851454

3 years agoRollup merge of #81409 - gilescope:chars_count, r=joshtriplett
Yuki Okushi [Sat, 30 Jan 2021 04:36:48 +0000 (13:36 +0900)]
Rollup merge of #81409 - gilescope:chars_count, r=joshtriplett

Slight simplification of chars().count()

Slight simplification: No need to call len(), we can just count the number of non continuation bytes.

I can't see any reason not to do this, can you?

3 years agoRollup merge of #81291 - sexxi-goose:fix-struct-update-functional-record-update-synta...
Yuki Okushi [Sat, 30 Jan 2021 04:36:46 +0000 (13:36 +0900)]
Rollup merge of #81291 - sexxi-goose:fix-struct-update-functional-record-update-syntax-error, r=nikomatsakis

Support FRU pattern with `[feature(capture_disjoint_fields)]`

In case of a functional record update syntax for creating a structure, `ExprUseVisitor` to only detect the precise use of some of the field in the `..x` part of the syntax. However, when we start building MIR, we
1. First, build the place for `x`
2. and then, add precise field projections so that only some parts of `x` end up getting read.

When `capture_disjoint_fields` is enabled, and FRU is used within a closure `x` won't be completely captured, and therefore the first step will fail. This PR updates `mir_build` to create a place builder in the first step and then create place from the builder only after applying the field projection.

Closes https://github.com/rust-lang/project-rfc-2229/issues/32
r? ``````@nikomatsakis``````

3 years agoRollup merge of #80959 - jhpratt:unsigned_abs-stabilization, r=m-ou-se
Yuki Okushi [Sat, 30 Jan 2021 04:36:44 +0000 (13:36 +0900)]
Rollup merge of #80959 - jhpratt:unsigned_abs-stabilization, r=m-ou-se

Stabilize `unsigned_abs`

Resolves #74913.

This PR stabilizes the `i*::unsigned_abs()` method, which returns the absolute value of an integer _as its unsigned equivalent_. This has the advantage that it does not overflow on `i*::MIN`.

I have gone ahead and used this in a couple locations throughout the repository.

3 years agoRollup merge of #80886 - RalfJung:stable-raw-ref-macros, r=m-ou-se
Yuki Okushi [Sat, 30 Jan 2021 04:36:43 +0000 (13:36 +0900)]
Rollup merge of #80886 - RalfJung:stable-raw-ref-macros, r=m-ou-se

Stabilize raw ref macros

This stabilizes `raw_ref_macros` (https://github.com/rust-lang/rust/issues/73394), which is possible now that https://github.com/rust-lang/rust/issues/74355 is fixed.

However, as I already said in https://github.com/rust-lang/rust/issues/73394#issuecomment-751342185, I am not particularly happy with the current names of the macros. So I propose we also change them, which means I am proposing to stabilize the following in `core::ptr`:
```rust
pub macro const_addr_of($e:expr) {
    &raw const $e
}

pub macro mut_addr_of($e:expr) {
    &raw mut $e
}
```

The macro name change means we need another round of FCP. Cc `````@rust-lang/libs`````
Fixes #73394

3 years agoRollup merge of #80562 - nagisa:nagisa/bools-are-unsigned, r=eddyb
Yuki Okushi [Sat, 30 Jan 2021 04:36:41 +0000 (13:36 +0900)]
Rollup merge of #80562 - nagisa:nagisa/bools-are-unsigned, r=eddyb

Consider Scalar to be a bool only if its unsigned

This seems right, given that conceptually bools are unsigned, but the
implications of this change may have more action at distance that I'm
not sure how to exhaustively consider.

For instance there are a number of cases where code attaches range
metadata if `scalar.is_bool()` holds. Supposedly it would no longer be
attached to the `repr(i8)` enums? Though I'm not sure why booleans are
being special-cased here in the first place...

Fixes #80556

cc `@eddyb`

3 years agoRollup merge of #79023 - yoshuawuyts:stream, r=KodrAus
Yuki Okushi [Sat, 30 Jan 2021 04:36:39 +0000 (13:36 +0900)]
Rollup merge of #79023 - yoshuawuyts:stream, r=KodrAus

Add `core::stream::Stream`

[[Tracking issue: #79024](https://github.com/rust-lang/rust/issues/79024)]

This patch adds the `core::stream` submodule and implements `core::stream::Stream` in accordance with [RFC2996](https://github.com/rust-lang/rfcs/pull/2996). The RFC hasn't been merged yet, but as requested by the libs team in https://github.com/rust-lang/rfcs/pull/2996#issuecomment-725696389 I'm filing this PR to get the ball rolling.

## Documentatation

The docs in this PR have been adapted from [`std::iter`](https://doc.rust-lang.org/std/iter/index.html), [`async_std::stream`](https://docs.rs/async-std/1.7.0/async_std/stream/index.html), and [`futures::stream::Stream`](https://docs.rs/futures/0.3.8/futures/stream/trait.Stream.html). Once this PR lands my plan is to follow this up with PRs to add helper methods such as `stream::repeat` which can be used to document more of the concepts that are currently missing. That will allow us to cover concepts such as "infinite streams" and "laziness" in more depth.

## Feature gate

The feature gate for `Stream` is `stream_trait`. This matches the `#[lang = "future_trait"]` attribute name. The intention is that only the APIs defined in RFC2996 will use this feature gate, with future additions such as `stream::repeat` using their own feature gates. This is so we can ensure a smooth path towards stabilizing the `Stream` trait without needing to stabilize all the APIs in `core::stream` at once. But also don't start expanding the API until _after_ stabilization, as was the case with `std::future`.

__edit:__ the feature gate has been changed to `async_stream` to match the feature gate proposed in the RFC.

## Conclusion

This PR introduces `core::stream::{Stream, Next}` and re-exports it from `std` as `std::stream::{Stream, Next}`. Landing `Stream` in the stdlib has been a mult-year process; and it's incredibly exciting for this to finally happen!

---

r? `````@KodrAus`````
cc/ `````@rust-lang/wg-async-foundations````` `````@rust-lang/libs`````

3 years agoAuto merge of #81398 - bugadani:rustdoc-perf, r=GuillaumeGomez
bors [Sat, 30 Jan 2021 01:02:18 +0000 (01:02 +0000)]
Auto merge of #81398 - bugadani:rustdoc-perf, r=GuillaumeGomez

rustdoc tweaking

* Reuse memory
* simplify `next_def_id`, avoid multiple hashing and unnecessary lookups
* remove `all_fake_def_ids`, use the global map instead (probably not a good step toward parallelization, though...)
* convert `add_deref_target` to iterative implementation
* use `ArrayVec` where we know the max number of elements
* minor touchups here and there
* avoid building temporary vectors that get appended to other vectors

At most places I may or may not be doing the compiler's job is this PR.

3 years agorustdoc tweaking
bors [Sat, 30 Jan 2021 01:02:18 +0000 (01:02 +0000)]
rustdoc tweaking

* Reuse memory
* simplify `next_def_id`, avoid multiple hashing and unnecessary lookups
* remove `all_fake_def_ids`, use the global map instead (probably not a good step toward parallelization, though...)
* convert `add_deref_target` to iterative implementation
* use `ArrayVec` where we know the max number of elements
* minor touchups here and there
* avoid building temporary vectors that get appended to other vectors

At most places I may or may not be doing the compiler's job is this PR.

3 years agoConsider Scalar to be a bool only if its unsigned
Simonas Kazlauskas [Thu, 31 Dec 2020 16:02:52 +0000 (18:02 +0200)]
Consider Scalar to be a bool only if its unsigned

This seems right, given that conceptually bools are unsigned, but the
implications of this change may have more action at distance that I'm
not sure how to exhaustively consider.

For instance there are a number of cases where code attaches range
metadata if `scalar.is_bool()` holds. Supposedly it would no longer be
attached to the `repr(i8)` enums? Though I'm not sure why booleans are
being special-cased here in the first place...

Fixes #80556

3 years agoAuto merge of #81534 - RalfJung:miri, r=RalfJung
bors [Fri, 29 Jan 2021 21:42:35 +0000 (21:42 +0000)]
Auto merge of #81534 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/81467
Cc `@rust-lang/miri` r? `@ghost`

3 years agoupdate Miri
Ralf Jung [Fri, 29 Jan 2021 19:59:53 +0000 (20:59 +0100)]
update Miri

3 years agorename raw_const/mut -> const/mut_addr_of, and stabilize them
Ralf Jung [Sun, 10 Jan 2021 18:35:42 +0000 (19:35 +0100)]
rename raw_const/mut -> const/mut_addr_of, and stabilize them

3 years agoAuto merge of #81470 - tmiasko:remove-allocations, r=matthewjasper
bors [Fri, 29 Jan 2021 13:10:09 +0000 (13:10 +0000)]
Auto merge of #81470 - tmiasko:remove-allocations, r=matthewjasper

Avoid memory allocation when removing dead blocks

Use `reachable_as_bitset` to reuse a bitset from the traversal rather
than allocating it seprately. Additionally check if there are any
unreachable blocks before proceeding.

3 years agoAuto merge of #81419 - rylev:canocalize-extern-entries, r=petrochenkov
bors [Fri, 29 Jan 2021 10:11:16 +0000 (10:11 +0000)]
Auto merge of #81419 - rylev:canocalize-extern-entries, r=petrochenkov

Pre-canoncalize ExternLocation::ExactPaths

This stores pre-canacolized paths inside `ExternLocation::ExactPaths` so that we don't need to canoncalize them every time we want to compare them to source lib paths.

This is related to #81414.

3 years agoPre-canoncalize ExternLocation::ExactPaths
Ryan Levick [Tue, 26 Jan 2021 21:27:42 +0000 (22:27 +0100)]
Pre-canoncalize ExternLocation::ExactPaths

3 years agoAdd tests
est31 [Thu, 28 Jan 2021 11:54:30 +0000 (12:54 +0100)]
Add tests

3 years agoTreat nightlies for a version as complete
est31 [Thu, 28 Jan 2021 08:24:55 +0000 (09:24 +0100)]
Treat nightlies for a version as complete

This commit makes cfg(version) treat the nightlies
for version 1.n.0 as 1.n.0, even though that nightly
version might not have all stabilizations and features
of the released 1.n.0. This is done for greater
convenience for people who want to test a newly
stabilized feature on nightly.

For users who wish to pin nightlies, this commit adds
a -Z assume-incomplete-release option that they can
enable if there are any issues due to this change.

3 years agoAuto merge of #81440 - tmiasko:always-live-locals, r=matthewjasper
bors [Fri, 29 Jan 2021 06:56:29 +0000 (06:56 +0000)]
Auto merge of #81440 - tmiasko:always-live-locals, r=matthewjasper

Visit only statements in always live locals

No functional changes intended.

3 years agoupdate rustfmt to v1.4.34
Caleb Cartwright [Fri, 29 Jan 2021 04:39:38 +0000 (22:39 -0600)]
update rustfmt to v1.4.34

3 years agoAdd a test for syntax like: ..t.s
Dhruv Jauhar [Fri, 29 Jan 2021 04:22:49 +0000 (23:22 -0500)]
Add a test for syntax like: ..t.s

3 years agoUpdated Vec::splice documentation
Chan Kwan Yin [Fri, 29 Jan 2021 04:21:53 +0000 (12:21 +0800)]
Updated Vec::splice documentation

Replacing with equal number of values does not increase the length of the vec.

Reference: https://stackoverflow.com/a/62559271/3990767

3 years agoAuto merge of #81073 - ssomers:btree_owned_root_vs_dying, r=Mark-Simulacrum
bors [Fri, 29 Jan 2021 04:06:38 +0000 (04:06 +0000)]
Auto merge of #81073 - ssomers:btree_owned_root_vs_dying, r=Mark-Simulacrum

BTreeMap: prevent tree from ever being owned by non-root node

This introduces a new marker type, `Dying`, which is used to note trees which are in the process of deallocation. On such trees, some fields may be in an inconsistent state as we are deallocating the tree. Unfortunately, there's not a great way to express conditional unsafety, so the methods for traversal can cause UB if not invoked correctly, but not marked as such. This is not a regression from the previous state, but rather isolates the destructive methods to solely being called on the dying state.

3 years agorustdoc: Remove unnecessary optional
Camelid [Fri, 29 Jan 2021 02:00:07 +0000 (18:00 -0800)]
rustdoc: Remove unnecessary optional

Previously, the HTML output format was represented by both
`Some(OutputFormat::Html)` and `None` so there's no need to have an
optional. Instead, `OutputFormat::Html` is explicitly the default and we
no longer have a "tri-state enum".

3 years agoAuto merge of #81493 - JohnTitor:rollup-sa4m4zh, r=JohnTitor
bors [Fri, 29 Jan 2021 00:58:43 +0000 (00:58 +0000)]
Auto merge of #81493 - JohnTitor:rollup-sa4m4zh, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #79570 (rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`)
 - #79819 (Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lint)
 - #79991 (rustdoc: Render HRTB correctly for bare functions)
 - #80215 (Use -target when linking binaries for Mac Catalyst)
 - #81158 (Point to span of upvar making closure FnMut)
 - #81176 (Improve safety of `LateContext::qpath_res`)
 - #81287 (Split rustdoc JSON types into separately versioned crate)
 - #81306 (Fuse inner iterator in FlattenCompat and improve related tests)
 - #81333 (clean up some const error reporting around promoteds)
 - #81459 (Fix rustdoc text selection for page titles)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #81459 - probablykasper:text-selection-fix, r=Nemo157
Yuki Okushi [Fri, 29 Jan 2021 00:17:40 +0000 (09:17 +0900)]
Rollup merge of #81459 - probablykasper:text-selection-fix, r=Nemo157

Fix rustdoc text selection for page titles

Fixes text selection of page titles by placing the `h1.fqn span.in-band` element before `h1.fqn span.out-of-band`.

Before vs after:
https://user-images.githubusercontent.com/11315492/105768203-55708700-5f5c-11eb-924b-4e7527ffe147.mp4

Retry of PR #81397 due to merge conflicts confusing me. Recreated the same changes as in that PR, but now when I run `./x.py doc library/std`, no changes I make to `src/librustdoc/html/render/mod.rs` to the file are reflected in the built doc files, even if I delete the `build` folder. I'm guessing there's some cache I'm missing?

r? `@Nemo157`

3 years agoRollup merge of #81333 - RalfJung:const-err-simplify, r=oli-obk
Yuki Okushi [Fri, 29 Jan 2021 00:17:38 +0000 (09:17 +0900)]
Rollup merge of #81333 - RalfJung:const-err-simplify, r=oli-obk

clean up some const error reporting around promoteds

These are some error reporting simplifications enabled by https://github.com/rust-lang/rust/pull/80579.

Further simplifications are possible but could be blocked on making `const_err` a hard error.

r? ``````@oli-obk``````

3 years agoRollup merge of #81306 - SkiFire13:fuse-flatten, r=cuviper
Yuki Okushi [Fri, 29 Jan 2021 00:17:36 +0000 (09:17 +0900)]
Rollup merge of #81306 - SkiFire13:fuse-flatten, r=cuviper

Fuse inner iterator in FlattenCompat and improve related tests

Fixes #81248

3 years agoRollup merge of #81287 - CraftSpider:json-crate, r=jyn514,GuillaumeGomez
Yuki Okushi [Fri, 29 Jan 2021 00:17:34 +0000 (09:17 +0900)]
Rollup merge of #81287 - CraftSpider:json-crate, r=jyn514,GuillaumeGomez

Split rustdoc JSON types into separately versioned crate

For now just an in-tree change.

In the future, this may be exposed as a standalone crate with standard semver.

3 years agoRollup merge of #81176 - camsteffen:qpath-res, r=oli-obk
Yuki Okushi [Fri, 29 Jan 2021 00:17:32 +0000 (09:17 +0900)]
Rollup merge of #81176 - camsteffen:qpath-res, r=oli-obk

Improve safety of `LateContext::qpath_res`

This is my first rustc code change, inspired by hacking on clippy!

The first change is to clear cached `TypeckResults` from `LateContext` when visiting a nested item. I took a hint from [here](https://github.com/rust-lang/rust/blob/5e91c4ecc09312d8b63d250a432b0f3ef83f1df7/compiler/rustc_privacy/src/lib.rs#L1300).

Clippy has a `qpath_res` util function to avoid a possible ICE in `LateContext::qpath_res`. But the docs of `LateContext::qpath_res` promise no ICE. So this updates the `LateContext` method to keep its promises, and removes the util function.

Related: rust-lang/rust-clippy#4545

CC ````````````@eddyb```````````` since you've done related work
CC ````````````@flip1995```````````` FYI

3 years agoRollup merge of #81158 - 1000teslas:issue-80313-fix, r=Aaron1011
Yuki Okushi [Fri, 29 Jan 2021 00:17:31 +0000 (09:17 +0900)]
Rollup merge of #81158 - 1000teslas:issue-80313-fix, r=Aaron1011

Point to span of upvar making closure FnMut

For #80313.

3 years agoRollup merge of #80215 - visigoth:issue-80202-fix, r=estebank
Yuki Okushi [Fri, 29 Jan 2021 00:17:29 +0000 (09:17 +0900)]
Rollup merge of #80215 - visigoth:issue-80202-fix, r=estebank

Use -target when linking binaries for Mac Catalyst

When running `rustc` with `-target x86_64-apple-ios-macabi`, the linker
eventually gets run with `-arch x86_64`, because the linker back end splits the
LLVM target triple and uses the first token as the target architecture. However,
this does not work for the Mac Catalyst ABI, which is a separate target from
Darwin.

Specifying the full target triple with `-target` allows Mac Catalyst binaries to
link and run.

closes #80202

3 years agoRollup merge of #79991 - camelid:rustdoc-for-lifetime, r=GuillaumeGomez,jyn514
Yuki Okushi [Fri, 29 Jan 2021 00:17:27 +0000 (09:17 +0900)]
Rollup merge of #79991 - camelid:rustdoc-for-lifetime, r=GuillaumeGomez,jyn514

rustdoc: Render HRTB correctly for bare functions

The angle brackets were not rendered, so code like this:

    some_func: for<'a> fn(val: &'a i32) -> i32

would be rendered as:

    some_func: fn'a(val: &'a i32) -> i32

However, rendering with angle brackets is still invalid syntax:

    some_func: fn<'a>(val: &'a i32) -> i32

so now it renders correctly as:

    some_func: for<'a> fn(val: &'a i32) -> i32

-----

However, note that this code:

    some_trait: dyn for<'a> Trait<'a>

will still render as:

    some_trait: dyn Trait<'a>

which is not invalid syntax, but is still unclear. Unfortunately I think
it's hard to fix that case because there isn't enough information in the
`rustdoc::clean::Type` that this code operates on. Perhaps that case can
be fixed in a later PR.

r? ``@jyn514``

3 years agoRollup merge of #79819 - Aaron1011:feature/macro-trailing-semicolon, r=petrochenkov
Yuki Okushi [Fri, 29 Jan 2021 00:17:26 +0000 (09:17 +0900)]
Rollup merge of #79819 - Aaron1011:feature/macro-trailing-semicolon, r=petrochenkov

Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lint

cc #79813

This PR adds an allow-by-default future-compatibility lint
`SEMICOLON_IN_EXPRESSIONS_FROM_MACROS`. It fires when a trailing semicolon in a
macro body is ignored due to the macro being used in expression
position:

```rust
macro_rules! foo {
    () => {
        true; // WARN
    }
}

fn main() {
    let val = match true {
        true => false,
        _ => foo!()
    };
}
```

The lint takes its level from the macro call site, and
can be allowed for a particular macro by adding
`#[allow(macro_trailing_semicolon)]`.

The lint is set to warn for all internal rustc crates (when being built
by a stage1 compiler). After the next beta bump, we can enable
the lint for the bootstrap compiler as well.

3 years agoRollup merge of #79570 - alexcrichton:split-debuginfo, r=bjorn3
Yuki Okushi [Fri, 29 Jan 2021 00:17:20 +0000 (09:17 +0900)]
Rollup merge of #79570 - alexcrichton:split-debuginfo, r=bjorn3

rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`

This commit adds a new stable codegen option to rustc,
`-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now
subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also
subsumed by this flag but still requires `-Zunstable-options` to
actually activate. The `-Csplit-debuginfo` flag takes one of
three values:

* `off` - This indicates that split-debuginfo from the final artifact is
  not desired. This is not supported on Windows and is the default on
  Unix platforms except macOS. On macOS this means that `dsymutil` is
  not executed.

* `packed` - This means that debuginfo is desired in one location
  separate from the main executable. This is the default on Windows
  (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes
  `-Zsplit-dwarf=single` and produces a `*.dwp` file.

* `unpacked` - This means that debuginfo will be roughly equivalent to
  object files, meaning that it's throughout the build directory
  rather than in one location (often the fastest for local development).
  This is not the default on any platform and is not supported on Windows.

Each target can indicate its own default preference for how debuginfo is
handled. Almost all platforms default to `off` except for Windows and
macOS which default to `packed` for historical reasons.

Some equivalencies for previous unstable flags with the new flags are:

* `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed`
* `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked`
* `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed`
* `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked`

Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for
non-macOS platforms since split-dwarf support was *just* implemented in
rustc.

There's some more rationale listed on #79361, but the main gist of the
motivation for this commit is that `dsymutil` can take quite a long time
to execute in debug builds and provides little benefit. This means that
incremental compile times appear that much worse on macOS because the
compiler is constantly running `dsymutil` over every single binary it
produces during `cargo build` (even build scripts!). Ideally rustc would
switch to not running `dsymutil` by default, but that's a problem left
to get tackled another day.

Closes #79361

3 years agoAuto merge of #81388 - bjorn3:wasm_bindgen_fix, r=nikomatsakis
bors [Thu, 28 Jan 2021 22:01:42 +0000 (22:01 +0000)]
Auto merge of #81388 - bjorn3:wasm_bindgen_fix, r=nikomatsakis

Fix abi for wasm-bindgen

Hopefully fixes https://github.com/rust-lang/rust/issues/81386. `@alexcrichton` can you confirm this fixes wasm-bindgen?

r? `@alexcrichton`

3 years agoAuto merge of #81055 - matthewjasper:non-fatal-overflow, r=nikomatsakis
bors [Thu, 28 Jan 2021 18:57:10 +0000 (18:57 +0000)]
Auto merge of #81055 - matthewjasper:non-fatal-overflow, r=nikomatsakis

Make hitting the recursion limit in projection non-fatal

This change was originally made in #80246 to avoid future (effectively) infinite loop bugs in projections,
but wundergraph relies on rustc recovering here.

cc #80953

r? `@nikomatsakis`

3 years agorustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`
Alex Crichton [Mon, 30 Nov 2020 16:39:08 +0000 (08:39 -0800)]
rustc: Stabilize `-Zrun-dsymutil` as `-Csplit-debuginfo`

This commit adds a new stable codegen option to rustc,
`-Csplit-debuginfo`. The old `-Zrun-dsymutil` flag is deleted and now
subsumed by this stable flag. Additionally `-Zsplit-dwarf` is also
subsumed by this flag but still requires `-Zunstable-options` to
actually activate. The `-Csplit-debuginfo` flag takes one of
three values:

* `off` - This indicates that split-debuginfo from the final artifact is
  not desired. This is not supported on Windows and is the default on
  Unix platforms except macOS. On macOS this means that `dsymutil` is
  not executed.

* `packed` - This means that debuginfo is desired in one location
  separate from the main executable. This is the default on Windows
  (`*.pdb`) and macOS (`*.dSYM`). On other Unix platforms this subsumes
  `-Zsplit-dwarf=single` and produces a `*.dwp` file.

* `unpacked` - This means that debuginfo will be roughly equivalent to
  object files, meaning that it's throughout the build directory
  rather than in one location (often the fastest for local development).
  This is not the default on any platform and is not supported on Windows.

Each target can indicate its own default preference for how debuginfo is
handled. Almost all platforms default to `off` except for Windows and
macOS which default to `packed` for historical reasons.

Some equivalencies for previous unstable flags with the new flags are:

* `-Zrun-dsymutil=yes` -> `-Csplit-debuginfo=packed`
* `-Zrun-dsymutil=no` -> `-Csplit-debuginfo=unpacked`
* `-Zsplit-dwarf=single` -> `-Csplit-debuginfo=packed`
* `-Zsplit-dwarf=split` -> `-Csplit-debuginfo=unpacked`

Note that `-Csplit-debuginfo` still requires `-Zunstable-options` for
non-macOS platforms since split-dwarf support was *just* implemented in
rustc.

There's some more rationale listed on #79361, but the main gist of the
motivation for this commit is that `dsymutil` can take quite a long time
to execute in debug builds and provides little benefit. This means that
incremental compile times appear that much worse on macOS because the
compiler is constantly running `dsymutil` over every single binary it
produces during `cargo build` (even build scripts!). Ideally rustc would
switch to not running `dsymutil` by default, but that's a problem left
to get tackled another day.

Closes #79361

3 years agoAdd missing brace
Oli Scherer [Thu, 28 Jan 2021 16:49:40 +0000 (17:49 +0100)]
Add missing brace

3 years agoSimplify base_expr
Seo Sanghyeon [Thu, 28 Jan 2021 16:44:15 +0000 (01:44 +0900)]
Simplify base_expr

Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
3 years agoFix README typo
Rune Tynan [Thu, 28 Jan 2021 16:15:43 +0000 (11:15 -0500)]
Fix README typo

3 years agoAuto merge of #81441 - tmiasko:ctfe-inline, r=oli-obk
bors [Thu, 28 Jan 2021 15:19:16 +0000 (15:19 +0000)]
Auto merge of #81441 - tmiasko:ctfe-inline, r=oli-obk

Try inlining trivial functions used by CTFE

r? `@ghost`

3 years agoWarn write-only fields
Seo Sanghyeon [Thu, 28 Jan 2021 14:56:13 +0000 (23:56 +0900)]
Warn write-only fields

3 years agoAdd `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lint
Aaron Hill [Mon, 7 Dec 2020 23:55:00 +0000 (18:55 -0500)]
Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lint

cc #79813

This PR adds an allow-by-default future-compatibility lint
`SEMICOLON_IN_EXPRESSIONS_FROM_MACROS`. It fires when a trailing semicolon in a
macro body is ignored due to the macro being used in expression
position:

```rust
macro_rules! foo {
    () => {
        true; // WARN
    }
}

fn main() {
    let val = match true {
        true => false,
        _ => foo!()
    };
}
```

The lint takes its level from the macro call site, and
can be allowed for a particular macro by adding
`#[allow(semicolon_in_expressions_from_macros)]`.

The lint is set to warn for all internal rustc crates (when being built
by a stage1 compiler). After the next beta bump, we can enable
the lint for the bootstrap compiler as well.

3 years agoAuto merge of #81149 - Aaron1011:feature/better-no-method-found-err, r=estebank
bors [Thu, 28 Jan 2021 12:09:50 +0000 (12:09 +0000)]
Auto merge of #81149 - Aaron1011:feature/better-no-method-found-err, r=estebank

Avoid describing a method as 'not found' when bounds are unsatisfied

Fixes #76267

When there is a single applicable method candidate, but its trait bounds
are not satisfied, we avoid saying that the method is "not found".
Insted, we update the error message to directly mention which bounds are
not satisfied, rather than mentioning them in a note.

3 years agoAuto merge of #81461 - JohnTitor:rollup-b0ij25f, r=JohnTitor
bors [Thu, 28 Jan 2021 09:01:33 +0000 (09:01 +0000)]
Auto merge of #81461 - JohnTitor:rollup-b0ij25f, r=JohnTitor

Rollup of 13 pull requests

Successful merges:

 - #70904 (Stabilize `Seek::stream_position` (feature `seek_convenience`))
 - #79951 (Refractor a few more types to `rustc_type_ir` )
 - #80868 (Print failure message on all tests that should panic, but don't)
 - #81062 (Improve diagnostics for Precise Capture)
 - #81277 (Make more traits of the From/Into family diagnostic items)
 - #81284 (Make `-Z time-passes` less noisy)
 - #81379 (Improve URLs handling)
 - #81416 (Tweak suggestion for missing field in patterns)
 - #81426 (const_evaluatable: expand abstract consts in try_unify)
 - #81428 (compiletest: Add two more unit tests)
 - #81430 (add const_evaluatable_checked test)
 - #81433 (const_evaluatable: stop looking into type aliases)
 - #81445 (Update cargo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

3 years agoRollup merge of #81445 - ehuss:update-cargo, r=ehuss
Yuki Okushi [Thu, 28 Jan 2021 06:09:22 +0000 (15:09 +0900)]
Rollup merge of #81445 - ehuss:update-cargo, r=ehuss

Update cargo

7 commits in 783bc43c660bf39c1e562c8c429b32078ad3099b..c3abcfe8a75901c7c701557a728941e8fb19399e
2021-01-20 19:02:26 +0000 to 2021-01-25 16:16:43 +0000
- Minor update to tracking issue template. (rust-lang/cargo#9097)
- Add some extra help to `cargo new` and invalid package names. (rust-lang/cargo#9098)
- Fix compilation with serde 1.0.122 (rust-lang/cargo#9102)
- Add suggestion for bad package id. (rust-lang/cargo#9095)
- Remove Registry::new. (rust-lang/cargo#9093)
- Fix: set default git config search path for tests (rust-lang/cargo#9035)
- Unstable updates (rust-lang/cargo#9092)

3 years agoRollup merge of #81433 - lcnr:stop-looking-into-ty-alias, r=oli-obk
Yuki Okushi [Thu, 28 Jan 2021 06:09:20 +0000 (15:09 +0900)]
Rollup merge of #81433 - lcnr:stop-looking-into-ty-alias, r=oli-obk

const_evaluatable: stop looking into type aliases

see https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/const_evaluatable.3A.20type.20alias

r? ````@oli-obk````

3 years agoRollup merge of #81430 - lcnr:elaborate-const-eval, r=oli-obk
Yuki Okushi [Thu, 28 Jan 2021 06:09:18 +0000 (15:09 +0900)]
Rollup merge of #81430 - lcnr:elaborate-const-eval, r=oli-obk

add const_evaluatable_checked test

cc `````@oli-obk`````

3 years agoRollup merge of #81428 - phansch:compiletest-tests, r=Mark-Simulacrum
Yuki Okushi [Thu, 28 Jan 2021 06:09:17 +0000 (15:09 +0900)]
Rollup merge of #81428 - phansch:compiletest-tests, r=Mark-Simulacrum

compiletest: Add two more unit tests

This adds two more unit tests and fixes spelling in `compiletest`.

3 years agoRollup merge of #81426 - BoxyUwU:boxychangesv2, r=oli-obk
Yuki Okushi [Thu, 28 Jan 2021 06:09:15 +0000 (15:09 +0900)]
Rollup merge of #81426 - BoxyUwU:boxychangesv2, r=oli-obk

const_evaluatable: expand abstract consts in try_unify

See this [zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/combining.20const.20bounds) for more info

cc ```@lcnr```
r? ```@oli-obk```

3 years agoRollup merge of #81416 - estebank:suggestion-span-tweak, r=petrochenkov
Yuki Okushi [Thu, 28 Jan 2021 06:09:13 +0000 (15:09 +0900)]
Rollup merge of #81416 - estebank:suggestion-span-tweak, r=petrochenkov

Tweak suggestion for missing field in patterns

Account for parser recovered struct and tuple patterns to avoid invalid
suggestion.

Follow up to #81103.

3 years agoRollup merge of #81379 - GuillaumeGomez:improve-urls, r=Nemo157
Yuki Okushi [Thu, 28 Jan 2021 06:09:12 +0000 (15:09 +0900)]
Rollup merge of #81379 - GuillaumeGomez:improve-urls, r=Nemo157

Improve URLs handling

Fixes #81330.

Explanations: before this PR, when emptying the search input, we still had `?search=` in the URL, which wasn't very nice. Now, if the search is empty, we drop the `?search=` part.

Also, I realized while working on this PR that when we clicked on a menu link when we were on the search results, the search parameters would look like: `?search=#the-anchor`, which was super weird. Now, it looks like this: `?search=the-search#the-anchor`.

Also, I didn't use the `Url` very nice API because it's not available in any IE version (sadness...).

cc `````@lzutao`````
r? `````@Nemo157`````

3 years agoRollup merge of #81284 - jyn514:impl-times, r=wesleywiser
Yuki Okushi [Thu, 28 Jan 2021 06:09:10 +0000 (15:09 +0900)]
Rollup merge of #81284 - jyn514:impl-times, r=wesleywiser

Make `-Z time-passes` less noisy

- Add the module name to `pre_AST_expansion_passes` and don't make it a
  verbose event (since it normally doesn't take very long, and it's
  emitted many times)
- Don't make the following rustdoc events verbose; they're emitted many times.
  + build_extern_trait_impl
  + build_local_trait_impl
  + build_primitive_trait_impl
  + get_auto_trait_impls
  + get_blanket_trait_impls
- Remove the `get_auto_trait_and_blanket_synthetic_impls` rustdoc event; it's wholly
  covered by get_{auto,blanket}_trait_impls and not very useful.

I found this while working on https://github.com/rust-lang/rust/pull/81275 but it's independent of those changes.

3 years agoRollup merge of #81277 - flip1995:from_diag_items, r=matthewjasper
Yuki Okushi [Thu, 28 Jan 2021 06:09:08 +0000 (15:09 +0900)]
Rollup merge of #81277 - flip1995:from_diag_items, r=matthewjasper

Make more traits of the From/Into family diagnostic items

Following traits are now diagnostic items:
- `From` (unchanged)
- `Into`
- `TryFrom`
- `TryInto`

This also adds symbols for those items:
- `into_trait`
- `try_from_trait`
- `try_into_trait`

Related: https://github.com/rust-lang/rust-clippy/pull/6620#discussion_r562482587

3 years agoRollup merge of #81062 - sexxi-goose:precise_capture_diagnostics, r=nikomatsakis
Yuki Okushi [Thu, 28 Jan 2021 06:09:06 +0000 (15:09 +0900)]
Rollup merge of #81062 - sexxi-goose:precise_capture_diagnostics, r=nikomatsakis

Improve diagnostics for Precise Capture

This is just the capture analysis part and borrow checker logging will updated as part of rust-lang/project-rfc-2229#8

Closes rust-lang/project-rfc-2229#22

3 years agoRollup merge of #80868 - johanngan:should-panic-msg-with-expected, r=m-ou-se
Yuki Okushi [Thu, 28 Jan 2021 06:09:04 +0000 (15:09 +0900)]
Rollup merge of #80868 - johanngan:should-panic-msg-with-expected, r=m-ou-se

Print failure message on all tests that should panic, but don't

Fixes #80861. Tests with the `#[should_panic]` attribute should always print a failure message if no panic occurs, regardless of whether or not an `expected` panic message is specified.

3 years agoRollup merge of #79951 - LeSeulArtichaut:ty-ir, r=nikomatsakis
Yuki Okushi [Thu, 28 Jan 2021 06:09:02 +0000 (15:09 +0900)]
Rollup merge of #79951 - LeSeulArtichaut:ty-ir, r=nikomatsakis

Refractor a few more types to `rustc_type_ir`

In the continuation of #79169, ~~blocked on that PR~~.

This PR:
 - moves `IntVarValue`, `FloatVarValue`, `InferTy` (and friends) and `Variance`
 - creates the `IntTy`, `UintTy` and `FloatTy` enums in `rustc_type_ir`, based on their `ast` and `chalk_ir` equilavents, and uses them for types in the rest of the compiler.

~~I will split up that commit to make this easier to review and to have a better commit history.~~
EDIT: done, I split the PR in commits of 200-ish lines each

r? `````@nikomatsakis````` cc `````@jackh726`````

3 years agoRollup merge of #70904 - LukasKalbertodt:stabilize-seek-convenience, r=m-ou-se
Yuki Okushi [Thu, 28 Jan 2021 06:09:00 +0000 (15:09 +0900)]
Rollup merge of #70904 - LukasKalbertodt:stabilize-seek-convenience, r=m-ou-se

Stabilize `Seek::stream_position` (feature `seek_convenience`)

Tracking issue: #59359

Unresolved questions from tracking issue:
- "Override `stream_len` for `File`?" → we can do that in the future, this does not block stabilization.
- "Rename to `len` and `position`?" → as noted in the tracking issue, both of these shorter names have problems (`len` is usually a cheap getter, `position` clashes with `Cursor`). I do think the current names are perfectly fine.
- "Rename `stream_position` to `tell`?" → as mentioned in [the comment bringing this up](https://github.com/rust-lang/rust/issues/59359#issuecomment-559541545), `stream_position` is more descriptive. I don't think `tell` would be a good name.

What remains to decide, is whether or not adding these methods is worth it.

3 years agorustdoc: Render HRTB correctly for bare functions
Camelid [Sat, 12 Dec 2020 19:33:45 +0000 (11:33 -0800)]
rustdoc: Render HRTB correctly for bare functions

The angle brackets were not rendered, so code like this:

    some_func: for<'a> fn(val: &'a i32) -> i32

would be rendered as:

    some_func: fn'a(val: &'a i32) -> i32

However, rendering with angle brackets is still invalid syntax:

    some_func: fn<'a>(val: &'a i32) -> i32

so now it renders correctly as:

    some_func: for<'a> fn(val: &'a i32) -> i32

-----

However, note that this code:

    some_trait: dyn for<'a> Trait<'a>

will still render as:

    some_trait: dyn Trait<'a>

which is not invalid syntax, but is still unclear. Unfortunately I think
it's hard to fix that case because there isn't enough information in the
`rustdoc::clean::Type` that this code operates on. Perhaps that case can
be fixed in a later PR.

3 years agoFix rustdoc page title text selection
Kasper [Thu, 28 Jan 2021 03:42:27 +0000 (04:42 +0100)]
Fix rustdoc page title text selection

3 years agoAuto merge of #81414 - rylev:fetch-rmeta-crates, r=petrochenkov
bors [Thu, 28 Jan 2021 01:29:47 +0000 (01:29 +0000)]
Auto merge of #81414 - rylev:fetch-rmeta-crates, r=petrochenkov

Check for rmeta crates when getting existing crates from cache

This change makes sure to check for rmeta files when resolving crates instead of always going to disk in that case.

3 years agoAvoid memory allocation when removing dead blocks
Tomasz Miąsko [Thu, 28 Jan 2021 00:00:00 +0000 (00:00 +0000)]
Avoid memory allocation when removing dead blocks

Use `reachable_as_bitset` to reuse a bitset from the traversal rather
than allocating it seprately. Additionally check if there are any
unreachable blocks before proceeding.

3 years agoUpdate crate name and add README
Rune Tynan [Mon, 25 Jan 2021 21:23:43 +0000 (16:23 -0500)]
Update crate name and add README

3 years ago`src/etc/json-types` -> `src/rustdoc-json-types`
Rune Tynan [Sun, 24 Jan 2021 20:42:33 +0000 (15:42 -0500)]
`src/etc/json-types` -> `src/rustdoc-json-types`

3 years agoSimplify conversion
Rune Tynan [Fri, 22 Jan 2021 23:30:01 +0000 (18:30 -0500)]
Simplify conversion

3 years agoMove into src/etc
Rune Tynan [Fri, 22 Jan 2021 22:42:15 +0000 (17:42 -0500)]
Move into src/etc

3 years agoAllow rustc::default_hash_types in the offending statement
Rune Tynan [Fri, 22 Jan 2021 21:46:19 +0000 (16:46 -0500)]
Allow rustc::default_hash_types in the offending statement

3 years agoUpdate cargo.lock
Rune Tynan [Fri, 22 Jan 2021 21:30:44 +0000 (16:30 -0500)]
Update cargo.lock

3 years agoSplit JSON into separately versioned crate
Rune Tynan [Fri, 22 Jan 2021 21:09:24 +0000 (16:09 -0500)]
Split JSON into separately versioned crate

3 years agoAuto merge of #81335 - thomwiggers:no-panic-shrink-to, r=Mark-Simulacrum
bors [Wed, 27 Jan 2021 18:36:32 +0000 (18:36 +0000)]
Auto merge of #81335 - thomwiggers:no-panic-shrink-to, r=Mark-Simulacrum

Trying to shrink_to greater than capacity should be no-op

Per the discussion in https://github.com/rust-lang/rust/issues/56431, `shrink_to` shouldn't panic if you try to make a vector shrink to a capacity greater than its current capacity.

3 years agoUpdate cargo
Eric Huss [Wed, 27 Jan 2021 17:56:34 +0000 (09:56 -0800)]
Update cargo

3 years agoInline MemPlace::offset
Tomasz Miąsko [Wed, 27 Jan 2021 00:00:00 +0000 (00:00 +0000)]
Inline MemPlace::offset

3 years agoInline trivial implementation of rustc_target::abi::Align
Tomasz Miąsko [Wed, 27 Jan 2021 00:00:00 +0000 (00:00 +0000)]
Inline trivial implementation of rustc_target::abi::Align

3 years agofix tidy errors
Ellen [Wed, 27 Jan 2021 15:09:17 +0000 (15:09 +0000)]
fix tidy errors

3 years agocomments
Ellen [Wed, 27 Jan 2021 14:46:43 +0000 (14:46 +0000)]
comments

3 years agoconst_evaluatable: stop looking into type aliases
Bastian Kauschke [Wed, 27 Jan 2021 12:28:52 +0000 (13:28 +0100)]
const_evaluatable: stop looking into type aliases

3 years agoadd const_evaluatable_checked test
Bastian Kauschke [Wed, 27 Jan 2021 11:21:19 +0000 (12:21 +0100)]
add const_evaluatable_checked test

3 years agoAuto merge of #80987 - GuillaumeGomez:remove-cache-key, r=jyn514
bors [Wed, 27 Jan 2021 10:19:51 +0000 (10:19 +0000)]
Auto merge of #80987 - GuillaumeGomez:remove-cache-key, r=jyn514

Remove CACHE_KEY global

We realized in https://github.com/rust-lang/rust/pull/80914 that the cache handling (through a global) needed to be updated to make it much easier to handle.

r? `@jyn514`

3 years agoFix clean/types doc links
Guillaume Gomez [Tue, 26 Jan 2021 10:40:48 +0000 (11:40 +0100)]
Fix clean/types doc links

3 years agoAdd search index test for primitive types
Guillaume Gomez [Sun, 24 Jan 2021 16:41:41 +0000 (17:41 +0100)]
Add search index test for primitive types

3 years agoMore cleanup
Guillaume Gomez [Sun, 24 Jan 2021 16:41:21 +0000 (17:41 +0100)]
More cleanup

3 years agoUnify cache usage and improve naming
Guillaume Gomez [Sun, 24 Jan 2021 00:08:34 +0000 (01:08 +0100)]
Unify cache usage and improve naming

3 years agoImprove documentation on GetDefId trait's methods
Guillaume Gomez [Sat, 23 Jan 2021 22:45:54 +0000 (23:45 +0100)]
Improve documentation on GetDefId trait's methods

3 years agoUpdate to new rustdoc APIs
Guillaume Gomez [Fri, 22 Jan 2021 20:17:32 +0000 (21:17 +0100)]
Update to new rustdoc APIs

3 years agoApply review comments and improve code
Guillaume Gomez [Thu, 21 Jan 2021 20:54:14 +0000 (21:54 +0100)]
Apply review comments and improve code

3 years agoRemove cache usage wherever possible
Guillaume Gomez [Fri, 15 Jan 2021 14:36:15 +0000 (15:36 +0100)]
Remove cache usage wherever possible

3 years agoUse empty Cache for methods requiring it when filling Cache itself
Guillaume Gomez [Wed, 13 Jan 2021 21:06:41 +0000 (22:06 +0100)]
Use empty Cache for methods requiring it when filling Cache itself

3 years agoRemove CACHE_KEY global
Guillaume Gomez [Tue, 12 Jan 2021 22:36:04 +0000 (23:36 +0100)]
Remove CACHE_KEY global

3 years agocompiletest: Add two more unit tests
Philipp Hansch [Wed, 27 Jan 2021 07:10:35 +0000 (08:10 +0100)]
compiletest: Add two more unit tests

3 years agoAuto merge of #79591 - estebank:unexpected-generics, r=oli-obk
bors [Wed, 27 Jan 2021 07:15:33 +0000 (07:15 +0000)]
Auto merge of #79591 - estebank:unexpected-generics, r=oli-obk

Point only at generic arguments when they are unexpected

3 years agoAvoid describing a method as 'not found' when bounds are unsatisfied
Aaron Hill [Sat, 26 Sep 2020 21:20:14 +0000 (17:20 -0400)]
Avoid describing a method as 'not found' when bounds are unsatisfied

Fixes #76267

When there is a single applicable method candidate, but its trait bounds
are not satisfied, we avoid saying that the method is "not found".
Insted, we update the error message to directly mention which bounds are
not satisfied, rather than mentioning them in a note.

3 years agoboop, ur abstract consts are now expanded
Ellen [Wed, 27 Jan 2021 02:42:18 +0000 (02:42 +0000)]
boop, ur abstract consts are now expanded

3 years agoAuto merge of #81393 - pnkfelix:issue-81296-make-weak-item-traversal-deterministic...
bors [Wed, 27 Jan 2021 00:19:45 +0000 (00:19 +0000)]
Auto merge of #81393 - pnkfelix:issue-81296-make-weak-item-traversal-deterministic, r=estebank

Make weak item traversal deterministic

Fix #81296.

(No test added. The relevant test *is* ui/panic-handler/weak-lang-item.rs, and this change should make it less flaky.)

3 years agoVisit only statements in always live locals
Tomasz Miąsko [Wed, 27 Jan 2021 00:00:00 +0000 (00:00 +0000)]
Visit only statements in always live locals

No functional changes intended.

3 years agoPoint only at generic arguments when they are unexpected
Esteban Küber [Tue, 1 Dec 2020 08:40:28 +0000 (00:40 -0800)]
Point only at generic arguments when they are unexpected