about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/rustdoc/issue-46506-pub-reexport-of-pub-reexport.rs24
-rw-r--r--tests/ui/async-await/issue-74047.stderr4
-rw-r--r--tests/ui/extenv/issue-110547.rs7
-rw-r--r--tests/ui/extenv/issue-110547.stderr29
-rw-r--r--tests/ui/generic-associated-types/auxiliary/missing-item-sugg.rs5
-rw-r--r--tests/ui/generic-associated-types/missing-item-sugg.rs11
-rw-r--r--tests/ui/generic-associated-types/missing-item-sugg.stderr11
-rw-r--r--tests/ui/issues/issue-3344.stderr2
-rw-r--r--tests/ui/missing/missing-items/m2.stderr2
-rw-r--r--tests/ui/span/issue-23729.stderr2
-rw-r--r--tests/ui/span/issue-23827.stderr2
-rw-r--r--tests/ui/span/issue-24356.stderr2
-rw-r--r--tests/ui/suggestions/auxiliary/missing-assoc-fn-applicable-suggestions.rs16
-rw-r--r--tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.fixed21
-rw-r--r--tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.rs21
-rw-r--r--tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr18
-rw-r--r--tests/ui/suggestions/missing-assoc-fn.stderr2
17 files changed, 128 insertions, 51 deletions
diff --git a/tests/rustdoc/issue-46506-pub-reexport-of-pub-reexport.rs b/tests/rustdoc/issue-46506-pub-reexport-of-pub-reexport.rs
new file mode 100644
index 00000000000..d8953eaf597
--- /dev/null
+++ b/tests/rustdoc/issue-46506-pub-reexport-of-pub-reexport.rs
@@ -0,0 +1,24 @@
+// This is a regression test for <https://github.com/rust-lang/rust/issues/46506>.
+// This test ensures that if public re-exported is re-exported, it won't be inlined.
+
+#![crate_name = "foo"]
+
+// @has 'foo/associations/index.html'
+// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 1
+// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Traits'
+// @has - '//*[@id="main-content"]//a[@href="trait.GroupedBy.html"]' 'GroupedBy'
+// @has 'foo/associations/trait.GroupedBy.html'
+pub mod associations {
+    mod belongs_to {
+        pub trait GroupedBy {}
+    }
+    pub use self::belongs_to::GroupedBy;
+}
+
+// @has 'foo/prelude/index.html'
+// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 1
+// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Re-exports'
+// @has - '//*[@id="main-content"]//*[@id="reexport.GroupedBy"]' 'pub use associations::GroupedBy;'
+pub mod prelude {
+    pub use associations::GroupedBy;
+}
diff --git a/tests/ui/async-await/issue-74047.stderr b/tests/ui/async-await/issue-74047.stderr
index 28174825d8b..6bdb9ded482 100644
--- a/tests/ui/async-await/issue-74047.stderr
+++ b/tests/ui/async-await/issue-74047.stderr
@@ -4,8 +4,8 @@ error[E0046]: not all trait items implemented, missing: `Error`, `try_from`
 LL | impl TryFrom<OtherStream> for MyStream {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Error`, `try_from` in implementation
    |
-   = help: implement the missing item: `type Error = Type;`
-   = help: implement the missing item: `fn try_from(_: T) -> Result<Self, <Self as TryFrom<T>>::Error> { todo!() }`
+   = help: implement the missing item: `type Error = /* Type */;`
+   = help: implement the missing item: `fn try_from(_: OtherStream) -> Result<Self, <Self as TryFrom<OtherStream>>::Error> { todo!() }`
 
 error: aborting due to previous error
 
diff --git a/tests/ui/extenv/issue-110547.rs b/tests/ui/extenv/issue-110547.rs
new file mode 100644
index 00000000000..a6fb96ac066
--- /dev/null
+++ b/tests/ui/extenv/issue-110547.rs
@@ -0,0 +1,7 @@
+// compile-flags: -C debug-assertions
+
+fn main() {
+    env!{"\t"}; //~ ERROR not defined at compile time
+    env!("\t"); //~ ERROR not defined at compile time
+    env!("\u{2069}"); //~ ERROR not defined at compile time
+}
diff --git a/tests/ui/extenv/issue-110547.stderr b/tests/ui/extenv/issue-110547.stderr
new file mode 100644
index 00000000000..1219630d346
--- /dev/null
+++ b/tests/ui/extenv/issue-110547.stderr
@@ -0,0 +1,29 @@
+error: environment variable `    ` not defined at compile time
+  --> $DIR/issue-110547.rs:4:5
+   |
+LL |     env!{"\t"};
+   |     ^^^^^^^^^^
+   |
+   = help: use `std::env::var("    ")` to read the variable at run time
+   = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: environment variable `    ` not defined at compile time
+  --> $DIR/issue-110547.rs:5:5
+   |
+LL |     env!("\t");
+   |     ^^^^^^^^^^
+   |
+   = help: use `std::env::var("    ")` to read the variable at run time
+   = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: environment variable `` not defined at compile time
+  --> $DIR/issue-110547.rs:6:5
+   |
+LL |     env!("\u{2069}");
+   |     ^^^^^^^^^^^^^^^^
+   |
+   = help: use `std::env::var("")` to read the variable at run time
+   = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 3 previous errors
+
diff --git a/tests/ui/generic-associated-types/auxiliary/missing-item-sugg.rs b/tests/ui/generic-associated-types/auxiliary/missing-item-sugg.rs
new file mode 100644
index 00000000000..5b10aab4b3f
--- /dev/null
+++ b/tests/ui/generic-associated-types/auxiliary/missing-item-sugg.rs
@@ -0,0 +1,5 @@
+pub trait Foo {
+    type Gat<T>
+    where
+        T: std::fmt::Display;
+}
diff --git a/tests/ui/generic-associated-types/missing-item-sugg.rs b/tests/ui/generic-associated-types/missing-item-sugg.rs
new file mode 100644
index 00000000000..35d573d8188
--- /dev/null
+++ b/tests/ui/generic-associated-types/missing-item-sugg.rs
@@ -0,0 +1,11 @@
+// aux-build:missing-item-sugg.rs
+
+extern crate missing_item_sugg;
+
+struct Local;
+impl missing_item_sugg::Foo for Local {
+    //~^ ERROR not all trait items implemented, missing: `Gat`
+}
+//~^ HELP implement the missing item: `type Gat<T> = /* Type */ where T: std::fmt::Display;`
+
+fn main() {}
diff --git a/tests/ui/generic-associated-types/missing-item-sugg.stderr b/tests/ui/generic-associated-types/missing-item-sugg.stderr
new file mode 100644
index 00000000000..378115f6d38
--- /dev/null
+++ b/tests/ui/generic-associated-types/missing-item-sugg.stderr
@@ -0,0 +1,11 @@
+error[E0046]: not all trait items implemented, missing: `Gat`
+  --> $DIR/missing-item-sugg.rs:6:1
+   |
+LL | impl missing_item_sugg::Foo for Local {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Gat` in implementation
+   |
+   = help: implement the missing item: `type Gat<T> = /* Type */ where T: std::fmt::Display;`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/issues/issue-3344.stderr b/tests/ui/issues/issue-3344.stderr
index 11d5999672e..e849f5d0490 100644
--- a/tests/ui/issues/issue-3344.stderr
+++ b/tests/ui/issues/issue-3344.stderr
@@ -4,7 +4,7 @@ error[E0046]: not all trait items implemented, missing: `partial_cmp`
 LL | impl PartialOrd for Thing {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ missing `partial_cmp` in implementation
    |
-   = help: implement the missing item: `fn partial_cmp(&self, _: &Rhs) -> Option<std::cmp::Ordering> { todo!() }`
+   = help: implement the missing item: `fn partial_cmp(&self, _: &Thing) -> Option<std::cmp::Ordering> { todo!() }`
 
 error: aborting due to previous error
 
diff --git a/tests/ui/missing/missing-items/m2.stderr b/tests/ui/missing/missing-items/m2.stderr
index d18fb443aa4..835c9b2aa48 100644
--- a/tests/ui/missing/missing-items/m2.stderr
+++ b/tests/ui/missing/missing-items/m2.stderr
@@ -5,7 +5,7 @@ LL | impl m1::X for X {
    | ^^^^^^^^^^^^^^^^ missing `CONSTANT`, `Type`, `method`, `method2`, `method3`, `method4`, `method5` in implementation
    |
    = help: implement the missing item: `const CONSTANT: u32 = 42;`
-   = help: implement the missing item: `type Type = Type;`
+   = help: implement the missing item: `type Type = /* Type */;`
    = help: implement the missing item: `fn method(&self, _: String) -> <Self as m1::X>::Type { todo!() }`
    = help: implement the missing item: `fn method2(self: Box<Self>, _: String) -> <Self as m1::X>::Type { todo!() }`
    = help: implement the missing item: `fn method3(_: &Self, _: String) -> <Self as m1::X>::Type { todo!() }`
diff --git a/tests/ui/span/issue-23729.stderr b/tests/ui/span/issue-23729.stderr
index f88ce6c88db..cd854e61f2f 100644
--- a/tests/ui/span/issue-23729.stderr
+++ b/tests/ui/span/issue-23729.stderr
@@ -4,7 +4,7 @@ error[E0046]: not all trait items implemented, missing: `Item`
 LL |         impl Iterator for Recurrence {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Item` in implementation
    |
-   = help: implement the missing item: `type Item = Type;`
+   = help: implement the missing item: `type Item = /* Type */;`
 
 error: aborting due to previous error
 
diff --git a/tests/ui/span/issue-23827.stderr b/tests/ui/span/issue-23827.stderr
index 46a820f1b76..83a9e8c9b98 100644
--- a/tests/ui/span/issue-23827.stderr
+++ b/tests/ui/span/issue-23827.stderr
@@ -4,7 +4,7 @@ error[E0046]: not all trait items implemented, missing: `Output`
 LL | impl<C: Component> FnOnce<(C,)> for Prototype {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Output` in implementation
    |
-   = help: implement the missing item: `type Output = Type;`
+   = help: implement the missing item: `type Output = /* Type */;`
 
 error: aborting due to previous error
 
diff --git a/tests/ui/span/issue-24356.stderr b/tests/ui/span/issue-24356.stderr
index a1f9b255020..cf666e8b4a7 100644
--- a/tests/ui/span/issue-24356.stderr
+++ b/tests/ui/span/issue-24356.stderr
@@ -4,7 +4,7 @@ error[E0046]: not all trait items implemented, missing: `Target`
 LL |         impl Deref for Thing {
    |         ^^^^^^^^^^^^^^^^^^^^ missing `Target` in implementation
    |
-   = help: implement the missing item: `type Target = Type;`
+   = help: implement the missing item: `type Target = /* Type */;`
 
 error: aborting due to previous error
 
diff --git a/tests/ui/suggestions/auxiliary/missing-assoc-fn-applicable-suggestions.rs b/tests/ui/suggestions/auxiliary/missing-assoc-fn-applicable-suggestions.rs
new file mode 100644
index 00000000000..b026035a6a1
--- /dev/null
+++ b/tests/ui/suggestions/auxiliary/missing-assoc-fn-applicable-suggestions.rs
@@ -0,0 +1,16 @@
+pub trait TraitB {
+    type Item;
+}
+
+pub trait TraitA<A> {
+    type Type;
+
+    fn bar<T>(_: T) -> Self;
+
+    fn baz<T>(_: T) -> Self
+    where
+        T: TraitB,
+        <T as TraitB>::Item: Copy;
+
+    const A: usize;
+}
diff --git a/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.fixed b/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.fixed
deleted file mode 100644
index a0cb39a3f8a..00000000000
--- a/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.fixed
+++ /dev/null
@@ -1,21 +0,0 @@
-// run-rustfix
-trait TraitB {
-    type Item;
-}
-
-trait TraitA<A> {
-    type Type;
-    fn bar<T>(_: T) -> Self;
-    fn baz<T>(_: T) -> Self where T: TraitB, <T as TraitB>::Item: Copy;
-}
-
-struct S;
-struct Type;
-
-impl TraitA<()> for S { //~ ERROR not all trait items implemented
-fn baz<T>(_: T) -> Self where T: TraitB, <T as TraitB>::Item: Copy { todo!() }
-fn bar<T>(_: T) -> Self { todo!() }
-type Type = Type;
-}
-
-fn main() {}
diff --git a/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.rs b/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.rs
index c80ede1b2be..11e0c9a3a72 100644
--- a/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.rs
+++ b/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.rs
@@ -1,18 +1,15 @@
-// run-rustfix
-trait TraitB {
-    type Item;
-}
+// aux-build:missing-assoc-fn-applicable-suggestions.rs
 
-trait TraitA<A> {
-    type Type;
-    fn bar<T>(_: T) -> Self;
-    fn baz<T>(_: T) -> Self where T: TraitB, <T as TraitB>::Item: Copy;
-}
+extern crate missing_assoc_fn_applicable_suggestions;
+use missing_assoc_fn_applicable_suggestions::TraitA;
 
 struct S;
-struct Type;
-
-impl TraitA<()> for S { //~ ERROR not all trait items implemented
+impl TraitA<()> for S {
+    //~^ ERROR not all trait items implemented
 }
+//~^ HELP implement the missing item: `type Type = /* Type */;`
+//~| HELP implement the missing item: `fn bar<T>(_: T) -> Self { todo!() }`
+//~| HELP implement the missing item: `fn baz<T>(_: T) -> Self where T: TraitB, <T as TraitB>::Item: Copy { todo!() }`
+//~| HELP implement the missing item: `const A: usize = 42;`
 
 fn main() {}
diff --git a/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr b/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr
index 4c75fbe4c78..4c2d2776d3d 100644
--- a/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr
+++ b/tests/ui/suggestions/missing-assoc-fn-applicable-suggestions.stderr
@@ -1,15 +1,13 @@
-error[E0046]: not all trait items implemented, missing: `Type`, `bar`, `baz`
-  --> $DIR/missing-assoc-fn-applicable-suggestions.rs:15:1
+error[E0046]: not all trait items implemented, missing: `Type`, `bar`, `baz`, `A`
+  --> $DIR/missing-assoc-fn-applicable-suggestions.rs:7:1
    |
-LL |     type Type;
-   |     --------- `Type` from trait
-LL |     fn bar<T>(_: T) -> Self;
-   |     ------------------------ `bar` from trait
-LL |     fn baz<T>(_: T) -> Self where T: TraitB, <T as TraitB>::Item: Copy;
-   |     ------------------------------------------------------------------- `baz` from trait
-...
 LL | impl TraitA<()> for S {
-   | ^^^^^^^^^^^^^^^^^^^^^ missing `Type`, `bar`, `baz` in implementation
+   | ^^^^^^^^^^^^^^^^^^^^^ missing `Type`, `bar`, `baz`, `A` in implementation
+   |
+   = help: implement the missing item: `type Type = /* Type */;`
+   = help: implement the missing item: `fn bar<T>(_: T) -> Self { todo!() }`
+   = help: implement the missing item: `fn baz<T>(_: T) -> Self where T: TraitB, <T as TraitB>::Item: Copy { todo!() }`
+   = help: implement the missing item: `const A: usize = 42;`
 
 error: aborting due to previous error
 
diff --git a/tests/ui/suggestions/missing-assoc-fn.stderr b/tests/ui/suggestions/missing-assoc-fn.stderr
index 136ec2152e0..77fa9562878 100644
--- a/tests/ui/suggestions/missing-assoc-fn.stderr
+++ b/tests/ui/suggestions/missing-assoc-fn.stderr
@@ -28,7 +28,7 @@ error[E0046]: not all trait items implemented, missing: `from_iter`
 LL | impl FromIterator<()> for X {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `from_iter` in implementation
    |
-   = help: implement the missing item: `fn from_iter<T>(_: T) -> Self where T: IntoIterator, std::iter::IntoIterator::Item = A { todo!() }`
+   = help: implement the missing item: `fn from_iter<T>(_: T) -> Self where T: IntoIterator, std::iter::IntoIterator::Item = () { todo!() }`
 
 error: aborting due to 3 previous errors