about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-19 20:01:50 +0000
committerbors <bors@rust-lang.org>2023-06-19 20:01:50 +0000
commitfe7454bf439c93cbe9ac8a8f7fcfacd5a40244c2 (patch)
tree40d9bcb451b3427ef5b4565bdf0aa021393f26ae /tests
parent405130538938e2d63a761b7d8d6b27d26e634c33 (diff)
parent68d3e0e3bd36c655b7bfdee9ca081814b1bb002f (diff)
downloadrust-fe7454bf439c93cbe9ac8a8f7fcfacd5a40244c2.tar.gz
rust-fe7454bf439c93cbe9ac8a8f7fcfacd5a40244c2.zip
Auto merge of #112805 - matthiaskrgr:rollup-r5yrefu, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #109970 ([doc] `poll_fn`: explain how to `pin` captured state safely)
 - #112705 (Simplify `Span::source_callee` impl)
 - #112757 (Use BorrowFlag instead of explicit isize)
 - #112768 (Rewrite various resolve/diagnostics errors as translatable diagnostics)
 - #112777 (Continue folding in query normalizer on weak aliases)
 - #112780 (Treat TAIT equation as always ambiguous in coherence)
 - #112783 (Don't ICE on bound var in `reject_fn_ptr_impls`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/enum/suggest-default-attribute.stderr2
-rw-r--r--tests/ui/impl-trait/coherence-treats-tait-ambig.current.stderr13
-rw-r--r--tests/ui/impl-trait/coherence-treats-tait-ambig.next.stderr13
-rw-r--r--tests/ui/impl-trait/coherence-treats-tait-ambig.rs19
-rw-r--r--tests/ui/traits/non_lifetime_binders/foreach-partial-eq.rs12
-rw-r--r--tests/ui/traits/non_lifetime_binders/foreach-partial-eq.stderr28
-rw-r--r--tests/ui/type-alias-impl-trait/debug-ty-with-weak.rs12
7 files changed, 98 insertions, 1 deletions
diff --git a/tests/ui/enum/suggest-default-attribute.stderr b/tests/ui/enum/suggest-default-attribute.stderr
index fb830d3f78b..b56d599a786 100644
--- a/tests/ui/enum/suggest-default-attribute.stderr
+++ b/tests/ui/enum/suggest-default-attribute.stderr
@@ -7,7 +7,7 @@ LL |     #[default]
 help: consider adding a derive
    |
 LL + #[derive(Default)]
-LL ~ pub enum Test {
+LL | pub enum Test {
    |
 
 error: aborting due to previous error
diff --git a/tests/ui/impl-trait/coherence-treats-tait-ambig.current.stderr b/tests/ui/impl-trait/coherence-treats-tait-ambig.current.stderr
new file mode 100644
index 00000000000..61fed16294b
--- /dev/null
+++ b/tests/ui/impl-trait/coherence-treats-tait-ambig.current.stderr
@@ -0,0 +1,13 @@
+error[E0119]: conflicting implementations of trait `Into<T>` for type `Foo`
+  --> $DIR/coherence-treats-tait-ambig.rs:10:1
+   |
+LL | impl Into<T> for Foo {
+   | ^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: conflicting implementation in crate `core`:
+           - impl<T, U> Into<U> for T
+             where U: From<T>;
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/impl-trait/coherence-treats-tait-ambig.next.stderr b/tests/ui/impl-trait/coherence-treats-tait-ambig.next.stderr
new file mode 100644
index 00000000000..61fed16294b
--- /dev/null
+++ b/tests/ui/impl-trait/coherence-treats-tait-ambig.next.stderr
@@ -0,0 +1,13 @@
+error[E0119]: conflicting implementations of trait `Into<T>` for type `Foo`
+  --> $DIR/coherence-treats-tait-ambig.rs:10:1
+   |
+LL | impl Into<T> for Foo {
+   | ^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: conflicting implementation in crate `core`:
+           - impl<T, U> Into<U> for T
+             where U: From<T>;
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/impl-trait/coherence-treats-tait-ambig.rs b/tests/ui/impl-trait/coherence-treats-tait-ambig.rs
new file mode 100644
index 00000000000..156a7eb0e23
--- /dev/null
+++ b/tests/ui/impl-trait/coherence-treats-tait-ambig.rs
@@ -0,0 +1,19 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
+#![feature(type_alias_impl_trait)]
+
+type T = impl Sized;
+
+struct Foo;
+
+impl Into<T> for Foo {
+//~^ ERROR conflicting implementations of trait `Into<T>` for type `Foo`
+    fn into(self) -> T {
+        Foo
+    }
+}
+
+fn main() {
+    let _: T = Foo.into();
+}
diff --git a/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.rs b/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.rs
new file mode 100644
index 00000000000..96a7424f0dc
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.rs
@@ -0,0 +1,12 @@
+#![feature(non_lifetime_binders)]
+//~^ WARN the feature `non_lifetime_binders` is incomplete
+
+fn auto_trait()
+where
+    for<T> T: PartialEq + PartialOrd,
+{}
+
+fn main() {
+    auto_trait();
+    //~^ ERROR can't compare `T` with `T`
+}
diff --git a/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.stderr b/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.stderr
new file mode 100644
index 00000000000..da09343fb27
--- /dev/null
+++ b/tests/ui/traits/non_lifetime_binders/foreach-partial-eq.stderr
@@ -0,0 +1,28 @@
+warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
+  --> $DIR/foreach-partial-eq.rs:1:12
+   |
+LL | #![feature(non_lifetime_binders)]
+   |            ^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
+   = note: `#[warn(incomplete_features)]` on by default
+
+error[E0277]: can't compare `T` with `T`
+  --> $DIR/foreach-partial-eq.rs:10:5
+   |
+LL |     auto_trait();
+   |     ^^^^^^^^^^ no implementation for `T < T` and `T > T`
+   |
+   = help: the trait `PartialOrd` is not implemented for `T`
+note: required by a bound in `auto_trait`
+  --> $DIR/foreach-partial-eq.rs:6:27
+   |
+LL | fn auto_trait()
+   |    ---------- required by a bound in this function
+LL | where
+LL |     for<T> T: PartialEq + PartialOrd,
+   |                           ^^^^^^^^^^ required by this bound in `auto_trait`
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/type-alias-impl-trait/debug-ty-with-weak.rs b/tests/ui/type-alias-impl-trait/debug-ty-with-weak.rs
new file mode 100644
index 00000000000..44158349fdd
--- /dev/null
+++ b/tests/ui/type-alias-impl-trait/debug-ty-with-weak.rs
@@ -0,0 +1,12 @@
+// compile-flags: --crate-type=lib -Cdebuginfo=2
+// build-pass
+
+#![feature(type_alias_impl_trait)]
+
+type Debuggable = impl core::fmt::Debug;
+
+static mut TEST: Option<Debuggable> = None;
+
+fn foo() -> Debuggable {
+    0u32
+}