about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/const-generics/float-generic.adt_const_params.stderr11
-rw-r--r--src/test/ui/const-generics/float-generic.rs12
-rw-r--r--src/test/ui/const-generics/float-generic.simple.stderr11
-rw-r--r--src/test/ui/parser/macro/macro-doc-comments-1.stderr5
-rw-r--r--src/test/ui/parser/macro/macro-doc-comments-2.stderr5
-rw-r--r--src/test/ui/resolve/issue-55673.rs12
-rw-r--r--src/test/ui/resolve/issue-55673.stderr9
-rw-r--r--src/test/ui/suggestions/auxiliary/meow.rs11
-rw-r--r--src/test/ui/suggestions/issue-99080.rs16
-rw-r--r--src/test/ui/suggestions/issue-99080.stderr20
-rw-r--r--src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr1
-rw-r--r--src/test/ui/traits/issue-59029-1.stderr4
-rw-r--r--src/test/ui/type-alias-impl-trait/not_well_formed.stderr2
13 files changed, 113 insertions, 6 deletions
diff --git a/src/test/ui/const-generics/float-generic.adt_const_params.stderr b/src/test/ui/const-generics/float-generic.adt_const_params.stderr
new file mode 100644
index 00000000000..fef5ef0d1fa
--- /dev/null
+++ b/src/test/ui/const-generics/float-generic.adt_const_params.stderr
@@ -0,0 +1,11 @@
+error[E0741]: `f32` is forbidden as the type of a const generic parameter
+  --> $DIR/float-generic.rs:5:17
+   |
+LL | fn foo<const F: f32>() {}
+   |                 ^^^
+   |
+   = note: floats do not derive `Eq` or `Ord`, which are required for const parameters
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0741`.
diff --git a/src/test/ui/const-generics/float-generic.rs b/src/test/ui/const-generics/float-generic.rs
new file mode 100644
index 00000000000..b72059b5b1c
--- /dev/null
+++ b/src/test/ui/const-generics/float-generic.rs
@@ -0,0 +1,12 @@
+// revisions: simple adt_const_params
+#![cfg_attr(adt_const_params, feature(adt_const_params))]
+#![cfg_attr(adt_const_params, allow(incomplete_features))]
+
+fn foo<const F: f32>() {}
+//~^ ERROR `f32` is forbidden as the type of a const generic parameter
+
+const C: f32 = 1.0;
+
+fn main() {
+    foo::<C>();
+}
diff --git a/src/test/ui/const-generics/float-generic.simple.stderr b/src/test/ui/const-generics/float-generic.simple.stderr
new file mode 100644
index 00000000000..89ca36b0f63
--- /dev/null
+++ b/src/test/ui/const-generics/float-generic.simple.stderr
@@ -0,0 +1,11 @@
+error: `f32` is forbidden as the type of a const generic parameter
+  --> $DIR/float-generic.rs:5:17
+   |
+LL | fn foo<const F: f32>() {}
+   |                 ^^^
+   |
+   = note: the only supported types are integers, `bool` and `char`
+   = help: more complex types are supported with `#![feature(adt_const_params)]`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/macro/macro-doc-comments-1.stderr b/src/test/ui/parser/macro/macro-doc-comments-1.stderr
index 96bdb9808ee..0ebf3d52b63 100644
--- a/src/test/ui/parser/macro/macro-doc-comments-1.stderr
+++ b/src/test/ui/parser/macro/macro-doc-comments-1.stderr
@@ -5,7 +5,10 @@ LL | macro_rules! outer {
    | ------------------ when calling this macro
 ...
 LL |     //! Inner
-   |     ^^^^^^^^^ no rules expected this token in macro call
+   |     ^^^^^^^^^
+   |     |
+   |     no rules expected this token in macro call
+   |     inner doc comments expand to `#![doc = "..."]`, which is what this macro attempted to match
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/parser/macro/macro-doc-comments-2.stderr b/src/test/ui/parser/macro/macro-doc-comments-2.stderr
index 023d1a3e039..346d865868d 100644
--- a/src/test/ui/parser/macro/macro-doc-comments-2.stderr
+++ b/src/test/ui/parser/macro/macro-doc-comments-2.stderr
@@ -5,7 +5,10 @@ LL | macro_rules! inner {
    | ------------------ when calling this macro
 ...
 LL |     /// Outer
-   |     ^^^^^^^^^ no rules expected this token in macro call
+   |     ^^^^^^^^^
+   |     |
+   |     no rules expected this token in macro call
+   |     outer doc comments expand to `#[doc = "..."]`, which is what this macro attempted to match
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/resolve/issue-55673.rs b/src/test/ui/resolve/issue-55673.rs
new file mode 100644
index 00000000000..0436bd39742
--- /dev/null
+++ b/src/test/ui/resolve/issue-55673.rs
@@ -0,0 +1,12 @@
+trait Foo {
+    type Bar;
+}
+
+fn foo<T: Foo>()
+where
+    T::Baa: std::fmt::Debug,
+    //~^ ERROR associated type `Baa` not found for `T`
+{
+}
+
+fn main() {}
diff --git a/src/test/ui/resolve/issue-55673.stderr b/src/test/ui/resolve/issue-55673.stderr
new file mode 100644
index 00000000000..39318f95905
--- /dev/null
+++ b/src/test/ui/resolve/issue-55673.stderr
@@ -0,0 +1,9 @@
+error[E0220]: associated type `Baa` not found for `T`
+  --> $DIR/issue-55673.rs:7:8
+   |
+LL |     T::Baa: std::fmt::Debug,
+   |        ^^^ there is a similarly named associated type `Bar` in the trait `Foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0220`.
diff --git a/src/test/ui/suggestions/auxiliary/meow.rs b/src/test/ui/suggestions/auxiliary/meow.rs
new file mode 100644
index 00000000000..115df70a690
--- /dev/null
+++ b/src/test/ui/suggestions/auxiliary/meow.rs
@@ -0,0 +1,11 @@
+pub trait Meow {
+    fn meow(&self) {}
+}
+
+pub struct GlobalMeow;
+
+impl Meow for GlobalMeow {}
+
+pub(crate) struct PrivateMeow;
+
+impl Meow for PrivateMeow {}
diff --git a/src/test/ui/suggestions/issue-99080.rs b/src/test/ui/suggestions/issue-99080.rs
new file mode 100644
index 00000000000..91f574f35b8
--- /dev/null
+++ b/src/test/ui/suggestions/issue-99080.rs
@@ -0,0 +1,16 @@
+// aux-build:meow.rs
+
+extern crate meow;
+
+use meow::Meow;
+
+fn needs_meow<T: Meow>(t: T) {}
+
+fn main() {
+    needs_meow(1usize);
+    //~^ ERROR the trait bound `usize: Meow` is not satisfied
+}
+
+struct LocalMeow;
+
+impl Meow for LocalMeow {}
diff --git a/src/test/ui/suggestions/issue-99080.stderr b/src/test/ui/suggestions/issue-99080.stderr
new file mode 100644
index 00000000000..d1908dd9d0d
--- /dev/null
+++ b/src/test/ui/suggestions/issue-99080.stderr
@@ -0,0 +1,20 @@
+error[E0277]: the trait bound `usize: Meow` is not satisfied
+  --> $DIR/issue-99080.rs:10:16
+   |
+LL |     needs_meow(1usize);
+   |     ---------- ^^^^^^ the trait `Meow` is not implemented for `usize`
+   |     |
+   |     required by a bound introduced by this call
+   |
+   = help: the following other types implement trait `Meow`:
+             GlobalMeow
+             LocalMeow
+note: required by a bound in `needs_meow`
+  --> $DIR/issue-99080.rs:7:18
+   |
+LL | fn needs_meow<T: Meow>(t: T) {}
+   |                  ^^^^ required by this bound in `needs_meow`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
index 115539a6dc2..6ce57b6263e 100644
--- a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
+++ b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
@@ -15,7 +15,6 @@ LL |     s.strip_suffix(b'\n').unwrap_or(s)
              &'c &'b str
              [char; N]
              char
-             pattern::MultiCharEqPattern<C>
    = note: required because of the requirements on the impl of `Pattern<'_>` for `u8`
 
 error: aborting due to previous error
diff --git a/src/test/ui/traits/issue-59029-1.stderr b/src/test/ui/traits/issue-59029-1.stderr
index 53cdb8b1baf..203a8928530 100644
--- a/src/test/ui/traits/issue-59029-1.stderr
+++ b/src/test/ui/traits/issue-59029-1.stderr
@@ -2,13 +2,13 @@ error[E0220]: associated type `Res` not found for `Self`
   --> $DIR/issue-59029-1.rs:5:52
    |
 LL | trait MkSvc<Target, Req> = Svc<Target> where Self::Res: Svc<Req>;
-   |                                                    ^^^ associated type `Res` not found
+   |                                                    ^^^ there is a similarly named associated type `Res` in the trait `Svc`
 
 error[E0220]: associated type `Res` not found for `Self`
   --> $DIR/issue-59029-1.rs:5:52
    |
 LL | trait MkSvc<Target, Req> = Svc<Target> where Self::Res: Svc<Req>;
-   |                                                    ^^^ associated type `Res` not found
+   |                                                    ^^^ there is a similarly named associated type `Res` in the trait `Svc`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/type-alias-impl-trait/not_well_formed.stderr b/src/test/ui/type-alias-impl-trait/not_well_formed.stderr
index 91c1d031e4e..c36b95f47e8 100644
--- a/src/test/ui/type-alias-impl-trait/not_well_formed.stderr
+++ b/src/test/ui/type-alias-impl-trait/not_well_formed.stderr
@@ -2,7 +2,7 @@ error[E0220]: associated type `Assoc` not found for `V`
   --> $DIR/not_well_formed.rs:9:29
    |
 LL | type Foo<V> = impl Trait<V::Assoc>;
-   |                             ^^^^^ associated type `Assoc` not found
+   |                             ^^^^^ there is a similarly named associated type `Assoc` in the trait `TraitWithAssoc`
 
 error: aborting due to previous error