Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
17b0771
rewrite pgo-branch-weights to rmake
Oneirical May 15, 2024
80408e0
port symlinked-extern to rmake
Oneirical May 28, 2024
59acd23
port symlinked-rlib to rmake
Oneirical May 28, 2024
2ac5faa
port symlinked-libraries to rmake
Oneirical May 28, 2024
63bdcaa
add is_none_or
RalfJung Jun 12, 2024
4c208ac
use is_none_or in some places in the compiler
RalfJung Jun 12, 2024
ffe5439
Add test for walking order dependent opaque type behaviour
oli-obk Jun 12, 2024
6d93626
docs(rustc): Help users to check-cfg Cargo docs
epage Jun 12, 2024
4b809b9
Move MatchAgainstFreshVars to old solver
compiler-errors Jun 12, 2024
9232bd2
docs(rustc): Link unexpected_cfgs to the Cargo.toml docs
epage Jun 12, 2024
e171e64
docs(rustc): De-emphasize --cfg/--check-cfg note
epage Jun 12, 2024
075f068
std::unix::fs::link using direct linkat call for Solaris and macOs.
devnexen Jun 12, 2024
52b2c88
Walk into alias-eq nested goals even if normalization fails
compiler-errors May 28, 2024
b0c1474
better error message for normalizes-to ambiguities
compiler-errors Jun 4, 2024
44040a0
Also passthrough for projection clauses
compiler-errors Jun 4, 2024
46391b7
Make `try_from_target_usize` method public
artemagvanian Jun 12, 2024
c453c82
Harmonize use of leaf and root obligation in trait error reporting
compiler-errors Jun 8, 2024
93d83c8
Bless and add ICE regression test
compiler-errors Jun 8, 2024
f8d12d9
Stop passing both trait pred and trait ref
compiler-errors Jun 7, 2024
2c0348a
Stop passing traitref/traitpredicate by ref
compiler-errors Jun 7, 2024
d1fa19c
Add urls to rust lang reference
sancho20021 Jun 12, 2024
ae24ebe
Rebase fallout
compiler-errors Jun 13, 2024
ae73d9d
Rollup merge of #125165 - Oneirical:pgo-branch-weights, r=jieyouxu
workingjubilee Jun 13, 2024
b1a6d44
Rollup merge of #125674 - Oneirical:another-day-another-test, r=jieyouxu
workingjubilee Jun 13, 2024
dd6df05
Rollup merge of #125688 - compiler-errors:alias-reporting, r=lcnr
workingjubilee Jun 13, 2024
c315b05
Rollup merge of #126142 - compiler-errors:trait-ref-split, r=jackh726
workingjubilee Jun 13, 2024
68d72e9
Rollup merge of #126303 - sancho20021:patch-1, r=compiler-errors
workingjubilee Jun 13, 2024
b1b9961
Rollup merge of #126328 - RalfJung:is_none_or, r=workingjubilee
workingjubilee Jun 13, 2024
cc940ea
Rollup merge of #126337 - oli-obk:nested_gat_opaque, r=lcnr
workingjubilee Jun 13, 2024
1315e47
Rollup merge of #126351 - devnexen:to_sol11_upd, r=ChrisDenton
workingjubilee Jun 13, 2024
5a9bfb9
Rollup merge of #126353 - compiler-errors:move-match, r=lcnr
workingjubilee Jun 13, 2024
574c413
Rollup merge of #126356 - epage:check-cfg, r=Urgau
workingjubilee Jun 13, 2024
f16bd4e
Rollup merge of #126362 - artemagvanian:patch-1, r=celinval
workingjubilee Jun 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
better error message for normalizes-to ambiguities
  • Loading branch information
compiler-errors committed Jun 12, 2024
commit b0c14743811866a63aac3177e5f9f820af477458
Original file line number Diff line number Diff line change
Expand Up @@ -2705,6 +2705,22 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
),
);
}

ty::PredicateKind::NormalizesTo(ty::NormalizesTo { alias, term })
if term.is_infer() =>
{
if let Some(e) = self.tainted_by_errors() {
return e;
}
struct_span_code_err!(
self.dcx(),
span,
E0284,
"type annotations needed: cannot normalize `{alias}`",
)
.with_span_label(span, format!("cannot normalize `{alias}`"))
}

_ => {
if let Some(e) = self.tainted_by_errors() {
return e;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0284]: type annotations needed: cannot satisfy `<dyn Object<U, Output = T> as Object<U>>::Output normalizes-to _`
error[E0284]: type annotations needed: cannot normalize `<dyn Object<U, Output = T> as Object<U>>::Output`
--> $DIR/indirect-impl-for-trait-obj-coherence.rs:25:41
|
LL | foo::<dyn Object<U, Output = T>, U>(x)
| ^ cannot satisfy `<dyn Object<U, Output = T> as Object<U>>::Output normalizes-to _`
| ^ cannot normalize `<dyn Object<U, Output = T> as Object<U>>::Output`

error: aborting due to 1 previous error

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn foo<T: ?Sized, U>(x: <T as Object<U>>::Output) -> U {
#[allow(dead_code)]
fn transmute<T, U>(x: T) -> U {
foo::<dyn Object<U, Output = T>, U>(x)
//[next]~^ ERROR type annotations needed: cannot satisfy `<dyn Object<U, Output = T> as Object<U>>::Output normalizes-to _`
//[next]~^ ERROR type annotations needed: cannot normalize `<dyn Object<U, Output = T> as Object<U>>::Output`
}

fn main() {}
4 changes: 2 additions & 2 deletions tests/ui/coherence/occurs-check/associated-type.next.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ LL | | for<'a> *const T: ToUnit<'a>,
|
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details

error[E0284]: type annotations needed: cannot satisfy `<for<'a> fn(&'a (), ()) as Overlap<for<'a> fn(&'a (), ())>>::Assoc normalizes-to _`
error[E0284]: type annotations needed: cannot normalize `<for<'a> fn(&'a (), ()) as Overlap<for<'a> fn(&'a (), ())>>::Assoc`
--> $DIR/associated-type.rs:44:59
|
LL | foo::<for<'a> fn(&'a (), ()), for<'a> fn(&'a (), ())>(3usize);
| ^^^^^^ cannot satisfy `<for<'a> fn(&'a (), ()) as Overlap<for<'a> fn(&'a (), ())>>::Assoc normalizes-to _`
| ^^^^^^ cannot normalize `<for<'a> fn(&'a (), ()) as Overlap<for<'a> fn(&'a (), ())>>::Assoc`

error: aborting due to 2 previous errors

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/coherence/occurs-check/associated-type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ fn foo<T: Overlap<U>, U>(x: T::Assoc) -> T::Assoc {

fn main() {
foo::<for<'a> fn(&'a (), ()), for<'a> fn(&'a (), ())>(3usize);
//[next]~^ ERROR: cannot satisfy
//[next]~^ ERROR: cannot normalize
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error[E0284]: type annotations needed: cannot satisfy `X::{constant#0} normalizes-to _`
error[E0284]: type annotations needed: cannot normalize `X::{constant#0}`
--> $DIR/const-region-infer-to-static-in-binder.rs:4:10
|
LL | struct X<const FN: fn() = { || {} }>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `X::{constant#0} normalizes-to _`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `X::{constant#0}`

error: using function pointers as const generic parameters is forbidden
--> $DIR/const-region-infer-to-static-in-binder.rs:4:20
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/traits/next-solver/specialization-transmute.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ LL | #![feature(specialization)]

error: cannot normalize `<T as Default>::Id: '_`

error[E0284]: type annotations needed: cannot satisfy `<T as Default>::Id normalizes-to _`
error[E0284]: type annotations needed: cannot normalize `<T as Default>::Id`
--> $DIR/specialization-transmute.rs:15:23
|
LL | fn intu(&self) -> &Self::Id {
| ^^^^^^^^^ cannot satisfy `<T as Default>::Id normalizes-to _`
| ^^^^^^^^^ cannot normalize `<T as Default>::Id`

error[E0284]: type annotations needed: cannot satisfy `<T as Default>::Id normalizes-to T`
--> $DIR/specialization-transmute.rs:17:9
Expand Down