about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-02-13 20:41:02 +0100
committerCamille GILLOT <gillot.camille@gmail.com>2021-03-12 22:48:32 +0100
commit445b4e379ca487b268ff6360b193feb28106b5ac (patch)
tree563a7f91bec7cda5ffcad5cbfd6a5c57d96dbd26 /src
parent17a07d71bfd692f9b2dad2a566aff52bf3d4bfe2 (diff)
downloadrust-445b4e379ca487b268ff6360b193feb28106b5ac.tar.gz
rust-445b4e379ca487b268ff6360b193feb28106b5ac.zip
Make def_key and HIR parenting consistent.
Diffstat (limited to 'src')
-rw-r--r--src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.uses_crate.txt3
-rw-r--r--src/test/ui/consts/miri_unleashed/tls.stderr4
-rw-r--r--src/test/ui/generator/print/generator-print-verbose-1.stderr10
-rw-r--r--src/test/ui/impl-trait/impl-trait-in-macro.rs20
-rw-r--r--src/test/ui/impl-trait/impl-trait-in-macro.stderr20
-rw-r--r--src/test/ui/impl-trait/universal-two-impl-traits.rs9
6 files changed, 55 insertions, 11 deletions
diff --git a/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.uses_crate.txt b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.uses_crate.txt
index e14e733fff6..0c28305dd77 100644
--- a/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.uses_crate.txt
+++ b/src/test/run-make-fulldeps/coverage-reports/expected_show_coverage.uses_crate.txt
@@ -93,9 +93,6 @@
    59|      1|    used_only_from_this_lib_crate_generic_function(some_vec);
    60|      1|    used_only_from_this_lib_crate_generic_function("used ONLY from library used_crate.rs");
    61|      1|}
-  ------------------
-  | Unexecuted instantiation: used_crate::use_this_lib_crate
-  ------------------
    62|       |
    63|       |// FIXME(#79651): `used_from_bin_crate_and_lib_crate_generic_function()` is covered and executed
    64|       |// `2` times, but the coverage output also shows (at the bottom of the coverage report):
diff --git a/src/test/ui/consts/miri_unleashed/tls.stderr b/src/test/ui/consts/miri_unleashed/tls.stderr
index 5cef636e0a8..62e2dc71210 100644
--- a/src/test/ui/consts/miri_unleashed/tls.stderr
+++ b/src/test/ui/consts/miri_unleashed/tls.stderr
@@ -2,13 +2,13 @@ error[E0080]: could not evaluate static initializer
   --> $DIR/tls.rs:12:25
    |
 LL |     unsafe { let _val = A; }
-   |                         ^ cannot access thread local static (DefId(0:4 ~ tls[317d]::A))
+   |                         ^ cannot access thread local static (DefId(0:6 ~ tls[317d]::A))
 
 error[E0080]: could not evaluate static initializer
   --> $DIR/tls.rs:19:26
    |
 LL |     unsafe { let _val = &A; }
-   |                          ^ cannot access thread local static (DefId(0:4 ~ tls[317d]::A))
+   |                          ^ cannot access thread local static (DefId(0:6 ~ tls[317d]::A))
 
 warning: skipping const checks
    |
diff --git a/src/test/ui/generator/print/generator-print-verbose-1.stderr b/src/test/ui/generator/print/generator-print-verbose-1.stderr
index b5c63584c6c..78100318dc3 100644
--- a/src/test/ui/generator/print/generator-print-verbose-1.stderr
+++ b/src/test/ui/generator/print/generator-print-verbose-1.stderr
@@ -12,7 +12,7 @@ note: generator is not `Send` as this value is used across a yield
   --> $DIR/generator-print-verbose-1.rs:35:9
    |
 LL |         let _non_send_gen = make_non_send_generator();
-   |             ------------- has type `Opaque(DefId(0:24 ~ generator_print_verbose_1[317d]::make_non_send_generator::{opaque#0}), [])` which is not `Send`
+   |             ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[317d]::make_non_send_generator::{opaque#0}), [])` which is not `Send`
 LL |         yield;
    |         ^^^^^ yield occurs here, with `_non_send_gen` maybe used later
 LL |     };
@@ -30,10 +30,10 @@ LL |     require_send(send_gen);
    = help: the trait `Sync` is not implemented for `RefCell<i32>`
    = note: required because of the requirements on the impl of `Send` for `Arc<RefCell<i32>>`
    = note: required because it appears within the type `[make_gen2<Arc<RefCell<i32>>>::{closure#0} upvar_tys=(Arc<RefCell<i32>>) {()}]`
-   = note: required because it appears within the type `Opaque(DefId(0:29 ~ generator_print_verbose_1[317d]::make_gen2::{opaque#0}), [std::sync::Arc<std::cell::RefCell<i32>>])`
-   = note: required because it appears within the type `Opaque(DefId(0:32 ~ generator_print_verbose_1[317d]::make_non_send_generator2::{opaque#0}), [])`
-   = note: required because it appears within the type `{Opaque(DefId(0:32 ~ generator_print_verbose_1[317d]::make_non_send_generator2::{opaque#0}), []), ()}`
-   = note: required because it appears within the type `[test2::{closure#0} upvar_tys=() {Opaque(DefId(0:32 ~ generator_print_verbose_1[317d]::make_non_send_generator2::{opaque#0}), []), ()}]`
+   = note: required because it appears within the type `Opaque(DefId(0:39 ~ generator_print_verbose_1[317d]::make_gen2::{opaque#0}), [std::sync::Arc<std::cell::RefCell<i32>>])`
+   = note: required because it appears within the type `Opaque(DefId(0:42 ~ generator_print_verbose_1[317d]::make_non_send_generator2::{opaque#0}), [])`
+   = note: required because it appears within the type `{Opaque(DefId(0:42 ~ generator_print_verbose_1[317d]::make_non_send_generator2::{opaque#0}), []), ()}`
+   = note: required because it appears within the type `[test2::{closure#0} upvar_tys=() {Opaque(DefId(0:42 ~ generator_print_verbose_1[317d]::make_non_send_generator2::{opaque#0}), []), ()}]`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/impl-trait/impl-trait-in-macro.rs b/src/test/ui/impl-trait/impl-trait-in-macro.rs
new file mode 100644
index 00000000000..3165c9b9915
--- /dev/null
+++ b/src/test/ui/impl-trait/impl-trait-in-macro.rs
@@ -0,0 +1,20 @@
+use std::fmt::Debug;
+
+macro_rules! i {
+    ($($tr:tt)*) => { impl $($tr)* };
+}
+
+fn foo(x: i!(Debug), y: i!(Debug)) -> String {
+    let mut a = x;
+    a = y; //~ ERROR mismatched
+    format!("{:?}", a)
+}
+
+trait S<T> {}
+
+fn much_universe<T: S<i!(Debug)>, U: IntoIterator<Item = i!(Iterator<Item = i!(Clone)>)>>(
+    _: i!(Debug + Clone),
+) {
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/impl-trait-in-macro.stderr b/src/test/ui/impl-trait/impl-trait-in-macro.stderr
new file mode 100644
index 00000000000..b5f9986ce40
--- /dev/null
+++ b/src/test/ui/impl-trait/impl-trait-in-macro.stderr
@@ -0,0 +1,20 @@
+error[E0308]: mismatched types
+  --> $DIR/impl-trait-in-macro.rs:9:9
+   |
+LL |     ($($tr:tt)*) => { impl $($tr)* };
+   |                       ----
+   |                       |
+   |                       expected type parameter
+   |                       found type parameter
+...
+LL |     a = y;
+   |         ^ expected type parameter `impl Debug`, found a different type parameter `impl Debug`
+   |
+   = note: expected type parameter `impl Debug` (type parameter `impl Debug`)
+              found type parameter `impl Debug` (type parameter `impl Debug`)
+   = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
+   = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/impl-trait/universal-two-impl-traits.rs b/src/test/ui/impl-trait/universal-two-impl-traits.rs
index 1ed47d8f49e..689c240128d 100644
--- a/src/test/ui/impl-trait/universal-two-impl-traits.rs
+++ b/src/test/ui/impl-trait/universal-two-impl-traits.rs
@@ -6,4 +6,11 @@ fn foo(x: impl Debug, y: impl Debug) -> String {
     format!("{:?}", a)
 }
 
-fn main() { }
+trait S<T> {}
+
+fn much_universe<T: S<impl Debug>, U: IntoIterator<Item = impl Iterator<Item = impl Clone>>>(
+    _: impl Debug + Clone,
+) {
+}
+
+fn main() {}