]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rust-2018/edition-lint-infer-outlives-macro.rs
Auto merge of #106143 - matthiaskrgr:rollup-3kpy1dc, r=matthiaskrgr
[rust.git] / src / test / ui / rust-2018 / edition-lint-infer-outlives-macro.rs
1 // edition:2018
2 // aux-build:edition-lint-infer-outlives-macro.rs
3
4 // Test that the lint does not fire if the where predicate
5 // is from the local crate, but all the bounds are from an
6 // external macro.
7
8 #![deny(explicit_outlives_requirements)]
9
10 #[macro_use]
11 extern crate edition_lint_infer_outlives_macro;
12
13 macro_rules! make_foo {
14     ($a:tt) => {
15         struct Foo<$a, 'b> where 'b: $a {
16             foo: &$a &'b (),
17         }
18     }
19 }
20
21 gimme_a! {make_foo!}
22
23 struct Bar<'a, 'b: 'a> {
24     //~^ ERROR: outlives requirements can be inferred
25     bar: &'a &'b (),
26 }
27
28 fn main() {}