summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rust-2018/edition-lint-infer-outlives-macro.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/rust-2018/edition-lint-infer-outlives-macro.rs')
-rw-r--r--src/test/ui/rust-2018/edition-lint-infer-outlives-macro.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/rust-2018/edition-lint-infer-outlives-macro.rs b/src/test/ui/rust-2018/edition-lint-infer-outlives-macro.rs
new file mode 100644
index 000000000..d7a832831
--- /dev/null
+++ b/src/test/ui/rust-2018/edition-lint-infer-outlives-macro.rs
@@ -0,0 +1,28 @@
+// edition:2018
+// aux-build:edition-lint-infer-outlives-macro.rs
+
+// Test that the lint does not fire if the where predicate
+// is from the local crate, but all the bounds are from an
+// external macro.
+
+#![deny(explicit_outlives_requirements)]
+
+#[macro_use]
+extern crate edition_lint_infer_outlives_macro;
+
+macro_rules! make_foo {
+ ($a:tt) => {
+ struct Foo<$a, 'b> where 'b: $a {
+ foo: &$a &'b (),
+ }
+ }
+}
+
+gimme_a! {make_foo!}
+
+struct Bar<'a, 'b: 'a> {
+ //~^ ERROR: outlives requirements can be inferred
+ bar: &'a &'b (),
+}
+
+fn main() {}