]> git.lizzy.rs Git - rust.git/commitdiff
add test for the suggestion from prelude
authorDouglas Campos <qmx@qmx.me>
Mon, 27 Aug 2018 14:12:31 +0000 (14:12 +0000)
committerDouglas Campos <qmx@qmx.me>
Mon, 27 Aug 2018 14:12:31 +0000 (14:12 +0000)
src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile [new file with mode: 0644]
src/test/run-make-fulldeps/use-suggestions-rust-2018/ep-nested-lib.rs [new file with mode: 0644]
src/test/run-make-fulldeps/use-suggestions-rust-2018/use-suggestions.rs [new file with mode: 0644]

diff --git a/src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile b/src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile
new file mode 100644 (file)
index 0000000..fc39691
--- /dev/null
@@ -0,0 +1,7 @@
+-include ../tools.mk
+
+all:
+       $(RUSTC) ep-nested-lib.rs
+
+       $(RUSTC) use-suggestions.rs --edition=2018 --extern ep_nested_lib=$(TMPDIR)/libep_nested_lib.rlib 2>&1 | $(CGREP) "use ep_nested_lib::foo::bar::Baz"
+
diff --git a/src/test/run-make-fulldeps/use-suggestions-rust-2018/ep-nested-lib.rs b/src/test/run-make-fulldeps/use-suggestions-rust-2018/ep-nested-lib.rs
new file mode 100644 (file)
index 0000000..c0bce6e
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_type = "rlib"]
+
+pub mod foo {
+    pub mod bar {
+        pub struct Baz;
+    }
+}
diff --git a/src/test/run-make-fulldeps/use-suggestions-rust-2018/use-suggestions.rs b/src/test/run-make-fulldeps/use-suggestions-rust-2018/use-suggestions.rs
new file mode 100644 (file)
index 0000000..62730a5
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+    let x = Baz{};
+}