| Age | Commit message (Collapse) | Author | Lines |
|
(cherry picked from commit c7428d50520446ccd44ca89bbbf4ff7a4725570e)
|
|
(cherry picked from commit 9e5a67e57f715ec5eda915db1261cdf4c4a04642)
|
|
|
|
the host.
thus we should no longer see test failures for e.g. wasm32 target.
(cherry picked from commit a2a7f27fd2548874b203f1f577f64cf61627e0a5)
|
|
fix to test as proposed by wesleywiser
Co-authored-by: Wesley Wiser <wwiser@gmail.com>
(cherry picked from commit 5881e5f88d9245ef9259ca600b32af80d5972a7f)
|
|
(cherry picked from commit 7a0e2ee133dacf4e2dbda64a316a95746a469c58)
|
|
Now that this lint runs on any external-ABI fn-ptr, normalization won't
always succeed, so use `try_normalize_erasing_regions` instead.
Signed-off-by: David Wood <david@davidtw.co>
(cherry picked from commit 09434a2575cee12b241c516ad91f21d4b4f9c3fd)
|
|
Consider `()` within types to be FFI-safe, and `()` to be FFI-safe as a
return type (incl. when in a transparent newtype).
Signed-off-by: David Wood <david@davidtw.co>
(cherry picked from commit 24f90fdd2654e9c5437a684d3a72a4e70826a985)
|
|
Simplify this function a bit, it was quite hard to reason about.
Signed-off-by: David Wood <david@davidtw.co>
(cherry picked from commit 99b1897cf640d5f6dac74416761c9b3c75e1ef7a)
|
|
`()` is normally FFI-unsafe, but is FFI-safe when used as a return type.
It is also desirable that a transparent newtype for `()` is FFI-safe when
used as a return type.
In order to support this, when an type was deemed FFI-unsafe, because of
a `()` type, and was used in return type - then the type was considered
FFI-safe. However, this was the wrong approach - it didn't check that the
`()` was part of a transparent newtype! The consequence of this is that
the presence of a `()` type in a more complex return type would make it
the entire type be considered safe (as long as the `()` type was the
first that the lint found) - which is obviously incorrect.
Instead, this logic is removed, and a unit return type or a transparent
wrapper around a unit is checked for directly for functions and fn-ptrs.
Signed-off-by: David Wood <david@davidtw.co>
(cherry picked from commit f53cef31f5ea41c9a5ab8e5335637a6873b9f0b5)
|
|
(cherry picked from commit f25ad54a4d0febbcb2b7e951835228b7b2320b49)
|
|
(cherry picked from commit 3dbbf23e29516218863bda29d2983bd503e6b7fd)
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #113005 (Don't call `query_normalize` when reporting similar impls)
- #113064 (std: edit [T]::swap docs)
- #113138 (Add release notes for 1.71.0)
- #113217 (resolve typerelative ctors to adt)
- #113254 (Use consistent formatting in Readme)
- #113482 (Migrate GUI colors test to original CSS color format)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
r=cjgillot
resolve typerelative ctors to adt
Associated issue: #110508
r? ``@spastorino``
|
|
Don't call `query_normalize` when reporting similar impls
Firstly, It's sketchy to be using `query_normalize` at all during HIR typeck -- it's asking for an ICE 😅. Secondly, we're normalizing an impl trait ref that potentially has parameter types in `ty::ParamEnv::empty()`, which is kinda sketchy as well.
The only UI test change from removing this normalization is that we don't evaluate anonymous constants in impls, which end up giving us really ugly suggestions:
```
error[E0277]: the trait bound `[X; 35]: Default` is not satisfied
--> /home/gh-compiler-errors/test.rs:4:5
|
4 | <[X; 35] as Default>::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `[X; 35]`
|
= help: the following other types implement trait `Default`:
&[T]
&mut [T]
[T; 32]
[T; core::::array::{impl#30}::{constant#0}]
[T; core::::array::{impl#31}::{constant#0}]
[T; core::::array::{impl#32}::{constant#0}]
[T; core::::array::{impl#33}::{constant#0}]
[T; core::::array::{impl#34}::{constant#0}]
and 27 others
```
So just fold the impls with a `BottomUpFolder` that calls `ty::Const::eval`. This doesn't work totally correctly with generic-const-exprs, but it's fine for stable code, and this is error reporting after all.
|
|
Structurally normalize again for byte string lit pat checking
We need to structurally normalize the pointee of a match scrutinee when trying to match byte string patterns -- we used[^1] to call `structurally_resolve_type`, which errors for type vars[^2], but lcnr added `try_structurally_resolve_type`[^3] in the mean time, which is the right thing to use here since it's totally opportunistic.
Fixes rust-lang/trait-system-refactor-initiative#38
[^1]: #112428
[^2]: #112993
[^3]: #113086
|
|
Reveal opaques in new solver
We were testing against the wrong reveal mode :fearful:
Also a couple of misc commits that I don't want to really put in separate prs
r? ``@lcnr``
|
|
tests: unset `RUSTC_LOG_COLOR` in a test
Setting `RUSTC_LOG_COLOR=always` is sometimes useful if tools that one pipes `RUSTC_LOG` into support coloured output, but it makes this test fail because it has a `.stderr` file with `WARN` log output.
|
|
Rollup of 8 pull requests
Successful merges:
- #113413 (Add needs-triage to all new issues)
- #113426 (Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions)
- #113427 (Remove `variances_of` on RPITIT GATs, remove its one use-case)
- #113441 (miri: check that assignments do not self-overlap)
- #113453 (Remove unused from_method from rustc_on_unimplemented)
- #113456 (Avoid calling report_forbidden_specialization for RPITITs)
- #113466 (Update cargo)
- #113467 (Fix comment of `fn_can_unwind`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Avoid calling report_forbidden_specialization for RPITITs
Fixes #113438
r? ``@compiler-errors``
|
|
Remove unused from_method from rustc_on_unimplemented
Fixes #113439
`on_unimplemented_note` was calling `item_name` for RPITITs and that produced ICEs. I've added a regression test for that but also have removed `from_method` symbol entirely because it wasn't even used and by doing that the `item_name` call was also removed.
r? ``@compiler-errors``
|
|
bad positions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hidden types for them
|
|
Do not assert >1 RPITITs on collect_return_position_impl_trait_in_trait_tys
Fixes #113403
Assert on collect_return_position_impl_trait_in_trait_tys is not correct when we call it from type_of(GAT). The included test is an example of a situation that collector collects 0 types.
r? `@compiler-errors`
|
|
Avoid calling item_name for RPITIT
Fixes #113405
r? `@compiler-errors`
|
|
Prefer object candidates in new selection
`dyn Any` shouldn't be using [this implementation](https://doc.rust-lang.org/std/any/trait.Any.html#impl-Any-for-T) during codegen.
Prefer object candidates over other candidates, except for other object candidates.
|
|
Revert "alloc: Allow comparing Boxs over different allocators", add regression test
Temporary fix for #113283
Adds a test to fix the regression introduced in 001b081cc1b and revert that commit. The test fails without the revert.
|
|
Add a regression test for #109054
Closes #109054
r? ``@compiler-errors``
|
|
|
|
|
|
|
|
r=oli-obk
Dont ICE for `dyn* Trait: Trait` (built-in object) goals during selection in new trait solver
We were ICEing too eagerly during selection for `dyn*` goals -- both for dyn unsizing candidates and for built-in object candidates. The former should only be performed on `dyn` objects, but the latter are totally fine.
|
|
|
|
Remove some unnecessary(?) normalization
https://github.com/rust-lang/rust/issues/59774#issuecomment-1550966711
|
|
|
|
|
|
Fix the issue of wrong diagnosis for extern pub fn
Fixes #113342
|
|
Revert the lexing of `c"…"` string literals
Fixes \[after beta-backport\] #113235.
Further progress is tracked in #113333.
This PR *manually* reverts parts of #108801 (since a git-revert would've been too coarse-grained & messy)
and git-reverts #111647.
CC `@fee1-dead` (#108801) `@klensy` (#111647)
r? `@compiler-errors`
`@rustbot` label F-c_str_literals beta-nominated
|
|
Add a regression test for #112895
Closes #112895 if the second option is enough to close the issue
r? `@compiler-errors`
|
|
|