Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 20 pull requests #121164

Closed
wants to merge 78 commits into from
Closed

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Feb 15, 2024

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

kornelski and others added 30 commits January 31, 2024 23:27
This also keeps the old `advance` method under `advance_unchecked` name.

This makes pattern like `std::io::default_read_buf` safe to write.
…ers and Rust plans to set Windows 10 as the minimum supported OS for target x86_64-pc-windows-msvc, I have added the cmpxchg16b and sse3 feature (as CPUs that meet the Windows 10 64-bit requirement also support SSE3. See https://walbourn.github.io/directxmath-sse3-and-ssse3/ )
Fixed a bug where adding CMPXCHG16B would fail due to different names in Rustc and LLVM
As CMPXCHG16B is supported, I updated the max atomic width to 128-bits from 64-bits
Updated x86_64-uwp-windows-gnu to use CMPXCHG16B and SSE3
but right now all of them have zero const generic params
Turn `is_val_statically_known` into such an intrinsic to demonstrate. It is perfectly safe to call after all.
Help with common API confusion, like asking for `push` when the data structure really has `append`.

```
error[E0599]: no method named `size` found for struct `Vec<{integer}>` in the current scope
  --> $DIR/rustc_confusables_std_cases.rs:17:7
   |
LL |     x.size();
   |       ^^^^
   |
help: you might have meant to use `len`
   |
LL |     x.len();
   |       ~~~
help: there is a method with a similar name
   |
LL |     x.resize();
   |       ~~~~~~
```

rust-lang#59450
```
error[E0308]: mismatched types
  --> $DIR/rustc_confusables_std_cases.rs:20:14
   |
LL |     x.append(42);
   |       ------ ^^ expected `&mut Vec<{integer}>`, found integer
   |       |
   |       arguments to this method are incorrect
   |
   = note: expected mutable reference `&mut Vec<{integer}>`
                           found type `{integer}`
note: method defined here
  --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
help: you might have meant to use `push`
   |
LL |     x.push(42);
   |       ~~~~
```
Do not provide a structured suggestion when the arguments don't match.

```
error[E0599]: no method named `test_mut` found for struct `Vec<{integer}>` in the current scope
  --> $DIR/auto-ref-slice-plus-ref.rs:7:7
   |
LL |     a.test_mut();
   |       ^^^^^^^^
   |
   = help: items from traits can only be used if the trait is implemented and in scope
note: `MyIter` defines an item `test_mut`, perhaps you need to implement it
  --> $DIR/auto-ref-slice-plus-ref.rs:14:1
   |
LL | trait MyIter {
   | ^^^^^^^^^^^^
help: there is a method `get_mut` with a similar name, but with different arguments
  --> $SRC_DIR/core/src/slice/mod.rs:LL:COL
```

Consider methods beyond inherent ones when suggesting typos.

```
error[E0599]: no method named `owned` found for reference `&dyn Foo` in the current scope
  --> $DIR/object-pointer-types.rs:11:7
   |
LL |     fn owned(self: Box<Self>);
   |                    --------- the method might not be found because of this arbitrary self type
...
LL |     x.owned();
   |       ^^^^^ help: there is a method with a similar name: `to_owned`
```

Fix rust-lang#101013.
…, r=oli-obk

Make `async Fn` trait kind errors better

1. Make it so that async closures with the wrong closurekind actually report a useful error
2. Explain why async closures can sometimes not implement `Fn`/`FnMut` (because they capture things)

r? oli-obk
… r=nnethercote

Fix closure kind docs

I didn't review this close enough lol -- the old code snippet didn't use substs correctly, and had a malformed `if let`
…target-features, r=Amanieu

Update aarch64 target feature docs to match LLVM

rust-lang/stdarch#1432 rust-lang/stdarch#1527

r? ``@Amanieu``
…rms, r=estebank

Only point out non-diverging arms for match suggestions

Fixes rust-lang#121144

There is no reason to point at diverging arms, which will always coerce to whatever is the match block's evaluated type.

This also removes the suggestion from rust-lang#106601, since as I pointed out in rust-lang#72634 (comment) the added suggestion is not firing in the right cases, but instead only when one of the match arms already *actually* evaluates to `()`.

r? estebank
…errors

Avoid debug logging entire MIR body

If there is a need to examine the MIR body there is -Zmir-dump.
…lstrieb

doc: add note about panicking examples for strict_overflow_ops

The first commit adds a note before the panicking examples for strict_overflow_ops to make it clearer that the following examples should panic and why, without needing the reader to hover the mouse over the information icon.

The second commit adds panicking examples for division by zero operations for strict division operations on unsigned numbers. The signed numbers already have two panicking examples each: one for division by zero and one for overflowing division (`MIN/-1`); this commit includes the division by zero examples for the unsigned numbers.
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic O-hermit Operating System: Hermit O-itron Operating System: ITRON O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Feb 15, 2024
@oli-obk
Copy link
Contributor Author

oli-obk commented Feb 15, 2024

@bors r+ p=4 rollup=never

@bors
Copy link
Contributor

bors commented Feb 15, 2024

📌 Commit f4df330 has been approved by oli-obk

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 15, 2024
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-16 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_cd81c467-26d6-43b2-b0b4-1a82e4200044
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=rollup-1sabb30
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_cd81c467-26d6-43b2-b0b4-1a82e4200044
GITHUB_REF=refs/pull/121164/merge
GITHUB_REF_NAME=121164/merge
GITHUB_REF_PROTECTED=false
---
#12 writing image sha256:ca96134455a9a06a8a01da3b56e1b5e39cf3cb22ae33454271d60d53942ca5f8 done
#12 naming to docker.io/library/rust-ci done
#12 DONE 10.2s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-16]
##[group]Clock drift check
  local time: Thu Feb 15 20:35:53 UTC 2024
  network time: Thu, 15 Feb 2024 20:35:53 GMT
  network time: Thu, 15 Feb 2024 20:35:53 GMT
##[endgroup]
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-16', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'build.optimized-compiler-builtins', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-16/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id            := 99999999
---

---- [ui] tests/ui/impl-trait/where-allowed.rs stdout ----
diff of stderr:

401 LL |     vec![vec![0; 10], vec![12; 7], vec![8; 3]]
402    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `[_]`
403    |
+ help: there is an associated function `to_vec` with a similar name
+   --> $SRC_DIR/alloc/src/slice.rs:LL:COL
404    = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
406 error[E0053]: method `in_trait_impl_return` has an incompatible type for trait


The actual stderr differed from the expected stderr.
---
error[E0666]: nested `impl Trait` is not allowed
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:50:51
Build completed unsuccessfully in 0:14:25
   |
LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
   |                                           |       |
   |                                           |       nested `impl Trait` here
   |                                           outer `impl Trait`


error[E0666]: nested `impl Trait` is not allowed
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:59:57
   |
LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
   |                                                 |       |
   |                                                 |       nested `impl Trait` here
   |                                                 outer `impl Trait`


error[E0658]: `impl Trait` in associated types is unstable
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:123:16
   |
LL |     type Out = impl Debug;
   |                ^^^^^^^^^^
   |
   = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
   = help: add `#![feature(impl_trait_in_assoc_type)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `impl Trait` in type aliases is unstable
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:160:23
   |
   |
LL | type InTypeAlias<R> = impl Debug;
   |
   = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
   = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
   = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
error[E0658]: `impl Trait` in type aliases is unstable
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:163:39
   |
   |
LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
   |
   = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
   = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
   = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0562]: `impl Trait` is not allowed in `fn` pointer parameters
   |
   |
LL | fn in_fn_parameter_in_parameters(_: fn(impl Debug)) { panic!() }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in `fn` pointer return types
   |
   |
LL | fn in_fn_return_in_parameters(_: fn() -> impl Debug) { panic!() }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in `fn` pointer parameters
   |
   |
LL | fn in_fn_parameter_in_return() -> fn(impl Debug) { panic!() }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in `fn` pointer return types
   |
   |
LL | fn in_fn_return_in_return() -> fn() -> impl Debug { panic!() }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds
   |
   |
LL | fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in the return type of `Fn` trait bounds
   |
   |
LL | fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds
   |
   |
LL | fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds
   |
   |
LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in the return type of `Fn` trait bounds
   |
   |
LL | fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds
   |
   |
LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds
   |
   |
LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in the return type of `Fn` trait bounds
   |
   |
LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in field types
error[E0562]: `impl Trait` is not allowed in field types
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:87:32
   |
LL | struct InBraceStructField { x: impl Debug }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in field types
error[E0562]: `impl Trait` is not allowed in field types
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:91:41
   |
LL | struct InAdtInBraceStructField { x: Vec<impl Debug> }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in field types
error[E0562]: `impl Trait` is not allowed in field types
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:95:27
   |
LL | struct InTupleStructField(impl Debug);
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in field types
error[E0562]: `impl Trait` is not allowed in field types
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:100:25
   |
LL |     InBraceVariant { x: impl Debug },
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in field types
error[E0562]: `impl Trait` is not allowed in field types
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:102:20
   |
LL |     InTupleVariant(impl Debug),
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in `extern fn` parameters
   |
   |
LL |     fn in_foreign_parameters(_: impl Debug);
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in `extern fn` return types
   |
   |
LL |     fn in_foreign_return() -> impl Debug;
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in `fn` pointer return types
   |
   |
LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in traits
error[E0562]: `impl Trait` is not allowed in traits
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:168:16
   |
LL | impl PartialEq<impl Debug> for () {
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in impl headers
error[E0562]: `impl Trait` is not allowed in impl headers
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:173:24
   |
LL | impl PartialEq<()> for impl Debug {
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in impl headers
---

error[E0562]: `impl Trait` is not allowed in impl headers
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:184:24
   |
LL | impl InInherentImplAdt<impl Debug> {
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in bounds
---

error[E0562]: `impl Trait` is not allowed in bounds
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:197:15
   |
LL |     where Vec<impl Debug>: Debug
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in bounds
error[E0562]: `impl Trait` is not allowed in bounds
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:204:24
   |
LL |     where T: PartialEq<impl Debug>
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in the parameters of `Fn` trait bounds
   |
   |
LL |     where T: Fn(impl Debug)
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error[E0562]: `impl Trait` is not allowed in the return type of `Fn` trait bounds
   |
   |
LL |     where T: Fn() -> impl Debug
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in generic parameter defaults
error[E0562]: `impl Trait` is not allowed in generic parameter defaults
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:224:40
   |
LL | struct InStructGenericParamDefault<T = impl Debug>(T);
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in generic parameter defaults
error[E0562]: `impl Trait` is not allowed in generic parameter defaults
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:228:36
   |
LL | enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in generic parameter defaults
error[E0562]: `impl Trait` is not allowed in generic parameter defaults
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:232:38
   |
LL | trait InTraitGenericParamDefault<T = impl Debug> {}
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in generic parameter defaults
error[E0562]: `impl Trait` is not allowed in generic parameter defaults
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:236:41
   |
LL | type InTypeAliasGenericParamDefault<T = impl Debug> = T;
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in generic parameter defaults
error[E0562]: `impl Trait` is not allowed in generic parameter defaults
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:240:11
   |
LL | impl <T = impl Debug> T {}
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in generic parameter defaults
error[E0562]: `impl Trait` is not allowed in generic parameter defaults
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:247:40
   |
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in the type of variable bindings
error[E0562]: `impl Trait` is not allowed in the type of variable bindings
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:253:29
   |
LL |     let _in_local_variable: impl Fn() = || {};
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods

error[E0562]: `impl Trait` is not allowed in closure return types
error[E0562]: `impl Trait` is not allowed in closure return types
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:255:46
   |
LL |     let _in_return_in_local_variable = || -> impl Fn() { || {} };
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods


error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
   |
   |
LL | impl <T = impl Debug> T {}
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
   = note: `#[deny(invalid_type_param_default)]` on by default
   = note: `#[deny(invalid_type_param_default)]` on by default

error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
   |
   |
LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>


error[E0118]: no nominal type found for inherent implementation
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:240:1
   |
LL | impl <T = impl Debug> T {}
   | ^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type
   = note: either implement a trait on it or create a newtype to wrap it instead

error[E0283]: type annotations needed
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:46:57
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:46:57
   |
LL | fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() }
   |
   = note: cannot satisfy `_: Debug`

error[E0282]: type annotations needed
error[E0282]: type annotations needed
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:59:49
   |
LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }

error[E0283]: type annotations needed
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:65:46
   |
   |
LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
   |
   |
   = note: multiple `impl`s satisfying `_: Fn()` found in the following crates: `alloc`, `core`:
           - impl<A, F> Fn<A> for &F
             where A: Tuple, F: Fn<A>, F: ?Sized;
           - impl<Args, F, A> Fn<Args> for Box<F, A>
             where Args: Tuple, F: Fn<Args>, A: Allocator, F: ?Sized;

error[E0599]: no function or associated item named `into_vec` found for slice `[_]` in the current scope
   |
   |
LL |     vec![vec![0; 10], vec![12; 7], vec![8; 3]]
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `[_]`
help: there is an associated function `to_vec` with a similar name
  --> /rustc/FAKE_PREFIX/library/alloc/src/slice.rs:116:9
   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)


error[E0053]: method `in_trait_impl_return` has an incompatible type for trait
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:130:34
   |
LL |     type Out = impl Debug;
   |                ---------- the expected opaque type
...
LL |     fn in_trait_impl_return() -> impl Debug { () }
   |                                  |
   |                                  expected opaque type, found a different opaque type
   |                                  expected opaque type, found a different opaque type
   |                                  help: change the output type to match the trait: `<() as DummyTrait>::Out`
note: type in trait
  --> /checkout/tests/ui/impl-trait/where-allowed.rs:120:34
   |
   |
LL |     fn in_trait_impl_return() -> Self::Out;
   |                                  ^^^^^^^^^
   = note: expected signature `fn() -> <() as DummyTrait>::Out`
              found signature `fn() -> impl Debug`
   = note: distinct uses of `impl Trait` result in different opaque types
error: unconstrained opaque type
##[error]  --> /checkout/tests/ui/impl-trait/where-allowed.rs:123:16
   |
LL |     type Out = impl Debug;
LL |     type Out = impl Debug;
   |                ^^^^^^^^^^
   |
   = note: `Out` must be used in combination with a concrete type within the same impl
error: aborting due to 51 previous errors

Some errors have detailed explanations: E0053, E0118, E0282, E0283, E0562, E0599, E0658, E0666.
For more information about an error, try `rustc --explain E0053`.

@matthiaskrgr
Copy link
Member

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 15, 2024
@oli-obk oli-obk closed this Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic O-hermit Operating System: Hermit O-itron Operating System: ITRON O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.