Skip to content

Commit f3f1b03

Browse files
authored
Rollup merge of #113335 - compiler-errors:reveal-opaques-in-new-solver, r=lcnr
Reveal opaques in new solver We were testing against the wrong reveal mode 😨 Also a couple of misc commits that I don't want to really put in separate prs r? ``@lcnr``
2 parents e0b290f + f55b046 commit f3f1b03

File tree

9 files changed

+50
-38
lines changed

9 files changed

+50
-38
lines changed

compiler/rustc_trait_selection/src/solve/normalize.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ impl<'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for NormalizationFolder<'_, 'tcx> {
167167
// We don't normalize opaque types unless we have
168168
// `Reveal::All`, even if we're in the defining scope.
169169
let data = match *ty.kind() {
170-
ty::Alias(kind, alias_ty) if kind != ty::Opaque || reveal == Reveal::UserFacing => {
171-
alias_ty
172-
}
170+
ty::Alias(kind, alias_ty) if kind != ty::Opaque || reveal == Reveal::All => alias_ty,
173171
_ => return ty.try_super_fold_with(self),
174172
};
175173

tests/ui/async-await/in-trait/async-associated-types2.rs

-30
This file was deleted.

tests/ui/dyn-star/param-env-region-infer.current.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0282]: type annotations needed
2-
--> $DIR/param-env-region-infer.rs:16:10
2+
--> $DIR/param-env-region-infer.rs:18:10
33
|
44
LL | t as _
55
| ^ cannot infer type
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
error[E0391]: cycle detected when computing type of `make_dyn_star::{opaque#0}`
2+
--> $DIR/param-env-region-infer.rs:16:60
3+
|
4+
LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
note: ...which requires type-checking `make_dyn_star`...
8+
--> $DIR/param-env-region-infer.rs:16:1
9+
|
10+
LL | fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
= note: ...which requires computing layout of `make_dyn_star::{opaque#0}`...
13+
= note: ...which requires normalizing `make_dyn_star::{opaque#0}`...
14+
= note: ...which again requires computing type of `make_dyn_star::{opaque#0}`, completing the cycle
15+
note: cycle used when checking item types in top-level module
16+
--> $DIR/param-env-region-infer.rs:10:1
17+
|
18+
LL | / #![feature(dyn_star, pointer_like_trait)]
19+
LL | | #![allow(incomplete_features)]
20+
LL | |
21+
LL | | use std::fmt::Debug;
22+
... |
23+
LL | |
24+
LL | | fn main() {}
25+
| |____________^
26+
27+
error: aborting due to previous error
28+
29+
For more information about this error, try `rustc --explain E0391`.

tests/ui/dyn-star/param-env-region-infer.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// revisions: current next
2-
//[next] compile-flags: -Ztrait-solver=next
3-
//[next] check-pass
2+
// Need `-Zdeduplicate-diagnostics=yes` because the number of cycle errors
3+
// emitted is for some horrible reason platform-specific.
4+
//[next] compile-flags: -Ztrait-solver=next -Zdeduplicate-diagnostics=yes
45
// incremental
56

67
// checks that we don't ICE if there are region inference variables in the environment
@@ -13,6 +14,7 @@ use std::fmt::Debug;
1314
use std::marker::PointerLike;
1415

1516
fn make_dyn_star<'a, T: PointerLike + Debug + 'a>(t: T) -> impl PointerLike + Debug + 'a {
17+
//[next]~^ ERROR cycle detected when computing
1618
t as _
1719
//[current]~^ ERROR type annotations needed
1820
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// build-pass
2+
// revisions: current next
3+
//[next] compile-flags: -Ztrait-solver=next
4+
5+
fn test() -> Option<impl Sized> {
6+
Some("")
7+
}
8+
9+
fn main() {
10+
test();
11+
}

tests/ui/issues/issue-67552.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// build-fail
22
// compile-flags: -Copt-level=0
33
// normalize-stderr-test: ".nll/" -> "/"
4+
// ignore-compare-mode-next-solver (hangs)
45

56
fn main() {
67
rec(Empty);

tests/ui/issues/issue-67552.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut ...>`
2-
--> $DIR/issue-67552.rs:29:9
2+
--> $DIR/issue-67552.rs:30:9
33
|
44
LL | rec(identity(&mut it))
55
| ^^^^^^^^^^^^^^^^^^^^^^
66
|
77
note: `rec` defined here
8-
--> $DIR/issue-67552.rs:22:1
8+
--> $DIR/issue-67552.rs:23:1
99
|
1010
LL | / fn rec<T>(mut it: T)
1111
LL | | where

tests/ui/recursion/issue-95134.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// compile-flags: -Copt-level=0
44
// dont-check-failure-status
55
// dont-check-compiler-stderr
6+
// ignore-compare-mode-next-solver (hangs)
67

78
pub fn encode_num<Writer: ExampleWriter>(n: u32, mut writer: Writer) -> Result<(), Writer::Error> {
89
if n > 15 {

0 commit comments

Comments
 (0)