]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agouse strict provenance APIs
Ralf Jung [Sun, 5 Jun 2022 15:44:12 +0000 (11:44 -0400)]
use strict provenance APIs

2 years agoAuto merge of #97697 - WaffleLapkin:no_ref_vec, r=WaffleLapkin
bors [Sun, 5 Jun 2022 09:30:53 +0000 (09:30 +0000)]
Auto merge of #97697 - WaffleLapkin:no_ref_vec, r=WaffleLapkin

Replace `&Vec<_>`s with `&[_]`s

It's generally preferable to use `&[_]` since it's one less indirection and it can be created from types other that `Vec`.

I've left `&Vec` in some locals where it doesn't really matter, in cases where `TypeFoldable` is expected (`TypeFoldable: Clone` so slice can't implement it) and in cases where it's `&TypeAliasThatIsActiallyVec`. Nothing important, really, I was just a little annoyed by `visit_generic_param_vec` :D

r? `@compiler-errors`

2 years agoRename `visit_generic_param{_slice => s}`
Maybe Waffle [Sun, 5 Jun 2022 09:12:31 +0000 (13:12 +0400)]
Rename `visit_generic_param{_slice => s}`

2 years agoAuto merge of #97577 - betrusted-io:add-xous-target, r=nagisa
bors [Sun, 5 Jun 2022 07:03:50 +0000 (07:03 +0000)]
Auto merge of #97577 - betrusted-io:add-xous-target, r=nagisa

riscv32imac-unknown-xous-elf: add target

This PR starts the process of upstreaming support for our operating system, thanks to a suggestion from `@yaahc` [on Twitter](https://twitter.com/yaahc_/status/1530558574706839567?s=20&t=Mgkn1LEYvGU6FEi5SpZRsA). We have maintained a fork of Rust and have made changes to improve support for our platform since Rust 1.51. Now we would like to upstream these changes.

Xous is a microkernel operating system designed to run on small systems. The kernel contains a wide range of userspace processes that provide common services such as console output, networking, and time access.

The kernel and its services are completely written in Rust using a custom build of libstd. This adds support for this target to upstream Rust so that we can drop support for our out-of-tree `target.json` file.

This first patch adds a Tier 3 target for Xous running on RISC-V. Future patches will add libstd support, but those patches require changes to `dlmalloc` and `compiler_builtins`.

> Tier 3 policy:
>
> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

I will be the target maintainer for this target on matters that pertain to the `xous` part of the triple. For matters pertaining to the `riscv32imac` part of the triple, there should be no difference from all other `riscv` targets. If there are issues, I will address issues regarding the target.

> Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

This is a new OS, so I have taken the `riscv32imac-unknown-none-elf` target and changed the `os` section of the triple. This follows convention on targets such as `riscv32gc-unknown-linux-gnu` and `mipsel-unknown-linux-uclibc`. An argument could be made for omitting the `-elf` section of the triple, such as `riscv32imc-esp-espidf`, however I'm not certain what benefit that has.

> Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it.

I feel that the target name does not introduce any ambiguity.

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

The only unusual requirement for building the `compiler-builtins` crate is a standard RISC-V C compiler supported by `cc-rs`, and using this target does not require any additional software beyond what is shipped by `rustup`.

> The target must not introduce license incompatibilities.

All of the additional code will use Apache-2.0.

> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).

Agreed, and there is no problem here.

> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements.

The only new dependency will be the `xous` crate, which is licensed `MIT OR Apache-2.0`

> Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3.

Linking is performed by `rust-lld`

> "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users.

There are no terms. Xous is completely open. It runs on open hardware. We even provide the source to the CPU.

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

This paragraph makes sense, but I don't think it's directed at me.

> This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements.

This paragraph also does not appear to be directed at me.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

So far we have:

 * Thread
 * Mutexex
 * Condvar
 * TcpStream
 * TcpListener
 * UdpSocket
 * DateTime
 * alloc

These will be merged as part of libstd in a future patch once I submit support for Xous in `dlmalloc` and `compiler-builtins`.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

Testing is currently done on real hardware or in a Renode emulator. I can add documentation on how to do this in a future patch, and I would need instructions on where to add said documentation.

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

Alright.

> Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications.

Sounds good.

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

This shouldn't affect any other targets, so this is understood.

> In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target.

This shouldn't come up right away. `xous` is a new operating system, and most features are keyed off of `target(os = "xous")` rather than a given architecture.

2 years agoAuto merge of #97391 - Urgau:cfg_accessible, r=petrochenkov
bors [Sun, 5 Jun 2022 04:16:03 +0000 (04:16 +0000)]
Auto merge of #97391 - Urgau:cfg_accessible, r=petrochenkov

Handle more cases in cfg_accessible

This PR tries to handle more cases in the cfg_accessible implementation by only emitting a "not sure" error only if we have partially resolved a path.

This PR also adds many tests for the "not sure" cases and for private items.

r? `@petrochenkov`

2 years agoAuto merge of #93717 - pietroalbini:pa-ci-profiler, r=Mark-Simulacrum
bors [Sun, 5 Jun 2022 01:35:03 +0000 (01:35 +0000)]
Auto merge of #93717 - pietroalbini:pa-ci-profiler, r=Mark-Simulacrum

Add build metrics to rustbuild

This PR adds a new module of rustbuild, `ci_profiler`, whose job is to gather as much information as possible about the CI build as possible and store it in a JSON file uploaded to `ci-artifacts`. Right now for each step it collects:

* Type name and debug representation of the `Step` object.
* Duration of the step (excluding child steps).
* Systemwide CPU stats for the duration of the step (both single core and all cores).
* Which child steps were executed.

This is capable of replacing both the scripts to collect CPU stats and the `[TIMING]` lines in build logs (not yet removed, until we port our tooling to use the CI profiler). The format is also extensible to be able in the future to collect more information.

r? `@Mark-Simulacrum`

2 years agoAuto merge of #97742 - matthiaskrgr:rollup-fr3j0t8, r=matthiaskrgr
bors [Sat, 4 Jun 2022 23:14:09 +0000 (23:14 +0000)]
Auto merge of #97742 - matthiaskrgr:rollup-fr3j0t8, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #97609 (Iterate over `maybe_unused_trait_imports` when checking dead trait imports)
 - #97688 (test const_copy to make sure bytewise pointer copies are working)
 - #97707 (Improve soundness of rustc_data_structures)
 - #97731 (Add regresion test for #87142)
 - #97735 (Don't generate "Impls on Foreign Types" for std)
 - #97737 (Fix pretty printing named bound regions under -Zverbose)

Failed merges:

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

2 years agoRollup merge of #97737 - jackh726:verbose-pretty-printing-fix, r=compiler-errors
Matthias Krüger [Sat, 4 Jun 2022 21:42:04 +0000 (23:42 +0200)]
Rollup merge of #97737 - jackh726:verbose-pretty-printing-fix, r=compiler-errors

Fix pretty printing named bound regions under -Zverbose

Fixed regression introduced in #97023

r? `@compiler-errors`

cc `@cjgillot`

2 years agoRollup merge of #97735 - jsha:no-foreign-std, r=GuillaumeGomez
Matthias Krüger [Sat, 4 Jun 2022 21:42:03 +0000 (23:42 +0200)]
Rollup merge of #97735 - jsha:no-foreign-std, r=GuillaumeGomez

Don't generate "Impls on Foreign Types" for std

Hack: many traits and types in std are re-exported from core or alloc. In general, rustdoc is capable of recognizing these implementations as being on local types. However, in at least one case, rustdoc gets confused and labels an implementation as being on a foreign type. To make sure that confusion doesn't pass on to the reader, consider all implementations in std, core, and alloc to be on local types.

Demo: https://rustdoc.crud.net/jsha/no-foreign-std/std/clone/trait.Clone.html

2 years agoRollup merge of #97731 - JohnTitor:issue-87142, r=compiler-errors
Matthias Krüger [Sat, 4 Jun 2022 21:42:03 +0000 (23:42 +0200)]
Rollup merge of #97731 - JohnTitor:issue-87142, r=compiler-errors

Add regresion test for #87142

Closes #87142
r? `@compiler-errors`

2 years agoRollup merge of #97707 - Nilstrieb:data-structures-ub, r=cjgillot
Matthias Krüger [Sat, 4 Jun 2022 21:42:02 +0000 (23:42 +0200)]
Rollup merge of #97707 - Nilstrieb:data-structures-ub, r=cjgillot

Improve soundness of rustc_data_structures

Make it runnable in miri by adding some ignores and changing N in miri. Also fix a stacked borrows issue in sip128.

2 years agoRollup merge of #97688 - RalfJung:test-const-cpy, r=Mark-Simulacrum
Matthias Krüger [Sat, 4 Jun 2022 21:42:01 +0000 (23:42 +0200)]
Rollup merge of #97688 - RalfJung:test-const-cpy, r=Mark-Simulacrum

test const_copy to make sure bytewise pointer copies are working

This is non-trivial; for `swap_nonoverlapping`, this is [not working](https://github.com/rust-lang/rust/issues/83163#issuecomment-1145917372).

2 years agoRollup merge of #97609 - Elliot-Roberts:unused-trait-refactor, r=cjgillot
Matthias Krüger [Sat, 4 Jun 2022 21:42:00 +0000 (23:42 +0200)]
Rollup merge of #97609 - Elliot-Roberts:unused-trait-refactor, r=cjgillot

Iterate over `maybe_unused_trait_imports` when checking dead trait imports

Closes #96873
r? `@cjgillot`

Some questions, if you have time:

- Is there a way to shorten the `rustc_data_structures::fx::FxIndexSet` path in the query declaration? I wasn't sure where to put a `use`.
- Was returning by reference from the query the right choice here?
- How would I go about evaluating the importance of the `is_dummy()` call in `check_crate`? I don't see failing tests when I comment it out. Should I just try to determine whether dummy spans can ever be put into `maybe_unused_trait_imports`?
- Am I doing anything silly with the various ID types?
- Is that `let-else` with `unreachable!()` bad? (i.e is there a better idiom? Would `panic!("<explanation>")` be better?)
- If I want to evaluate the perf of using a `Vec` as mentioned in #96873, is the best way to use the CI or is it feasible locally?

Thanks :)

2 years agoFix pretty printing named bound regions under -Zverbose
Jack Huey [Sat, 4 Jun 2022 18:31:17 +0000 (14:31 -0400)]
Fix pretty printing named bound regions under -Zverbose

2 years agoAuto merge of #97191 - wesleywiser:main_thread_name, r=ChrisDenton
bors [Sat, 4 Jun 2022 20:27:53 +0000 (20:27 +0000)]
Auto merge of #97191 - wesleywiser:main_thread_name, r=ChrisDenton

Call the OS function to set the main thread's name on program init

Normally, `Thread::spawn` takes care of setting the thread's name, if
one was provided, but since the main thread wasn't created by calling
`Thread::spawn`, we need to call that function in `std::rt::init`.

This is mainly useful for system tools like debuggers and profilers
which might show the thread name to a user. Prior to these changes, gdb
and WinDbg would show all thread names except the main thread's name to
a user. I've validated that this patch resolves the issue for both
debuggers.

2 years agoIterate over `maybe_unused_trait_imports` when checking dead trait imports
Elliot Roberts [Tue, 31 May 2022 23:59:28 +0000 (16:59 -0700)]
Iterate over `maybe_unused_trait_imports` when checking dead trait imports

2 years agoDon't generate "Impls on Foreign Types" for std
Jacob Hoffman-Andrews [Sat, 4 Jun 2022 18:03:45 +0000 (11:03 -0700)]
Don't generate "Impls on Foreign Types" for std

Hack: many traits and types in std are re-exported from core or alloc. In
general, rustdoc is capable of recognizing these implementations as being
on local types. However, in at least one case, rustdoc gets confused and
labels an implementation as being on a foreign type. To make sure that
confusion doesn't pass on to the reader, consider all implementations in
std, core, and alloc to be on local types.

2 years agoAuto merge of #97529 - Urgau:bootstrap-check-cfg-features, r=Mark-Simulacrum
bors [Sat, 4 Jun 2022 17:47:14 +0000 (17:47 +0000)]
Auto merge of #97529 - Urgau:bootstrap-check-cfg-features, r=Mark-Simulacrum

Use new cargo argument in bootstrap for cfg checking

This PR use new cargo argument in bootstrap for doing cfg checking.

Follow-up to https://github.com/rust-lang/rust/pull/97044 and https://github.com/rust-lang/rust/pull/97214.

r? `@Mark-Simulacrum`

2 years agobump sysinfo version
Pietro Albini [Sat, 4 Jun 2022 16:59:07 +0000 (18:59 +0200)]
bump sysinfo version

2 years agoFix stacked borrows invalidation in rustc_data_structures sip128
Nilstrieb [Fri, 3 Jun 2022 20:03:21 +0000 (22:03 +0200)]
Fix stacked borrows invalidation in rustc_data_structures sip128

It creates the src pointer first, which is then invalidated by a
unique borrow of the destination pointer. Swap the borrows around
to fix this. Found with miri.

2 years agoAdapt rustc_data_structures tests to run in strict miri
Nilstrieb [Fri, 3 Jun 2022 20:01:56 +0000 (22:01 +0200)]
Adapt rustc_data_structures tests to run in strict miri

Some tests took too long and owning_ref is fundamentally flawed,
so don't run these tests or run them with a shorter N. This makes
miri with `-Zmiri-strict-provenance` usable to find UB.

2 years agoAuto merge of #97137 - Kobzol:ci-llvm-pgo-pid, r=Mark-Simulacrum
bors [Sat, 4 Jun 2022 14:30:36 +0000 (14:30 +0000)]
Auto merge of #97137 - Kobzol:ci-llvm-pgo-pid, r=Mark-Simulacrum

Add PID to LLVM PGO profile path

This is a continuation of https://github.com/rust-lang/rust/pull/97110, which adds PID to the filename pattern of LLVM profiles. It also adds some metrics to the pgo.sh script, so that we can observe how many profiles there are and how large are they.

r? `@lqd`

2 years agoUpdate src/test/debuginfo/thread-names.rs
Wesley Wiser [Fri, 3 Jun 2022 15:36:54 +0000 (11:36 -0400)]
Update src/test/debuginfo/thread-names.rs

Co-authored-by: Chris Denton <ChrisDenton@users.noreply.github.com>
2 years agoAdd regresion test for #87142
Yuki Okushi [Sat, 4 Jun 2022 12:17:34 +0000 (21:17 +0900)]
Add regresion test for #87142

2 years agoAuto merge of #97729 - Dylan-DPC:rollup-dv43xo9, r=Dylan-DPC
bors [Sat, 4 Jun 2022 11:29:29 +0000 (11:29 +0000)]
Auto merge of #97729 - Dylan-DPC:rollup-dv43xo9, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #96642 (Avoid zero-sized allocs in ThinBox if T and H are both ZSTs.)
 - #97647 (Lazily allocate and initialize pthread locks.)
 - #97715 (Support the `#[expect]` attribute on fn parameters (RFC-2383))
 - #97716 (Fix reachability analysis for const methods)
 - #97722 (Tighten spans for bad fields in struct deriving `Copy`)

Failed merges:

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

2 years agotest: add `xous` to well-known-values.stderr
Sean Cross [Tue, 31 May 2022 08:56:40 +0000 (16:56 +0800)]
test: add `xous` to well-known-values.stderr

Signed-off-by: Sean Cross <sean@xobs.io>
2 years agoplatform-support: add riscv32imac-unknown-xous-elf
Sean Cross [Tue, 31 May 2022 08:38:25 +0000 (16:38 +0800)]
platform-support: add riscv32imac-unknown-xous-elf

Signed-off-by: Sean Cross <sean@xobs.io>
2 years agoriscv32imac-unknown-xous-elf: add target
Sean Cross [Tue, 31 May 2022 08:15:40 +0000 (16:15 +0800)]
riscv32imac-unknown-xous-elf: add target

Xous is a microkernel operating system designed to run on small systems.
The kernel contains a wide range of userspace processes that provide
common services such as console output, networking, and time access.

The kernel and its services are completely written in Rust using a
custom build of libstd. This adds support for this target to upstream
Rust so that we can drop support for our out-of-tree `target.json` file.

Add a Tier 3 target for Xous running on RISC-V.

Signed-off-by: Sean Cross <sean@xobs.io>
2 years agoRollup merge of #97722 - compiler-errors:tighten-copy-type-error-spans, r=Dylan-DPC
Dylan DPC [Sat, 4 Jun 2022 09:06:42 +0000 (11:06 +0200)]
Rollup merge of #97722 - compiler-errors:tighten-copy-type-error-spans, r=Dylan-DPC

Tighten spans for bad fields in struct deriving `Copy`

r? `@estebank`

Closes #89137 for good, I think

Not sure if this is what you were looking for in https://github.com/rust-lang/rust/issues/89137#issuecomment-1146201791

2 years agoRollup merge of #97716 - compiler-errors:issue-97708, r=wesleywiser
Dylan DPC [Sat, 4 Jun 2022 09:06:42 +0000 (11:06 +0200)]
Rollup merge of #97716 - compiler-errors:issue-97708, r=wesleywiser

Fix reachability analysis for const methods

Use `method_might_be_inlined` directly for `ImplItemKind::Fn` instead of duplicating the logic in `def_id_represents_local_inlined_item`.

This is parallel to how we use `item_might_be_inlined` for `ItemKind::Fn` in that same body.

Fixes #97708

2 years agoRollup merge of #97715 - xFrednet:97650-expect-in-fuction-arg, r=wesleywiser
Dylan DPC [Sat, 4 Jun 2022 09:06:41 +0000 (11:06 +0200)]
Rollup merge of #97715 - xFrednet:97650-expect-in-fuction-arg, r=wesleywiser

Support the `#[expect]` attribute on fn parameters (RFC-2383)

A small PR to allow the `#[expect]` attribute on function parameters.

Nothing more to say, I hope everyone reading this has a lovely day.

---

r? ``@wesleywiser``

closes: https://github.com/rust-lang/rust/issues/97650

cc: https://github.com/rust-lang/rust/issues/85549

2 years agoRollup merge of #97647 - m-ou-se:lazy-box-locks, r=Amanieu
Dylan DPC [Sat, 4 Jun 2022 09:06:40 +0000 (11:06 +0200)]
Rollup merge of #97647 - m-ou-se:lazy-box-locks, r=Amanieu

Lazily allocate and initialize pthread locks.

Lazily allocate and initialize pthread locks.

This allows {Mutex, Condvar, RwLock}::new() to be const, while still using the platform's native locks for features like priority inheritance and debug tooling. E.g. on macOS, we cannot directly use the (private) APIs that pthread's locks are implemented with, making it impossible for us to use anything other than pthread while still preserving priority inheritance, etc.

This PR doesn't yet make the public APIs const. That's for a separate PR with an FCP.

Tracking issue: https://github.com/rust-lang/rust/issues/93740

2 years agoRollup merge of #96642 - thomcc:thinbox-zst-ugh, r=yaahc
Dylan DPC [Sat, 4 Jun 2022 09:06:39 +0000 (11:06 +0200)]
Rollup merge of #96642 - thomcc:thinbox-zst-ugh, r=yaahc

Avoid zero-sized allocs in ThinBox if T and H are both ZSTs.

This was surprisingly tricky, and took longer to get right than expected. `ThinBox` is a surprisingly subtle piece of code. That said, in the end, a lot of this was due to overthinking[^overthink] -- ultimately the fix ended up fairly clean and simple.

[^overthink]: Honestly, for a while I was convinced this couldn't be done without allocations or runtime branches in these cases, but that's obviously untrue.

Anyway, as a result of spending all that time debugging, I've extended the tests quite a bit, and also added more debug assertions. Many of these helped for subtle bugs I made in the middle (for example, the alloc/drop tracking is because I ended up double-dropping the value in the case where both were ZSTs), they're arguably a bit of overkill at this point, although I imagine they could help in the future too.

Anyway, these tests cover a wide range of size/align cases, nd fully pass under miri[^1]. They also do some smoke-check asserting that the value has the correct alignment, although in practice it's totally within the compiler's rights to delete these assertions since we'd have already done UB if they get hit. They have more boilerplate than they really need, but it's not *too* bad on a per-test basis.

A notable absence from testing is atypical header types, but at the moment it's impossible to manually implement `Pointee`. It would be really nice to have testing here, since it's not 100% obvious to me that the aligned read/write we use for `H` are correct in the face of arbitrary combinations of `size_of::<H>()`, `align_of::<H>()`, and `align_of::<T>()`. (That said, I spent a while thinking through it and am *pretty* sure it's fine -- I'd just feel... better if we could test some cases for non-ZST headers which have unequal and align).

[^1]: Or at least, they pass under miri if I copy the code and tests into a new crate and run miri on it (after making it less stdlibified).

Fixes #96485.

I'd request review ``@yaahc,`` but I believe you're taking some time away from reviews, so I'll request from the previous PR's reviewer (I think that the context helps, even if the actual change didn't end up being bad here).

r? ``@joshtriplett``

2 years agoAuto merge of #97690 - nikic:update-llvm-4, r=cuviper
bors [Sat, 4 Jun 2022 08:48:32 +0000 (08:48 +0000)]
Auto merge of #97690 - nikic:update-llvm-4, r=cuviper

Update LLVM submodule

Merge upstream release/14.x branch.

Fixes #97428.

2 years agoAuto merge of #97604 - nnethercote:inline-bridge-Buffer-methods, r=eddyb
bors [Sat, 4 Jun 2022 04:51:26 +0000 (04:51 +0000)]
Auto merge of #97604 - nnethercote:inline-bridge-Buffer-methods, r=eddyb

Inline `bridge::Buffer` methods.

This fixes a performance regression caused by making `Buffer`
non-generic in #97004.

r? `@eddyb`

2 years agoTighten spans for bad fields in Copy struct
Michael Goulet [Sat, 4 Jun 2022 02:17:12 +0000 (19:17 -0700)]
Tighten spans for bad fields in Copy struct

2 years agoAuto merge of #97717 - matthiaskrgr:rollup-lalaii2, r=matthiaskrgr
bors [Sat, 4 Jun 2022 02:10:35 +0000 (02:10 +0000)]
Auto merge of #97717 - matthiaskrgr:rollup-lalaii2, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #97446 (Make hir().get_generics and generics_of consistent.)
 - #97656 (Add a suggestion to replace parentheses with angle brackets on associated trait constraint)
 - #97692 (Add `#T-types/nominated` zulip notification)
 - #97696 (Do not ICE when failing to normalize during inlining.)
 - #97702 (Remove useless LocalDefId in ImplTraitContext::Universal.)

Failed merges:

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

2 years agoEncode MIR for 'unreachable' non-generic fns
Michael Goulet [Fri, 3 Jun 2022 22:21:57 +0000 (15:21 -0700)]
Encode MIR for 'unreachable' non-generic fns

2 years agoAuto merge of #97670 - spastorino:simplify-universal-impl-trait-lowering2, r=Dylan-DPC
bors [Fri, 3 Jun 2022 23:29:30 +0000 (23:29 +0000)]
Auto merge of #97670 - spastorino:simplify-universal-impl-trait-lowering2, r=Dylan-DPC

Make params be SmallVec as originally was

r? `@cjgillot`
It was originally a [`SmallVec`](https://github.com/rust-lang/rust/pull/97598/files#diff-0a61b538a3cec072c76fecae4635af6a12ec3256860029ac70549c2aa53ab394L1497), I've mistakenly changed it [here](https://github.com/rust-lang/rust/pull/97598/files#diff-0a61b538a3cec072c76fecae4635af6a12ec3256860029ac70549c2aa53ab394R1377) to a `Vec`

2 years agoSupport the `#[expect]` attribute on fn parameters (RFC-2383)
xFrednet [Fri, 3 Jun 2022 22:04:19 +0000 (00:04 +0200)]
Support the `#[expect]` attribute on fn parameters (RFC-2383)

2 years agoRollup merge of #97702 - cjgillot:no-universal-did, r=spastorino
Matthias Krüger [Fri, 3 Jun 2022 22:42:52 +0000 (00:42 +0200)]
Rollup merge of #97702 - cjgillot:no-universal-did, r=spastorino

Remove useless LocalDefId in ImplTraitContext::Universal.

2 years agoRollup merge of #97696 - cjgillot:normalize-inline, r=compiler-errors
Matthias Krüger [Fri, 3 Jun 2022 22:42:51 +0000 (00:42 +0200)]
Rollup merge of #97696 - cjgillot:normalize-inline, r=compiler-errors

Do not ICE when failing to normalize during inlining.

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

2 years agoRollup merge of #97692 - compiler-errors:types-nominated, r=Mark-Simulacrum
Matthias Krüger [Fri, 3 Jun 2022 22:42:50 +0000 (00:42 +0200)]
Rollup merge of #97692 - compiler-errors:types-nominated, r=Mark-Simulacrum

Add `#T-types/nominated` zulip notification

Add rule to create topic in aforementioned stream when `I-types-nominated` tag is added

2 years agoRollup merge of #97656 - EdwinRy:error_ast_low_type_contraint_parentheses, r=cjgillot
Matthias Krüger [Fri, 3 Jun 2022 22:42:50 +0000 (00:42 +0200)]
Rollup merge of #97656 - EdwinRy:error_ast_low_type_contraint_parentheses, r=cjgillot

Add a suggestion to replace parentheses with angle brackets on associated trait constraint

This implements a requested suggestion FIXME in [`compiler/rustc_ast_lowering/src/lib.rs` ](https://github.com/rust-lang/rust/blob/9598b4b594c97dff66feb93522e22db500deea07/compiler/rustc_ast_lowering/src/lib.rs#L921)

The suggestion asks for the parentheses to either be replaced with angle brackets or removed completely depending on whether there are arguments provided within.

![image](https://user-images.githubusercontent.com/20026256/171770414-ab60bfe2-ae27-44b0-964d-9ffcc32a7475.png)

![image](https://user-images.githubusercontent.com/20026256/171770383-ca8a2766-b3aa-43e3-8ba4-ae18874886ce.png)

r? `@oli-obk`

2 years agoRollup merge of #97446 - cjgillot:get-generics, r=michaelwoerister
Matthias Krüger [Fri, 3 Jun 2022 22:42:49 +0000 (00:42 +0200)]
Rollup merge of #97446 - cjgillot:get-generics, r=michaelwoerister

Make hir().get_generics and generics_of consistent.

Fetching generics from a HIR node is currently implemented differently in 4 different places.
This PR makes the 4 implementations call the single `hir::Node::generics`, which implements the more general version from `generics_of` query.

2 years agoMake hir().get_generics and generics_of consistent.
Camille GILLOT [Fri, 27 May 2022 07:35:28 +0000 (09:35 +0200)]
Make hir().get_generics and generics_of consistent.

2 years agoAuto merge of #95833 - notriddle:notriddle/human-readable-signals, r=yaahc
bors [Fri, 3 Jun 2022 20:18:14 +0000 (20:18 +0000)]
Auto merge of #95833 - notriddle:notriddle/human-readable-signals, r=yaahc

std: `<ExitStatus as Display>::fmt` name the signal it died from

Related to #95601

2 years agoRemove useless LocalDefId in ImplTraitContext::Universal.
Camille GILLOT [Fri, 3 Jun 2022 18:17:12 +0000 (20:17 +0200)]
Remove useless LocalDefId in ImplTraitContext::Universal.

2 years agoAuto merge of #85993 - bjorn3:serde_json, r=wesleywiser
bors [Fri, 3 Jun 2022 17:55:02 +0000 (17:55 +0000)]
Auto merge of #85993 - bjorn3:serde_json, r=wesleywiser

Remove all json handling from rustc_serialize

Json is now handled using serde_json. Where appropriate I have replaced json usage with binary serialization (rmeta files) or manual string formatting (emcc linker arg generation).

This allowed for removing and simplifying a lot of code, which hopefully results in faster serialization/deserialization and faster compiles of rustc itself.

Where sensible we now use serde. Metadata and incr cache serialization keeps using a heavily modified (compared to crates.io) rustc-serialize version that in the future could probably be extended with zero-copy deserialization or other perf tricks that serde can't support due to supporting more than one serialization format.

Note that I had to remove `-Zast-json` and `-Zast-json-noexpand` as the relevant AST types don't implement `serde::Serialize`.

Fixes #40177

See also https://github.com/rust-lang/compiler-team/issues/418

2 years agoDo not ICE when failing to normalize during inlining.
Camille GILLOT [Fri, 3 Jun 2022 16:44:46 +0000 (18:44 +0200)]
Do not ICE when failing to normalize during inlining.

2 years agoFix emscripten linker invocation
bjorn3 [Fri, 6 May 2022 15:20:42 +0000 (17:20 +0200)]
Fix emscripten linker invocation

2 years agoFix all tests
bjorn3 [Thu, 5 May 2022 16:34:13 +0000 (18:34 +0200)]
Fix all tests

2 years agoRemove emit_unit
bjorn3 [Fri, 4 Jun 2021 16:32:00 +0000 (18:32 +0200)]
Remove emit_unit

It doesn't do anything for all encoders

2 years agoInline many methods of Encoder
bjorn3 [Fri, 4 Jun 2021 16:23:50 +0000 (18:23 +0200)]
Inline many methods of Encoder

They aren't overridden anyway

2 years agoRemove all names from Encoder
bjorn3 [Fri, 4 Jun 2021 15:33:26 +0000 (17:33 +0200)]
Remove all names from Encoder

They aren't used anymore now that the json format has been removed

2 years agoRemove json support from rustc_serialize
bjorn3 [Fri, 4 Jun 2021 14:37:15 +0000 (16:37 +0200)]
Remove json support from rustc_serialize

2 years agoRemove support for -Zast-json and -Zast-json-noexpand
bjorn3 [Fri, 4 Jun 2021 14:36:40 +0000 (16:36 +0200)]
Remove support for -Zast-json and -Zast-json-noexpand

2 years agoAvoid rustc_serialize in linker.rs
bjorn3 [Fri, 4 Jun 2021 14:35:19 +0000 (16:35 +0200)]
Avoid rustc_serialize in linker.rs

2 years agoUse serde_json for json error messages
bjorn3 [Thu, 3 Jun 2021 19:14:15 +0000 (21:14 +0200)]
Use serde_json for json error messages

2 years agoUse serde_json for target spec json
bjorn3 [Thu, 3 Jun 2021 15:45:09 +0000 (17:45 +0200)]
Use serde_json for target spec json

2 years agoRemove a couple of unused Encodable and Decodable derives
bjorn3 [Thu, 3 Jun 2021 09:16:05 +0000 (11:16 +0200)]
Remove a couple of unused Encodable and Decodable derives

2 years agoReplace `&Vec<_>`s with `&[_]`s
Maybe Waffle [Fri, 3 Jun 2022 16:42:42 +0000 (20:42 +0400)]
Replace `&Vec<_>`s with `&[_]`s

2 years agoSuggest replace parentheses with angle brackets
EdwinRy [Thu, 2 Jun 2022 17:22:25 +0000 (18:22 +0100)]
Suggest replace parentheses with angle brackets

2 years agoAuto merge of #97694 - Dylan-DPC:rollup-2yxo7ce, r=Dylan-DPC
bors [Fri, 3 Jun 2022 15:26:06 +0000 (15:26 +0000)]
Auto merge of #97694 - Dylan-DPC:rollup-2yxo7ce, r=Dylan-DPC

Rollup of 3 pull requests

Successful merges:

 - #97415 (Compute `is_late_bound_map` query separately from lifetime resolution)
 - #97471 (Provide more context when denying invalid type params )
 - #97681 (Add more eslint checks)

Failed merges:

 - #97446 (Make hir().get_generics and generics_of consistent.)

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

2 years agoRollup merge of #97681 - GuillaumeGomez:more-eslint, r=Dylan-DPC
Dylan DPC [Fri, 3 Jun 2022 15:10:53 +0000 (17:10 +0200)]
Rollup merge of #97681 - GuillaumeGomez:more-eslint, r=Dylan-DPC

Add more eslint checks

A new batch of eslint rules:

 * [no-fallthrough](https://eslint.org/docs/rules/no-fallthrough)
 * [no-invalid-regexp](https://eslint.org/docs/rules/no-invalid-regexp)
 * [no-import-assign](https://eslint.org/docs/rules/no-import-assign)
 * [no-self-compare](https://eslint.org/docs/rules/no-self-compare)
 * [no-template-curly-in-string](https://eslint.org/docs/rules/no-template-curly-in-string)
 * [block-scoped-var](https://eslint.org/docs/rules/block-scoped-var)
 * [guard-for-in](https://eslint.org/docs/rules/guard-for-in)
 * [no-alert](https://eslint.org/docs/rules/no-alert)

r? ``@notriddle``

2 years agoRollup merge of #97471 - estebank:prohibit-generics, r=cjgillot
Dylan DPC [Fri, 3 Jun 2022 15:10:52 +0000 (17:10 +0200)]
Rollup merge of #97471 - estebank:prohibit-generics, r=cjgillot

Provide more context when denying invalid type params

2 years agoRollup merge of #97415 - cjgillot:is-late-bound-solo, r=estebank
Dylan DPC [Fri, 3 Jun 2022 15:10:51 +0000 (17:10 +0200)]
Rollup merge of #97415 - cjgillot:is-late-bound-solo, r=estebank

Compute `is_late_bound_map` query separately from lifetime resolution

This query is actually very simple, and is only useful for functions and method.  It can be computed directly by fetching the HIR, with no need to embed it within the lifetime resolution visitor.

Based on https://github.com/rust-lang/rust/pull/96296

2 years agoLazily allocate+initialize locks.
Mara Bos [Fri, 3 Jun 2022 15:04:14 +0000 (17:04 +0200)]
Lazily allocate+initialize locks.

2 years agoUse Drop instead of destroy() for locks.
Mara Bos [Fri, 3 Jun 2022 14:45:47 +0000 (16:45 +0200)]
Use Drop instead of destroy() for locks.

2 years agoAdd `#T-types/nominated` zulip notification
Michael Goulet [Fri, 3 Jun 2022 14:08:17 +0000 (07:08 -0700)]
Add `#T-types/nominated` zulip notification

2 years agoUpdate LLVM submodule
Nikita Popov [Fri, 3 Jun 2022 13:57:32 +0000 (15:57 +0200)]
Update LLVM submodule

2 years agoUse new cargo argument of cfg checking in bootstrap
Urgau [Sat, 28 May 2022 07:36:41 +0000 (09:36 +0200)]
Use new cargo argument of cfg checking in bootstrap

2 years agotest const_copy to make sure bytewise pointer copies are working
Ralf Jung [Fri, 3 Jun 2022 13:18:33 +0000 (09:18 -0400)]
test const_copy to make sure bytewise pointer copies are working

2 years agoAuto merge of #89862 - lcnr:path-generics-diagnostics, r=estebank
bors [Fri, 3 Jun 2022 12:37:16 +0000 (12:37 +0000)]
Auto merge of #89862 - lcnr:path-generics-diagnostics, r=estebank

rewrite error handling for unresolved inference vars

Pretty much completely rewrites `fn emit_inference_failure_err`.

This new setup should hopefully be easier to extend and is already a lot better when looking for generic arguments.
Because this is a rewrite there are still some parts which are lacking, these are tracked in #94483 and will be fixed in later PRs.

r? `@estebank` `@petrochenkov`

2 years agoCompute `is_late_bound` in a separate query.
Camille GILLOT [Thu, 26 May 2022 06:59:15 +0000 (08:59 +0200)]
Compute `is_late_bound` in a separate query.

The computation is actually much simpler, and can be done by directly
fetching the HIR for the `FnDecl` and its generics.

2 years agoManipulate lifetimes by LocalDefId for region resolution.
Camille GILLOT [Wed, 27 Apr 2022 20:15:58 +0000 (22:15 +0200)]
Manipulate lifetimes by LocalDefId for region resolution.

2 years agoAuto merge of #97679 - Dylan-DPC:rollup-nswmgmx, r=Dylan-DPC
bors [Fri, 3 Jun 2022 09:56:21 +0000 (09:56 +0000)]
Auto merge of #97679 - Dylan-DPC:rollup-nswmgmx, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #97366 (Stabilize `{slice,array}::from_ref`)
 - #97653 (add cast kind of from_exposed_addr (int-to-ptr casts))
 - #97663 (take back half-baked noaliasing check in Assignment)
 - #97664 (On E0204 suggest missing type param bounds)
 - #97668 (rustdoc: clean up primitive.slice.html links)

Failed merges:

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

2 years agoConservatively report "not sure" in cfg_accessible
Urgau [Wed, 25 May 2022 18:08:27 +0000 (20:08 +0200)]
Conservatively report "not sure" in cfg_accessible

2 years agoAdd "no-alert" eslint rule
Guillaume Gomez [Fri, 3 Jun 2022 09:29:49 +0000 (11:29 +0200)]
Add "no-alert" eslint rule

2 years agoAdd "guard-for-in" eslint rule
Guillaume Gomez [Fri, 3 Jun 2022 09:28:34 +0000 (11:28 +0200)]
Add "guard-for-in" eslint rule

2 years agoAdd "block-scoped-var" eslint rule
Guillaume Gomez [Fri, 3 Jun 2022 09:20:46 +0000 (11:20 +0200)]
Add "block-scoped-var" eslint rule

2 years agoRollup merge of #97668 - notriddle:notriddle/slice-link, r=jsha
Dylan DPC [Fri, 3 Jun 2022 09:18:27 +0000 (11:18 +0200)]
Rollup merge of #97668 - notriddle:notriddle/slice-link, r=jsha

rustdoc: clean up primitive.slice.html links

Before: <a href="https://doc.rust-lang.org/stable/std/boxed/struct.Box.html">Box</a>&lt;<a href="https://doc.rust-lang.org/stable/std/primitive.slice.html">[</a>T<a href="https://doc.rust-lang.org/stable/std/primitive.slice.html">]</a>&gt;

After: <a href="https://doc.rust-lang.org/stable/std/boxed/struct.Box.html">Box</a>&lt;<a href="https://doc.rust-lang.org/stable/std/primitive.slice.html">[T]</a>&gt;

2 years agoRollup merge of #97664 - estebank:suggest-bound-derive-copy, r=compiler-errors
Dylan DPC [Fri, 3 Jun 2022 09:18:26 +0000 (11:18 +0200)]
Rollup merge of #97664 - estebank:suggest-bound-derive-copy, r=compiler-errors

On E0204 suggest missing type param bounds

```
error[E0204]: the trait `Copy` may not be implemented for this type
  --> f42.rs:9:17
   |
9  | #[derive(Debug, Copy, Clone)]
   |                 ^^^^
10 | pub struct AABB<K>{
11 |     pub loc: Vector2<K>,
   |     ------------------- this field does not implement `Copy`
12 |     pub size: Vector2<K>
   |     -------------------- this field does not implement `Copy`
   |
note: the `Copy` impl for `Vector2<K>` requires that `K: Debug`
  --> f42.rs:11:5
   |
11 |     pub loc: Vector2<K>,
   |     ^^^^^^^^^^^^^^^^^^^
note: the `Copy` impl for `Vector2<K>` requires that `K: Debug`
  --> f42.rs:12:5
   |
12 |     pub size: Vector2<K>
   |     ^^^^^^^^^^^^^^^^^^^^
   = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `K`
   |
10 | pub struct AABB<K: Debug>{
   |                  +++++++
```

Fix #89137.

2 years agoRollup merge of #97663 - RalfJung:keine-halben-sachen, r=oli-obk
Dylan DPC [Fri, 3 Jun 2022 09:18:25 +0000 (11:18 +0200)]
Rollup merge of #97663 - RalfJung:keine-halben-sachen, r=oli-obk

take back half-baked noaliasing check in Assignment

Doing an aliasing check in `copy_op` does not make a ton of sense. We have to eventually do something in the `Assignment` statement handling instead.

2 years agoRollup merge of #97653 - RalfJung:int-to-ptr, r=oli-obk
Dylan DPC [Fri, 3 Jun 2022 09:18:24 +0000 (11:18 +0200)]
Rollup merge of #97653 - RalfJung:int-to-ptr, r=oli-obk

add cast kind of from_exposed_addr (int-to-ptr casts)

This is basically the dual to https://github.com/rust-lang/rust/pull/97582, for int2ptr casts.

Cc `@tmiasko` https://github.com/rust-lang/rust/issues/97649

2 years agoRollup merge of #97366 - WaffleLapkin:stabilize_array_slice_from_ref, r=dtolnay
Dylan DPC [Fri, 3 Jun 2022 09:18:23 +0000 (11:18 +0200)]
Rollup merge of #97366 - WaffleLapkin:stabilize_array_slice_from_ref, r=dtolnay

Stabilize `{slice,array}::from_ref`

This PR stabilizes the following APIs as `const` functions in Rust `1.63`:
```rust
// core::array
pub const fn from_ref<T>(s: &T) -> &[T; 1];

// core::slice
pub const fn from_ref<T>(s: &T) -> &[T];
```

Note that the `mut` versions are not stabilized as unique references (`&mut _`) are [unstable in const context].

FCP: https://github.com/rust-lang/rust/issues/90206#issuecomment-1134586665

r? rust-lang/libs-api `@rustbot` label +T-libs-api -T-libs

[unstable in const context]: https://github.com/rust-lang/rust/issues/57349

2 years agoAdd "no-template-curly-in-string" eslint rule
Guillaume Gomez [Fri, 3 Jun 2022 09:16:23 +0000 (11:16 +0200)]
Add "no-template-curly-in-string" eslint rule

2 years agoAdd "no-self-compare" eslint rule
Guillaume Gomez [Fri, 3 Jun 2022 09:14:07 +0000 (11:14 +0200)]
Add "no-self-compare" eslint rule

2 years agoAdd "no-import-assign" eslint rule
Guillaume Gomez [Fri, 3 Jun 2022 09:13:42 +0000 (11:13 +0200)]
Add "no-import-assign" eslint rule

2 years agoAdd "no-invalid-regexp" eslint rule
Guillaume Gomez [Fri, 3 Jun 2022 09:11:33 +0000 (11:11 +0200)]
Add "no-invalid-regexp" eslint rule

2 years agoAdd "no-fallthrough" eslint rule
Guillaume Gomez [Fri, 3 Jun 2022 09:09:23 +0000 (11:09 +0200)]
Add "no-fallthrough" eslint rule

2 years agoAuto merge of #96296 - cjgillot:remove-label-lt-shadow, r=petrochenkov
bors [Fri, 3 Jun 2022 07:27:09 +0000 (07:27 +0000)]
Auto merge of #96296 - cjgillot:remove-label-lt-shadow, r=petrochenkov

Remove label/lifetime shadowing warnings

This PR removes some pre-1.0 shadowing warnings for labels and lifetimes.

The current behaviour of the compiler is to warn
* labels that shadow unrelated labels in the same function --> removed
```rust
'a: loop {}
'a: loop {} // STOP WARNING
```

* labels that shadow enclosing labels --> kept, but only if shadowing is hygienic
```rust
'a: loop {
  'a: loop {} // KEEP WARNING
}
```

* labels that shadow lifetime --> removed
```rust
fn foo<'a>() {
  'a: loop {} // STOP WARNING
}
```

* lifetimes that shadow labels --> removed
```rust
'a: loop {
  let b = Box::new(|x: &i8| *x) as Box<dyn for <'a> Fn(&'a i8) -> i8>; // STOP WARNING
}
```

* lifetimes that shadow lifetimes --> kept
```rust
fn foo<'a>() {
  let b = Box::new(|x: &i8| *x) as Box<dyn for <'a> Fn(&'a i8) -> i8>; // KEEP WARNING
}
```

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

-----

From `@petrochenkov` in https://github.com/rust-lang/rust/pull/95781#issuecomment-1105199014
> I think we should remove these silly checks entirely.
> They were introduced long time ago in case some new language features appear and require this space.
> Now we have another mechanism for such language changes - editions, and if "lifetimes in expressions" or something like that needs to be introduced it could be introduced as an edition change.
> However, there was no plans to introduce anything like for years, so it's unlikely that even the edition mechanism will be necessary.

r? rust-lang/lang

2 years agoUse the same message as type & const generics.
Camille GILLOT [Thu, 2 Jun 2022 18:46:40 +0000 (20:46 +0200)]
Use the same message as type & const generics.

2 years agoReuse resolve_label to check lifetime shadowing.
Camille GILLOT [Thu, 2 Jun 2022 18:35:14 +0000 (20:35 +0200)]
Reuse resolve_label to check lifetime shadowing.

2 years agoDo not lower generic lifetime params when AST resolution emitted an error.
Camille GILLOT [Fri, 27 May 2022 09:29:18 +0000 (11:29 +0200)]
Do not lower generic lifetime params when AST resolution emitted an error.

2 years agoAuto merge of #97497 - c410-f3r:z-errors, r=petrochenkov
bors [Fri, 3 Jun 2022 04:46:10 +0000 (04:46 +0000)]
Auto merge of #97497 - c410-f3r:z-errors, r=petrochenkov

Move some tests to more reasonable places

r? `@petrochenkov`

2 years agoMake params be SmallVec as originally was
Santiago Pastorino [Fri, 3 Jun 2022 02:42:49 +0000 (23:42 -0300)]
Make params be SmallVec as originally was

2 years agoAuto merge of #97667 - matthiaskrgr:rollup-5cfxc85, r=matthiaskrgr
bors [Fri, 3 Jun 2022 00:21:29 +0000 (00:21 +0000)]
Auto merge of #97667 - matthiaskrgr:rollup-5cfxc85, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #97502 (rustdoc: Add more test coverage)
 - #97627 (update explicit impls error msg)
 - #97640 (Fix wrong suggestion for adding where clauses)
 - #97645 (don't use a `span_note` for ignored impls)
 - #97655 (Improve documentation for constructors of pinned `Box`es)

Failed merges:

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

2 years agoreview comments
Esteban Küber [Thu, 2 Jun 2022 21:06:54 +0000 (14:06 -0700)]
review comments

2 years agoFix MIPS-specific signal bug
Michael Howell [Thu, 2 Jun 2022 22:18:16 +0000 (15:18 -0700)]
Fix MIPS-specific signal bug