]> git.proxmox.com Git - rustc.git/commitdiff
New upstream version 1.30.0+dfsg1
authorXimin Luo <infinity0@debian.org>
Wed, 31 Oct 2018 04:58:51 +0000 (21:58 -0700)
committerXimin Luo <infinity0@debian.org>
Wed, 31 Oct 2018 04:58:51 +0000 (21:58 -0700)
223 files changed:
RELEASES.md
git-commit-hash
src/ci/run.sh
src/doc/rustdoc/src/command-line-arguments.md
src/doc/rustdoc/src/unstable-features.md
src/doc/unstable-book/src/language-features/infer-outlives-requirements.md [new file with mode: 0644]
src/liballoc/collections/vec_deque.rs
src/liballoc/lib.rs
src/liballoc_jemalloc/lib.rs
src/liballoc_system/lib.rs
src/libarena/lib.rs
src/libcore/lib.rs
src/libfmt_macros/lib.rs
src/libgraphviz/lib.rs
src/libpanic_abort/lib.rs
src/libpanic_unwind/lib.rs
src/libproc_macro/lib.rs
src/libprofiler_builtins/lib.rs
src/librustc/diagnostics.rs
src/librustc/hir/map/definitions.rs
src/librustc/lib.rs
src/librustc/lint/levels.rs
src/librustc/middle/dead.rs
src/librustc/session/config.rs
src/librustc/ty/context.rs
src/librustc/ty/mod.rs
src/librustc/ty/query/on_disk_cache.rs
src/librustc_allocator/lib.rs
src/librustc_apfloat/lib.rs
src/librustc_asan/lib.rs
src/librustc_borrowck/lib.rs
src/librustc_codegen_llvm/lib.rs
src/librustc_codegen_llvm/type_of.rs
src/librustc_codegen_utils/lib.rs
src/librustc_cratesio_shim/src/lib.rs
src/librustc_data_structures/lib.rs
src/librustc_driver/driver.rs
src/librustc_driver/lib.rs
src/librustc_errors/lib.rs
src/librustc_incremental/lib.rs
src/librustc_lint/lib.rs
src/librustc_llvm/lib.rs
src/librustc_lsan/lib.rs
src/librustc_metadata/creader.rs
src/librustc_metadata/cstore.rs
src/librustc_metadata/cstore_impl.rs
src/librustc_metadata/decoder.rs
src/librustc_metadata/lib.rs
src/librustc_mir/const_eval.rs
src/librustc_mir/lib.rs
src/librustc_msan/lib.rs
src/librustc_passes/lib.rs
src/librustc_platform_intrinsics/lib.rs
src/librustc_plugin/lib.rs
src/librustc_privacy/lib.rs
src/librustc_resolve/lib.rs
src/librustc_resolve/macros.rs
src/librustc_resolve/resolve_imports.rs
src/librustc_save_analysis/lib.rs
src/librustc_target/lib.rs
src/librustc_traits/lib.rs
src/librustc_tsan/lib.rs
src/librustc_typeck/check_unused.rs
src/librustc_typeck/collect.rs
src/librustc_typeck/lib.rs
src/librustc_typeck/outlives/implicit_infer.rs
src/librustdoc/core.rs
src/librustdoc/lib.rs
src/librustdoc/test.rs
src/libserialize/lib.rs
src/libstd/lib.rs
src/libsyntax/config.rs
src/libsyntax/feature_gate.rs
src/libsyntax/lib.rs
src/libsyntax_ext/lib.rs
src/libsyntax_pos/edition.rs
src/libsyntax_pos/lib.rs
src/libterm/lib.rs
src/libtest/lib.rs
src/libunwind/lib.rs
src/stage0.txt
src/test/codegen/function-arguments.rs
src/test/compile-fail-fulldeps/proc-macro/proc-macro-attributes.rs
src/test/incremental/issue-51409.rs
src/test/run-pass/async-await.rs
src/test/run-pass/impl-trait/existential-minimal.stderr [new file with mode: 0644]
src/test/run-pass/impl-trait/issue-42479.stderr [new file with mode: 0644]
src/test/run-pass/impl-trait/issue-49376.stderr [new file with mode: 0644]
src/test/run-pass/issue-54462-mutable-noalias-correctness.rs [new file with mode: 0644]
src/test/run-pass/issue-54467.rs [new file with mode: 0644]
src/test/run-pass/issues/issue-49556.stderr [new file with mode: 0644]
src/test/run-pass/traits/conservative_impl_trait.stderr [new file with mode: 0644]
src/test/rustdoc-ui/failed-doctest-output.stdout
src/test/ui-fulldeps/custom-derive/auxiliary/plugin.rs
src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import-ambig.rs [new file with mode: 0644]
src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import-ambig.stderr [new file with mode: 0644]
src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import.rs [new file with mode: 0644]
src/test/ui-fulldeps/lint_tool_test.rs [deleted file]
src/test/ui-fulldeps/lint_tool_test.stderr [deleted file]
src/test/ui-fulldeps/proc-macro/derive-helper-shadowing.stderr
src/test/ui-fulldeps/rust-2018/suggestions-not-always-applicable.stderr
src/test/ui-fulldeps/unnecessary-extern-crate.rs
src/test/ui-fulldeps/unnecessary-extern-crate.stderr
src/test/ui/cfg-attr-trailing-comma.rs [new file with mode: 0644]
src/test/ui/cfg-attr-trailing-comma.stderr [new file with mode: 0644]
src/test/ui/consts/const-eval/union-ice.rs
src/test/ui/consts/const-eval/union-ice.stderr
src/test/ui/dep-graph/dep-graph-struct-signature.rs
src/test/ui/dep-graph/dep-graph-struct-signature.stderr
src/test/ui/directory_ownership/mod_file_not_owning.rs [new file with mode: 0644]
src/test/ui/directory_ownership/mod_file_not_owning.stderr [new file with mode: 0644]
src/test/ui/directory_ownership/unowned_mod_with_path.rs [new file with mode: 0644]
src/test/ui/directory_ownership/unowned_mod_with_path.stderr [new file with mode: 0644]
src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr
src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr
src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.rs [new file with mode: 0644]
src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.stderr [new file with mode: 0644]
src/test/ui/impl-trait/auxiliary/extra-item.rs [new file with mode: 0644]
src/test/ui/impl-trait/extra-item.rs [new file with mode: 0644]
src/test/ui/impl-trait/extra-item.stderr [new file with mode: 0644]
src/test/ui/imports/local-modularized-tricky-fail-1.stderr
src/test/ui/imports/macros.rs
src/test/ui/imports/macros.stderr
src/test/ui/issue-53419.rs
src/test/ui/issues/issue-37323.rs
src/test/ui/issues/issue-37323.stderr [new file with mode: 0644]
src/test/ui/issues/issue-54387.rs [new file with mode: 0644]
src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.rs
src/test/ui/lifetimes/lifetime-doesnt-live-long-enough.stderr
src/test/ui/lint/lint-ctypes.rs
src/test/ui/lint/lint-ctypes.stderr
src/test/ui/lint/lint-dead-code-1.rs
src/test/ui/lint/lint-dead-code-1.stderr
src/test/ui/macro_backtrace/main.stderr
src/test/ui/macros/ambiguity-legacy-vs-modern.rs [new file with mode: 0644]
src/test/ui/macros/ambiguity-legacy-vs-modern.stderr [new file with mode: 0644]
src/test/ui/no_owned_box_lang_item.rs
src/test/ui/non_modrs_mods/non_modrs_mods.rs [new file with mode: 0644]
src/test/ui/non_modrs_mods/non_modrs_mods.stderr [new file with mode: 0644]
src/test/ui/regions/regions-enum-not-wf.rs
src/test/ui/regions/regions-enum-not-wf.stderr
src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.rs
src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.stderr [new file with mode: 0644]
src/test/ui/regions/regions-outlives-nominal-type-enum-region.rs
src/test/ui/regions/regions-outlives-nominal-type-enum-region.stderr [new file with mode: 0644]
src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.rs
src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.stderr [new file with mode: 0644]
src/test/ui/regions/regions-outlives-nominal-type-enum-type.rs
src/test/ui/regions/regions-outlives-nominal-type-enum-type.stderr [new file with mode: 0644]
src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.rs
src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.stderr [new file with mode: 0644]
src/test/ui/regions/regions-outlives-nominal-type-struct-region.rs
src/test/ui/regions/regions-outlives-nominal-type-struct-region.stderr [new file with mode: 0644]
src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.rs
src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.stderr [new file with mode: 0644]
src/test/ui/regions/regions-outlives-nominal-type-struct-type.rs
src/test/ui/regions/regions-outlives-nominal-type-struct-type.stderr [new file with mode: 0644]
src/test/ui/regions/regions-struct-not-wf.lexical.stderr [new file with mode: 0644]
src/test/ui/regions/regions-struct-not-wf.nll.stderr [new file with mode: 0644]
src/test/ui/regions/regions-struct-not-wf.rs
src/test/ui/regions/regions-struct-not-wf.stderr [deleted file]
src/test/ui/rfc-2093-infer-outlives/cross-crate.rs
src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr
src/test/ui/rfc-2093-infer-outlives/dont-infer-static.rs
src/test/ui/rfc-2093-infer-outlives/dont-infer-static.stderr
src/test/ui/rfc-2093-infer-outlives/enum.rs
src/test/ui/rfc-2093-infer-outlives/enum.stderr
src/test/ui/rfc-2093-infer-outlives/explicit-dyn.rs
src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr
src/test/ui/rfc-2093-infer-outlives/explicit-enum.rs
src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr
src/test/ui/rfc-2093-infer-outlives/explicit-projection.rs
src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr
src/test/ui/rfc-2093-infer-outlives/explicit-struct.rs
src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr
src/test/ui/rfc-2093-infer-outlives/explicit-union.rs
src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr
src/test/ui/rfc-2093-infer-outlives/infer-static.rs
src/test/ui/rfc-2093-infer-outlives/infer-static.stderr
src/test/ui/rfc-2093-infer-outlives/nested-enum.rs
src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr
src/test/ui/rfc-2093-infer-outlives/nested-regions.rs
src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr
src/test/ui/rfc-2093-infer-outlives/nested-structs.rs
src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr
src/test/ui/rfc-2093-infer-outlives/nested-union.rs
src/test/ui/rfc-2093-infer-outlives/nested-union.stderr
src/test/ui/rfc-2093-infer-outlives/privacy.rs [deleted file]
src/test/ui/rfc-2093-infer-outlives/projection.rs
src/test/ui/rfc-2093-infer-outlives/projection.stderr
src/test/ui/rfc-2093-infer-outlives/reference.rs
src/test/ui/rfc-2093-infer-outlives/reference.stderr
src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs [deleted file]
src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr [deleted file]
src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs [deleted file]
src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr [deleted file]
src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs [deleted file]
src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr [deleted file]
src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs [deleted file]
src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr [deleted file]
src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs [deleted file]
src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr [deleted file]
src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs [deleted file]
src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr [deleted file]
src/test/ui/rfc-2093-infer-outlives/self-dyn.rs
src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr
src/test/ui/rfc-2093-infer-outlives/self-structs.rs
src/test/ui/rfc-2093-infer-outlives/self-structs.stderr
src/test/ui/run-pass/extern/extern-prelude-no-speculative.rs
src/test/ui/run-pass/non_modrs_mods/non_modrs_mods.rs [new file with mode: 0644]
src/test/ui/rust-2018/edition-lint-fully-qualified-paths.stderr
src/test/ui/rust-2018/edition-lint-nested-empty-paths.stderr
src/test/ui/rust-2018/edition-lint-nested-paths.stderr
src/test/ui/rust-2018/edition-lint-paths.stderr
src/test/ui/rust-2018/extern-crate-rename.stderr
src/test/ui/rust-2018/extern-crate-submod.stderr
src/test/ui/rust-2018/remove-extern-crate.fixed
src/test/ui/rust-2018/remove-extern-crate.rs
src/test/ui/rust-2018/remove-extern-crate.stderr
src/test/ui/typeck/typeck_type_placeholder_item.stderr
src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.rs
src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr
version

index 819c9184364fdd773bd8b59432e7e2ebdc0c1685..70a7dab72272f63ccbd368fde14d3db34e5ae630 100644 (file)
@@ -1,3 +1,144 @@
+Version 1.30.0 (2018-10-25)
+==========================
+
+Language
+--------
+- [Procedural macros are now available.][52081] These kinds of macros allow for
+  more powerful code generation. There is a [new chapter available][proc-macros]
+  in the Rust Programming Language book that goes further in depth.
+- [You can now use keywords as identifiers using the raw identifiers
+  syntax (`r#`),][53236] e.g. `let r#for = true;`
+- [Using anonymous parameters in traits is now deprecated with a warning and
+  will be a hard error in the 2018 edition.][53272]
+- [You can now use `crate` in paths.][54404] This allows you to refer to the
+  crate root in the path, e.g. `use crate::foo;` refers to `foo` in `src/lib.rs`.
+- [Using a external crate no longer requires being prefixed with `::`.][54404]
+  Previously, using a external crate in a module without a use statement
+  required `let json = ::serde_json::from_str(foo);` but can now be written
+  as `let json = serde_json::from_str(foo);`.
+- [You can now apply the `#[used]` attribute to static items to prevent the
+  compiler from optimising them away, even if they appear to be unused,][51363]
+  e.g. `#[used] static FOO: u32 = 1;`
+- [You can now import and reexport macros from other crates with the `use`
+  syntax.][50911] Macros exported with `#[macro_export]` are now placed into
+  the root module of the crate. If your macro relies on calling other local
+  macros, it is recommended to export with the
+  `#[macro_export(local_inner_macros)]` attribute so users won't have to import
+  those macros.
+- [You can now catch visibility keywords (e.g. `pub`, `pub(crate)`) in macros
+  using the `vis` specifier.][53370]
+- [Non-macro attributes now allow all forms of literals, not just
+  strings.][53044] Previously, you would write `#[attr("true")]`, and you can now
+  write `#[attr(true)]`.
+- [You can now specify a function to handle a panic in the Rust runtime with the
+  `#[panic_handler]` attribute.][51366]
+
+Compiler
+--------
+- [Added the `riscv32imc-unknown-none-elf` target.][53822]
+- [Added the `aarch64-unknown-netbsd` target][53165]
+
+Libraries
+---------
+- [`ManuallyDrop` now allows the inner type to be unsized.][53033]
+
+Stabilized APIs
+---------------
+- [`Ipv4Addr::BROADCAST`]
+- [`Ipv4Addr::LOCALHOST`]
+- [`Ipv4Addr::UNSPECIFIED`]
+- [`Ipv6Addr::LOCALHOST`]
+- [`Ipv6Addr::UNSPECIFIED`]
+- [`Iterator::find_map`]
+
+  The following methods are replacement methods for `trim_left`, `trim_right`,
+  `trim_left_matches`, and `trim_right_matches`, which will be deprecated
+  in 1.33.0:
+- [`str::trim_end_matches`]
+- [`str::trim_end`]
+- [`str::trim_start_matches`]
+- [`str::trim_start`]
+
+Cargo
+----
+- [`cargo run` doesn't require specifying a package in workspaces.][cargo/5877]
+- [`cargo doc` now supports `--message-format=json`.][cargo/5878] This is
+  equivalent to calling `rustdoc --error-format=json`.
+- [You can specify which edition to create a project in cargo
+  with `cargo new --edition`.][cargo/5984] Currently only `2015` is a
+  valid option.
+- [Cargo will now provide a progress bar for builds.][cargo/5995]
+
+Misc
+----
+- [`rustdoc` allows you to specify what edition to treat your code as with the
+  `--edition` option.][54057]
+- [`rustdoc` now has the `--color` (specify whether to output color) and
+  `--error-format` (specify error format, e.g. `json`) options.][53003]
+- [We now distribute a `rust-gdbgui` script that invokes `gdbgui` with Rust
+  debug symbols.][53774]
+- [Attributes from Rust tools such as `rustfmt` or `clippy` are now
+  available,][53459] e.g. `#[rustfmt::skip]` will skip formatting the next item.
+
+[50911]: https://github.com/rust-lang/rust/pull/50911/
+[51363]: https://github.com/rust-lang/rust/pull/51363/
+[51366]: https://github.com/rust-lang/rust/pull/51366/
+[52081]: https://github.com/rust-lang/rust/pull/52081/
+[53003]: https://github.com/rust-lang/rust/pull/53003/
+[53033]: https://github.com/rust-lang/rust/pull/53033/
+[53044]: https://github.com/rust-lang/rust/pull/53044/
+[53165]: https://github.com/rust-lang/rust/pull/53165/
+[53213]: https://github.com/rust-lang/rust/pull/53213/
+[53236]: https://github.com/rust-lang/rust/pull/53236/
+[53272]: https://github.com/rust-lang/rust/pull/53272/
+[53370]: https://github.com/rust-lang/rust/pull/53370/
+[53459]: https://github.com/rust-lang/rust/pull/53459/
+[53774]: https://github.com/rust-lang/rust/pull/53774/
+[53822]: https://github.com/rust-lang/rust/pull/53822/
+[54057]: https://github.com/rust-lang/rust/pull/54057/
+[54146]: https://github.com/rust-lang/rust/pull/54146/
+[54404]: https://github.com/rust-lang/rust/pull/54404/
+[cargo/5877]: https://github.com/rust-lang/cargo/pull/5877/
+[cargo/5878]: https://github.com/rust-lang/cargo/pull/5878/
+[cargo/5984]: https://github.com/rust-lang/cargo/pull/5984/
+[cargo/5995]: https://github.com/rust-lang/cargo/pull/5995/
+[proc-macros]: https://doc.rust-lang.org/book/2018-edition/ch19-06-macros.html
+
+[`Ipv4Addr::BROADCAST`]: https://doc.rust-lang.org/nightly/std/net/struct.Ipv4Addr.html#associatedconstant.BROADCAST
+[`Ipv4Addr::LOCALHOST`]: https://doc.rust-lang.org/nightly/std/net/struct.Ipv4Addr.html#associatedconstant.LOCALHOST
+[`Ipv4Addr::UNSPECIFIED`]: https://doc.rust-lang.org/nightly/std/net/struct.Ipv4Addr.html#associatedconstant.UNSPECIFIED
+[`Ipv6Addr::LOCALHOST`]: https://doc.rust-lang.org/nightly/std/net/struct.Ipv6Addr.html#associatedconstant.LOCALHOST
+[`Ipv6Addr::UNSPECIFIED`]: https://doc.rust-lang.org/nightly/std/net/struct.Ipv6Addr.html#associatedconstant.UNSPECIFIED
+[`Iterator::find_map`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.find_map
+[`str::trim_end_matches`]: https://doc.rust-lang.org/nightly/std/primitive.str.html#method.trim_end_matches
+[`str::trim_end`]: https://doc.rust-lang.org/nightly/std/primitive.str.html#method.trim_end
+[`str::trim_start_matches`]: https://doc.rust-lang.org/nightly/std/primitive.str.html#method.trim_start_matches
+[`str::trim_start`]: https://doc.rust-lang.org/nightly/std/primitive.str.html#method.trim_start
+
+
+Version 1.29.2 (2018-10-11)
+===========================
+
+- [Workaround for an aliasing-related LLVM bug, which caused miscompilation.][54639]
+- The `rls-preview` component on the windows-gnu targets has been restored.
+
+[54639]: https://github.com/rust-lang/rust/pull/54639
+
+
+Version 1.29.1 (2018-09-25)
+===========================
+
+Security Notes
+--------------
+
+- The standard library's `str::repeat` function contained an out of bounds write
+  caused by an integer overflow. This has been fixed by deterministically
+  panicking when an overflow happens.
+
+  Thank you to Scott McMurray for responsibily disclosing this vulnerability to
+  us.
+
+
 Version 1.29.0 (2018-09-13)
 ==========================
 
@@ -9,7 +150,7 @@ Compiler
 
 Libraries
 ---------
-- [`Once::call_once` now no longer requires `Once` to be `'static`.][52239]
+- [`Once::call_once` no longer requires `Once` to be `'static`.][52239]
 - [`BuildHasherDefault` now implements `PartialEq` and `Eq`.][52402]
 - [`Box<CStr>`, `Box<OsStr>`, and `Box<Path>` now implement `Clone`.][51912]
 - [Implemented `PartialEq<&str>` for `OsString` and `PartialEq<OsString>`
@@ -25,10 +166,10 @@ Stabilized APIs
 
 Cargo
 -----
-- [Cargo can silently fix some bad lockfiles ][cargo/5831] You can use
-  `--locked` to disable this behaviour.
+- [Cargo can silently fix some bad lockfiles.][cargo/5831] You can use
+  `--locked` to disable this behavior.
 - [`cargo-install` will now allow you to cross compile an install
-  using `--target`][cargo/5614]
+  using `--target`.][cargo/5614]
 - [Added the `cargo-fix` subcommand to automatically move project code from
   2015 edition to 2018.][cargo/5723]
 - [`cargo doc` can now optionally document private types using the
@@ -40,19 +181,22 @@ Misc
   the specified level to that level.][52354] For example `--cap-lints warn`
   will demote `deny` and `forbid` lints to `warn`.
 - [`rustc` and `rustdoc` will now have the exit code of `1` if compilation
-  fails, and `101` if there is a panic.][52197]
+  fails and `101` if there is a panic.][52197]
 - [A preview of clippy has been made available through rustup.][51122]
-  You can install the preview with `rustup component add clippy-preview`
+  You can install the preview with `rustup component add clippy-preview`.
 
 Compatibility Notes
 -------------------
 - [`str::{slice_unchecked, slice_unchecked_mut}` are now deprecated.][51807]
   Use `str::get_unchecked(begin..end)` instead.
-- [`std::env::home_dir` is now deprecated for its unintuitive behaviour.][51656]
+- [`std::env::home_dir` is now deprecated for its unintuitive behavior.][51656]
   Consider using the `home_dir` function from
   https://crates.io/crates/dirs instead.
 - [`rustc` will no longer silently ignore invalid data in target spec.][52330]
+- [`cfg` attributes and `--cfg` command line flags are now more
+  strictly validated.][53893]
 
+[53893]: https://github.com/rust-lang/rust/pull/53893/
 [52861]: https://github.com/rust-lang/rust/pull/52861/
 [52656]: https://github.com/rust-lang/rust/pull/52656/
 [52239]: https://github.com/rust-lang/rust/pull/52239/
@@ -285,7 +429,7 @@ Language
   be used as an identifier.
 - [The dyn syntax is now available.][49968] This syntax is equivalent to the
   bare `Trait` syntax, and should make it clearer when being used in tandem with
-  `impl Trait`. Since it is equivalent to the following syntax:
+  `impl Trait` because it is equivalent to the following syntax:
   `&Trait == &dyn Trait`, `&mut Trait == &mut dyn Trait`, and
   `Box<Trait> == Box<dyn Trait>`.
 - [Attributes on generic parameters such as types and lifetimes are
@@ -348,10 +492,10 @@ Cargo
   a different directory than `target` for placing compilation artifacts.
 - [Cargo will be adding automatic target inference for binaries, benchmarks,
   examples, and tests in the Rust 2018 edition.][cargo/5335] If your project specifies
-  specific targets e.g. using `[[bin]]` and have other binaries in locations
+  specific targets, e.g. using `[[bin]]`, and have other binaries in locations
   where cargo would infer a binary, Cargo will produce a warning. You can
-  disable this feature ahead of time by setting any of the following `autobins`,
-  `autobenches`, `autoexamples`, `autotests` to false.
+  disable this feature ahead of time by setting any of the following to false:
+  `autobins`, `autobenches`, `autoexamples`, `autotests`.
 - [Cargo will now cache compiler information.][cargo/5359] This can be disabled by
   setting `CARGO_CACHE_RUSTC_INFO=0` in your environment.
 
@@ -367,8 +511,8 @@ Compatibility Notes
   work.][49896] e.g. `::core::prelude::v1::StrExt::is_empty("")` will not
   compile, `"".is_empty()` will still compile.
 - [`Debug` output on `atomic::{AtomicBool, AtomicIsize, AtomicPtr, AtomicUsize}`
-  will only print the inner type.][48553] e.g.
-  `print!("{:?}", AtomicBool::new(true))` will print `true`
+  will only print the inner type.][48553] E.g.
+  `print!("{:?}", AtomicBool::new(true))` will print `true`,
   not `AtomicBool(true)`.
 - [The maximum number for `repr(align(N))` is now 2²⁹.][50378] Previously you
   could enter higher numbers but they were not supported by LLVM. Up to 512MB
@@ -431,7 +575,7 @@ Version 1.26.2 (2018-06-05)
 Compatibility Notes
 -------------------
 
-- [The borrow checker was fixed to avoid unsoundness when using match ergonomics][51117]
+- [The borrow checker was fixed to avoid unsoundness when using match ergonomics.][51117]
 
 [51117]: https://github.com/rust-lang/rust/issues/51117
 
@@ -442,18 +586,18 @@ Version 1.26.1 (2018-05-29)
 Tools
 -----
 
-- [RLS now works on Windows][50646]
-- [Rustfmt stopped badly formatting text in some cases][rustfmt/2695]
+- [RLS now works on Windows.][50646]
+- [Rustfmt stopped badly formatting text in some cases.][rustfmt/2695]
 
 
 Compatibility Notes
 --------
 
 - [`fn main() -> impl Trait` no longer works for non-Termination
-  trait][50656]
+  trait.][50656]
   This reverts an accidental stabilization.
-- [`NaN > NaN` no longer returns true in const-fn contexts][50812]
-- [Prohibit using turbofish for `impl Trait` in method arguments][50950]
+- [`NaN > NaN` no longer returns true in const-fn contexts.][50812]
+- [Prohibit using turbofish for `impl Trait` in method arguments.][50950]
 
 [50646]: https://github.com/rust-lang/rust/issues/50646
 [50656]: https://github.com/rust-lang/rust/pull/50656
@@ -469,18 +613,18 @@ Language
 - [Closures now implement `Copy` and/or `Clone` if all captured variables
   implement either or both traits.][49299]
 - [The inclusive range syntax e.g. `for x in 0..=10` is now stable.][47813]
-- [The `'_` lifetime is now stable. The underscore lifetime can be used anywhere where a
+- [The `'_` lifetime is now stable. The underscore lifetime can be used anywhere a
   lifetime can be elided.][49458]
 - [`impl Trait` is now stable allowing you to have abstract types in returns
-   or in function parameters.][49255] e.g. `fn foo() -> impl Iterator<Item=u8>` or
+   or in function parameters.][49255] E.g. `fn foo() -> impl Iterator<Item=u8>` or
   `fn open(path: impl AsRef<Path>)`.
 - [Pattern matching will now automatically apply dereferences.][49394]
 - [128-bit integers in the form of `u128` and `i128` are now stable.][49101]
 - [`main` can now return `Result<(), E: Debug>`][49162] in addition to `()`.
 - [A lot of operations are now available in a const context.][46882] E.g. You
   can now index into constant arrays, reference and dereference into constants,
-  and use Tuple struct constructors.
-- [Fixed entry slice patterns are now stable.][48516] e.g.
+  and use tuple struct constructors.
+- [Fixed entry slice patterns are now stable.][48516] E.g.
   ```rust
   let points = [1, 2, 3, 4];
   match points {
@@ -905,7 +1049,7 @@ Language
 Compiler
 --------
 - [Enabled `TrapUnreachable` in LLVM which should mitigate the impact of
-  undefined behaviour.][45920]
+  undefined behavior.][45920]
 - [rustc now suggests renaming import if names clash.][45660]
 - [Display errors/warnings correctly when there are zero-width or
   wide characters.][45711]
index 4c97a81ef53ec39f3d4b19ab290e0cb738018958..92715c5caf0c3c23aebf90e32ceae9213be454c5 100644 (file)
@@ -1 +1 @@
-0ebb250883d63faae833070c11287fc6e7305517
\ No newline at end of file
+da5f414c2c0bfe5198934493f04c676e2b23ff2e
\ No newline at end of file
index a965c44031aee9ebb7fc0eee19b62df239697664..7b89ab5a9f8719e207401800bdeddbfc3f137fea 100755 (executable)
@@ -51,7 +51,7 @@ fi
 #
 # FIXME: need a scheme for changing this `nightly` value to `beta` and `stable`
 #        either automatically or manually.
-export RUST_RELEASE_CHANNEL=beta
+export RUST_RELEASE_CHANNEL=stable
 if [ "$DEPLOY$DEPLOY_ALT" != "" ]; then
   RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=$RUST_RELEASE_CHANNEL"
   RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-static-stdcpp"
index aba485f752ab2bd9b706a1a9739d32bfd2ae1d5c..417608cc5ca0a3e57f76c4cde1c28bc0addfabc3 100644 (file)
@@ -345,17 +345,3 @@ $ rustdoc src/lib.rs --sysroot /path/to/sysroot
 
 Similar to `rustc --sysroot`, this lets you change the sysroot `rustdoc` uses
 when compiling your code.
-
-### `--edition`: control the edition of docs and doctests
-
-Using this flag looks like this:
-
-```bash
-$ rustdoc src/lib.rs --edition 2018
-$ rustdoc --test src/lib.rs --edition 2018
-```
-
-This flag allows rustdoc to treat your rust code as the given edition. It will compile doctests with
-the given edition as well. As with `rustc`, the default edition that `rustdoc` will use is `2015`
-(the first edition).
-
index 071575b1fc094e7c48de83422ed53e7c6497e165..32fb8c2f7d58e4f9330946fef58512f133d37076 100644 (file)
@@ -346,6 +346,19 @@ details.
 
 [issue-display-warnings]: https://github.com/rust-lang/rust/issues/41574
 
+### `--edition`: control the edition of docs and doctests
+
+Using this flag looks like this:
+
+```bash
+$ rustdoc src/lib.rs -Z unstable-options --edition 2018
+$ rustdoc --test src/lib.rs -Z unstable-options --edition 2018
+```
+
+This flag allows rustdoc to treat your rust code as the given edition. It will compile doctests with
+the given edition as well. As with `rustc`, the default edition that `rustdoc` will use is `2015`
+(the first edition).
+
 ### `--extern-html-root-url`: control how rustdoc links to non-local crates
 
 Using this flag looks like this:
diff --git a/src/doc/unstable-book/src/language-features/infer-outlives-requirements.md b/src/doc/unstable-book/src/language-features/infer-outlives-requirements.md
new file mode 100644 (file)
index 0000000..fe82f85
--- /dev/null
@@ -0,0 +1,67 @@
+# `infer_outlives_requirements`
+
+The tracking issue for this feature is: [#44493]
+
+[#44493]: https://github.com/rust-lang/rust/issues/44493
+
+------------------------
+The `infer_outlives_requirements` feature indicates that certain
+outlives requirements can be inferred by the compiler rather than
+stating them explicitly.
+
+For example, currently generic struct definitions that contain
+references, require where-clauses of the form T: 'a. By using
+this feature the outlives predicates will be inferred, although
+they may still be written explicitly.
+
+```rust,ignore (pseudo-Rust)
+struct Foo<'a, T>
+  where T: 'a // <-- currently required
+  {
+      bar: &'a T,
+  }
+```
+
+
+## Examples:
+
+
+```rust,ignore (pseudo-Rust)
+#![feature(infer_outlives_requirements)]
+
+// Implicitly infer T: 'a
+struct Foo<'a, T> {
+    bar: &'a T,
+}
+```
+
+```rust,ignore (pseudo-Rust)
+#![feature(infer_outlives_requirements)]
+
+// Implicitly infer `U: 'b`
+struct Foo<'b, U> {
+    bar: Bar<'b, U>
+}
+
+struct Bar<'a, T> where T: 'a {
+    x: &'a (),
+    y: T,
+}
+```
+
+```rust,ignore (pseudo-Rust)
+#![feature(infer_outlives_requirements)]
+
+// Implicitly infer `b': 'a`
+struct Foo<'a, 'b, T> {
+    x: &'a &'b T
+}
+```
+
+```rust,ignore (pseudo-Rust)
+#![feature(infer_outlives_requirements)]
+
+// Implicitly infer `<T as std::iter::Iterator>::Item : 'a`
+struct Foo<'a, T: Iterator> {
+    bar: &'a T::Item
+```
index c53549ab85d6d5aa075e9f0e168f0d4e512ae206..571f35a2031d2a0b9e1eb57ac1f9728ca2fb245f 100644 (file)
@@ -19,7 +19,6 @@
 
 use core::cmp::Ordering;
 use core::fmt;
-use core::isize;
 use core::iter::{repeat, FromIterator, FusedIterator};
 use core::mem;
 use core::ops::Bound::{Excluded, Included, Unbounded};
@@ -203,33 +202,6 @@ impl<T> VecDeque<T> {
                                  len);
     }
 
-    /// Copies all values from `src` to the back of `self`, wrapping around if needed.
-    ///
-    /// # Safety
-    ///
-    /// The capacity must be sufficient to hold self.len() + src.len() elements.
-    /// If so, this function never panics.
-    #[inline]
-    unsafe fn copy_slice(&mut self, src: &[T]) {
-        /// This is guaranteed by `RawVec`.
-        debug_assert!(self.capacity() <= isize::MAX as usize);
-
-        let expected_new_len = self.len() + src.len();
-        debug_assert!(self.capacity() >= expected_new_len);
-
-        let dst_high_ptr = self.ptr().add(self.head);
-        let dst_high_len = self.cap() - self.head;
-
-        let split = cmp::min(src.len(), dst_high_len);
-        let (src_high, src_low) = src.split_at(split);
-
-        ptr::copy_nonoverlapping(src_high.as_ptr(), dst_high_ptr, src_high.len());
-        ptr::copy_nonoverlapping(src_low.as_ptr(), self.ptr(), src_low.len());
-
-        self.head = self.wrap_add(self.head, src.len());
-        debug_assert!(self.len() == expected_new_len);
-    }
-
     /// Copies a potentially wrapping block of memory len long from src to dest.
     /// (abs(dst - src) + len) must be no larger than cap() (There must be at
     /// most one continuous overlapping region between src and dest).
@@ -1052,7 +1024,7 @@ impl<T> VecDeque<T> {
             iter: Iter {
                 tail: drain_tail,
                 head: drain_head,
-                ring: unsafe { self.buffer_as_slice() },
+                ring: unsafe { self.buffer_as_mut_slice() },
             },
         }
     }
@@ -1862,22 +1834,8 @@ impl<T> VecDeque<T> {
     #[inline]
     #[stable(feature = "append", since = "1.4.0")]
     pub fn append(&mut self, other: &mut Self) {
-        unsafe {
-            // Guarantees there is space in `self` for `other`.
-            self.reserve(other.len());
-
-            {
-                let (src_high, src_low) = other.as_slices();
-
-                // This is only safe because copy_slice never panics when capacity is sufficient.
-                self.copy_slice(src_low);
-                self.copy_slice(src_high);
-            }
-
-            // Some values now exist in both `other` and `self` but are made inaccessible
-            // in`other`.
-            other.tail = other.head;
-        }
+        // naive impl
+        self.extend(other.drain(..));
     }
 
     /// Retains only the elements specified by the predicate.
@@ -2635,8 +2593,8 @@ impl<T> From<VecDeque<T>> for Vec<T> {
                         let mut right_offset = 0;
                         for i in left_edge..right_edge {
                             right_offset = (i - left_edge) % (cap - right_edge);
-                            let src = right_edge + right_offset;
-                            ptr::swap(buf.add(i), buf.add(src));
+                            let src: isize = (right_edge + right_offset) as isize;
+                            ptr::swap(buf.add(i), buf.offset(src));
                         }
                         let n_ops = right_edge - left_edge;
                         left_edge += n_ops;
index 2d271fd0dca8dcb0adc68f7c53cf4bf8e6dc02af..452d2b1472ff4a2fb8d9b29e7097ae6da75700fb 100644 (file)
@@ -77,6 +77,7 @@
 #![cfg_attr(not(test), feature(fn_traits))]
 #![cfg_attr(not(test), feature(generator_trait))]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![cfg_attr(test, feature(test))]
 
 #![feature(allocator_api)]
index bdf0e37a2e672d8de3ae3d274b31a294c12918e8..3d2348f3e4546dd0701e127919c1b1cf7d3345ea 100644 (file)
@@ -17,6 +17,7 @@
 #![feature(libc)]
 #![feature(linkage)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(staged_api)]
 #![feature(rustc_attrs)]
 #![cfg_attr(dummy_jemalloc, allow(dead_code, unused_extern_crates))]
index 65204ebf71413027a9bf79f0c0ff048907d03f74..8848be5903810ef96bdbc44dda078a543e1c4fe0 100644 (file)
@@ -18,6 +18,7 @@
 #![feature(allocator_api)]
 #![feature(core_intrinsics)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(staged_api)]
 #![feature(rustc_attrs)]
 #![cfg_attr(any(unix, target_os = "cloudabi", target_os = "redox"), feature(libc))]
index 6ad703180c224eecd7e6777c5beb18c17ea8fe5f..5cb8975e9ce973cdf233afc74c3e398848558966 100644 (file)
@@ -27,6 +27,7 @@
 #![feature(core_intrinsics)]
 #![feature(dropck_eyepatch)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(raw_vec_internals)]
 #![cfg_attr(test, feature(test))]
 
index 675e73e952cc2ca011c055a949d38c75e99b18e2..1c803f896aa175b9ae889a87a51f781739fba212 100644 (file)
@@ -92,6 +92,7 @@
 #![feature(link_llvm_intrinsics)]
 #![feature(never_type)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(exhaustive_patterns)]
 #![feature(macro_at_most_once_rep)]
 #![feature(no_core)]
index 1bac6d22d37441effd48a7ef1e4b0755c8c67979..3720100700c9c2768249fae7fa488c62e39f78b0 100644 (file)
@@ -21,6 +21,7 @@
        test(attr(deny(warnings))))]
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 
 pub use self::Piece::*;
 pub use self::Position::*;
index 9fa48adebdf07a523411152409a2e1465c07fc37..5a0c983b521a54c5afee7a4689ef59ca0478ea86 100644 (file)
        test(attr(allow(unused_variables), deny(warnings))))]
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(str_escape)]
 
 use self::LabelText::*;
index 14221f3d79e84050f91f50b58736b1281b022c8f..4da88d8522196642536d29cc876dbeb355f4f84b 100644 (file)
@@ -25,6 +25,7 @@
 #![feature(core_intrinsics)]
 #![feature(libc)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(panic_runtime)]
 #![feature(staged_api)]
 #![feature(rustc_attrs)]
index 9c3fc76c307a6f7696ba4ce2f163c1dea7812602..3368790b3f76fad2e61742431b09324a532ff8ee 100644 (file)
@@ -35,6 +35,7 @@
 #![feature(lang_items)]
 #![feature(libc)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(panic_unwind)]
 #![feature(raw)]
 #![feature(staged_api)]
index 1a0dde3ccd7c3c331aaad23584145f8b9823733f..31c4e79211494dccddb69a2ea3faf86c9b4b6745 100644 (file)
@@ -28,6 +28,7 @@
        test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))))]
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(rustc_private)]
 #![feature(staged_api)]
 #![feature(lang_items)]
index a85593253b100f8f184ab7a336335ef7961ea5e8..00dd87022c268533b20c55493f2359fa9dfdbc1e 100644 (file)
@@ -16,4 +16,5 @@
             issue = "0")]
 #![allow(unused_features)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(staged_api)]
index 3318bbd8c870ec20a9294a1c349dc466a970c789..a3c0688dcc8edcaad3955249d64f03ba0cd7ab8c 100644 (file)
@@ -1232,54 +1232,41 @@ let x: i32 = "I am not a number!";
 "##,
 
 E0309: r##"
-The type definition contains some field whose type
-requires an outlives annotation. Outlives annotations
-(e.g., `T: 'a`) are used to guarantee that all the data in T is valid
-for at least the lifetime `'a`. This scenario most commonly
-arises when the type contains an associated type reference
-like `<T as SomeTrait<'a>>::Output`, as shown in this example:
+Types in type definitions have lifetimes associated with them that represent
+how long the data stored within them is guaranteed to be live. This lifetime
+must be as long as the data needs to be alive, and missing the constraint that
+denotes this will cause this error.
 
 ```compile_fail,E0309
-// This won't compile because the applicable impl of
-// `SomeTrait` (below) requires that `T: 'a`, but the struct does
-// not have a matching where-clause.
+// This won't compile because T is not constrained, meaning the data
+// stored in it is not guaranteed to last as long as the reference
 struct Foo<'a, T> {
-    foo: <T as SomeTrait<'a>>::Output,
-}
-
-trait SomeTrait<'a> {
-    type Output;
-}
-
-impl<'a, T> SomeTrait<'a> for T
-where
-    T: 'a,
-{
-    type Output = u32;
+    foo: &'a T
 }
 ```
 
-Here, the where clause `T: 'a` that appears on the impl is not known to be
-satisfied on the struct. To make this example compile, you have to add
-a where-clause like `T: 'a` to the struct definition:
+This will compile, because it has the constraint on the type parameter:
 
 ```
-struct Foo<'a, T>
-where
-    T: 'a,
-{
-    foo: <T as SomeTrait<'a>>::Output
+struct Foo<'a, T: 'a> {
+    foo: &'a T
 }
+```
 
-trait SomeTrait<'a> {
-    type Output;
+To see why this is important, consider the case where `T` is itself a reference
+(e.g., `T = &str`). If we don't include the restriction that `T: 'a`, the
+following code would be perfectly legal:
+
+```compile_fail,E0309
+struct Foo<'a, T> {
+    foo: &'a T
 }
 
-impl<'a, T> SomeTrait<'a> for T
-where
-    T: 'a,
-{
-    type Output = u32;
+fn main() {
+    let v = "42".to_string();
+    let f = Foo{foo: &v};
+    drop(v);
+    println!("{}", f.foo); // but we've already dropped v!
 }
 ```
 "##,
@@ -1478,31 +1465,30 @@ A reference has a longer lifetime than the data it references.
 Erroneous code example:
 
 ```compile_fail,E0491
-trait SomeTrait<'a> {
-    type Output;
+// struct containing a reference requires a lifetime parameter,
+// because the data the reference points to must outlive the struct (see E0106)
+struct Struct<'a> {
+    ref_i32: &'a i32,
 }
 
-impl<'a, T> SomeTrait<'a> for T {
-    type Output = &'a T; // compile error E0491
+// However, a nested struct like this, the signature itself does not tell
+// whether 'a outlives 'b or the other way around.
+// So it could be possible that 'b of reference outlives 'a of the data.
+struct Nested<'a, 'b> {
+    ref_struct: &'b Struct<'a>, // compile error E0491
 }
 ```
 
-Here, the problem is that a reference type like `&'a T` is only valid
-if all the data in T outlives the lifetime `'a`. But this impl as written
-is applicable to any lifetime `'a` and any type `T` -- we have no guarantee
-that `T` outlives `'a`. To fix this, you can add a where clause like
-`where T: 'a`.
+To fix this issue, you can specify a bound to the lifetime like below:
 
 ```
-trait SomeTrait<'a> {
-    type Output;
+struct Struct<'a> {
+    ref_i32: &'a i32,
 }
 
-impl<'a, T> SomeTrait<'a> for T
-where
-    T: 'a,
-{
-    type Output = &'a T; // compile error E0491
+// 'a: 'b means 'a outlives 'b
+struct Nested<'a: 'b, 'b> {
+    ref_struct: &'b Struct<'a>,
 }
 ```
 "##,
index c85cee736605533781bf9a876283e1b435737ecf..fa4bf1511b87434bc6c1d2094293f2b96fed6afe 100644 (file)
@@ -287,6 +287,31 @@ impl DefPath {
         s
     }
 
+    /// Return filename friendly string of the DefPah with the
+    /// crate-prefix.
+    pub fn to_string_friendly<F>(&self, crate_imported_name: F) -> String
+        where F: FnOnce(CrateNum) -> Symbol
+    {
+        let crate_name_str = crate_imported_name(self.krate).as_str();
+        let mut s = String::with_capacity(crate_name_str.len() + self.data.len() * 16);
+
+        write!(s, "::{}", crate_name_str).unwrap();
+
+        for component in &self.data {
+            if component.disambiguator == 0 {
+                write!(s, "::{}", component.data.as_interned_str()).unwrap();
+            } else {
+                write!(s,
+                       "{}[{}]",
+                       component.data.as_interned_str(),
+                       component.disambiguator)
+                    .unwrap();
+            }
+        }
+
+        s
+    }
+
     /// Return filename friendly string of the DefPah without
     /// the crate-prefix. This method is useful if you don't have
     /// a TyCtxt available.
index 2eaf1eebb394ca5bc09ec9e754825e258de3b29d..3570e65584e8dd64cb7102d5bbdac273b284a0ad 100644 (file)
@@ -52,6 +52,7 @@
 #![feature(exhaustive_patterns)]
 #![feature(extern_types)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(non_exhaustive)]
 #![feature(proc_macro_internals)]
 #![feature(quote)]
index 336ebe79d33abd7276eb6d20f6f427be9f82b04b..e430aec8d0f5b571b703bd2b709a4399a5f0677a 100644 (file)
@@ -299,7 +299,7 @@ impl<'a> LintLevelsBuilder<'a> {
                                     "change it to",
                                     new_lint_name.to_string(),
                                     Applicability::MachineApplicable,
-                                ).emit();
+                                ).cancel();
 
                                 let src = LintSource::Node(Symbol::intern(&new_lint_name), li.span);
                                 for id in ids {
index d320173f9f47d01d95361323f5e58db16819f902..e9e8fc5cf27c9954ce0412d1a677c0c0f1e56de3 100644 (file)
@@ -395,7 +395,13 @@ fn create_and_seed_worklist<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                                       krate: &hir::Crate)
                                       -> Vec<ast::NodeId>
 {
-    let worklist = access_levels.map.iter().map(|(&id, _)| id).chain(
+    let worklist = access_levels.map.iter().filter_map(|(&id, level)| {
+        if level >= &privacy::AccessLevel::Reachable {
+            Some(id)
+        } else {
+            None
+        }
+    }).chain(
         // Seed entry point
         tcx.sess.entry_fn.borrow().map(|(id, _, _)| id)
     ).collect::<Vec<_>>();
index 4c0eeba74415076b3616e2edab6df8a32da371b7..da3d0d5ed3fe771003eed128628412ec3aa244de 100644 (file)
@@ -646,7 +646,6 @@ impl Options {
         match self.debugging_opts.share_generics {
             Some(setting) => setting,
             None => {
-                self.incremental.is_some() ||
                 match self.optimize {
                     OptLevel::No   |
                     OptLevel::Less |
index 6738267b5b8c809ef5f987b39d88c0ddce10bc6f..5acbf9b424d719d66b4b79f28c4dca44084892cd 100644 (file)
@@ -927,8 +927,8 @@ pub struct GlobalCtxt<'tcx> {
     freevars: FxHashMap<DefId, Lrc<Vec<hir::Freevar>>>,
 
     maybe_unused_trait_imports: FxHashSet<DefId>,
-
     maybe_unused_extern_crates: Vec<(DefId, Span)>,
+    pub extern_prelude: FxHashSet<ast::Name>,
 
     // Internal cache for metadata decoding. No need to track deps on this.
     pub rcache: Lock<FxHashMap<ty::CReaderCacheKey, Ty<'tcx>>>,
@@ -1245,6 +1245,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
                     .into_iter()
                     .map(|(id, sp)| (hir.local_def_id(id), sp))
                     .collect(),
+            extern_prelude: resolutions.extern_prelude,
             hir,
             def_path_hash_to_def_id,
             queries: query::Queries::new(
index d9e3bdaf266a9a76a8d19210b18f8a78a321edbe..bfbd91cdaea55e425bc5aa56e2eb62ad958d33ca 100644 (file)
@@ -36,7 +36,7 @@ use ty::subst::{Subst, Substs};
 use ty::util::{IntTypeExt, Discr};
 use ty::walk::TypeWalker;
 use util::captures::Captures;
-use util::nodemap::{NodeSet, DefIdMap, FxHashMap};
+use util::nodemap::{NodeSet, DefIdMap, FxHashMap, FxHashSet};
 use arena::SyncDroplessArena;
 use session::DataTypeKind;
 
@@ -139,6 +139,7 @@ pub struct Resolutions {
     pub maybe_unused_trait_imports: NodeSet,
     pub maybe_unused_extern_crates: Vec<(NodeId, Span)>,
     pub export_map: ExportMap,
+    pub extern_prelude: FxHashSet<Name>,
 }
 
 #[derive(Clone, Copy, PartialEq, Eq, Debug)]
index 0e4d2f1f64730c940c91846871eef34fc9b642bb..296602e21bad74f13c0871478811dc8eb62adfdb 100644 (file)
@@ -606,6 +606,7 @@ impl<'a, 'tcx, 'x> SpecializedDecoder<interpret::AllocId> for CacheDecoder<'a, '
         alloc_decoding_session.decode_alloc_id(self)
     }
 }
+
 impl<'a, 'tcx, 'x> SpecializedDecoder<Span> for CacheDecoder<'a, 'tcx, 'x> {
     fn specialized_decode(&mut self) -> Result<Span, Self::Error> {
         let tag: u8 = Decodable::decode(self)?;
index 2a3404ee830343d10de823c8663c175394c9d7a6..44fbcade6bc066eabf9754034f0dc7a1434ffc69 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(rustc_private)]
 
 #[macro_use] extern crate log;
index d6e821d427d0580f45266e98cce22d40be793747..c3c32ba7d5b6c05623ac577be65321111f81b171 100644 (file)
@@ -46,6 +46,7 @@
 #![forbid(unsafe_code)]
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(try_from)]
 // See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
 #[allow(unused_extern_crates)]
index b3ba86ad8a4b32af8f7f6629cca53f8891221b8f..ed8fd305977e5e9b7a71359411211774d4d81420 100644 (file)
@@ -11,6 +11,7 @@
 #![sanitizer_runtime]
 #![feature(alloc_system)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(sanitizer_runtime)]
 #![feature(staged_api)]
 #![no_std]
index 16da8c8a3b8bf6651dc41d8b70ef0f9b7cc8341d..edd837e9401a7da2097c39409ed73431dd6da0f3 100644 (file)
@@ -15,6 +15,7 @@
 #![allow(non_camel_case_types)]
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(quote)]
 
 #![recursion_limit="256"]
index 9cb233122c3d086d105b6d73e51d7b9259ae1aaa..dcdd8c1f6e9f99a5c2848af27fba61feaaaa8789 100644 (file)
@@ -27,6 +27,7 @@
 #![allow(unused_attributes)]
 #![feature(libc)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(quote)]
 #![feature(range_contains)]
 #![feature(rustc_diagnostic_macros)]
index 6eec0b0b68c55a1893c8e989a88bba86b47aae2e..765708aeafd94f7e2f1c257a53fb3f0b17d4a754 100644 (file)
 
 use abi::{FnType, FnTypeExt};
 use common::*;
-use llvm;
 use rustc::hir;
 use rustc::ty::{self, Ty, TypeFoldable};
 use rustc::ty::layout::{self, Align, LayoutOf, Size, TyLayout};
-use rustc_target::spec::PanicStrategy;
 use rustc_target::abi::FloatTy;
 use rustc_mir::monomorphize::item::DefPathBasedNames;
 use type_::Type;
@@ -433,12 +431,19 @@ impl<'tcx> LayoutLlvmExt<'tcx> for TyLayout<'tcx> {
                         PointerKind::Shared
                     },
                     hir::MutMutable => {
-                        // Only emit noalias annotations for LLVM >= 6 or in panic=abort
-                        // mode, as prior versions had many bugs in conjunction with
-                        // unwinding. See also issue #31681.
+                        // Previously we would only emit noalias annotations for LLVM >= 6 or in
+                        // panic=abort mode. That was deemed right, as prior versions had many bugs
+                        // in conjunction with unwinding, but later versions didn’t seem to have
+                        // said issues. See issue #31681.
+                        //
+                        // Alas, later on we encountered a case where noalias would generate wrong
+                        // code altogether even with recent versions of LLVM in *safe* code with no
+                        // unwinding involved. See #54462.
+                        //
+                        // For now, do not enable mutable_noalias by default at all, while the
+                        // issue is being figured out.
                         let mutable_noalias = cx.tcx.sess.opts.debugging_opts.mutable_noalias
-                            .unwrap_or(unsafe { llvm::LLVMRustVersionMajor() >= 6 }
-                                || cx.tcx.sess.panic_strategy() == PanicStrategy::Abort);
+                            .unwrap_or(false);
                         if mutable_noalias {
                             PointerKind::UniqueBorrowed
                         } else {
index 635819e94e8679bfed6b729350c25cb400ce79c9..45db22ec6dabc59945ee62c28fd1deea617348c9 100644 (file)
@@ -20,6 +20,7 @@
 #![feature(box_syntax)]
 #![feature(custom_attribute)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![allow(unused_attributes)]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
index 55dec45a0982471fbec041d2f11ec61102625b68..ebceb00cca8b0b72c7a65bc4af1f944cdc62e170 100644 (file)
@@ -12,6 +12,7 @@
 #![allow(unused_extern_crates)]
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 
 extern crate bitflags;
 extern crate log;
index 9435cb3184293acb020899727964e16c5d964a13..1fdcab5f7a21505c37d654fdec414ef1342fd1da 100644 (file)
@@ -29,6 +29,7 @@
 #![feature(optin_builtin_traits)]
 #![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(allow_internal_unstable)]
 #![feature(vec_resize_with)]
 
index 7fb66ea97f26ba05a92e3f60a0140f0cbdc07777..3b0acfd6f8c12c60e622f77050fe7cc32525210e 100644 (file)
@@ -790,6 +790,7 @@ where
                 trait_map: resolver.trait_map,
                 maybe_unused_trait_imports: resolver.maybe_unused_trait_imports,
                 maybe_unused_extern_crates: resolver.maybe_unused_extern_crates,
+                extern_prelude: resolver.extern_prelude,
             },
 
             analysis: ty::CrateAnalysis {
index a96c277d4b555d723e9967cdf55c7b717daf8a22..13e1df6e538887c4735a413a4da600351b55d40c 100644 (file)
@@ -21,6 +21,7 @@
 #![feature(box_syntax)]
 #![cfg_attr(unix, feature(libc))]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(option_replace)]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
index 3582c2359c8b9f653f5ed5d27148f2845e18e801..d31db4b2d00acc8b9e706fbf46cef352ba871ee4 100644 (file)
@@ -17,6 +17,7 @@
 #![feature(range_contains)]
 #![cfg_attr(unix, feature(libc))]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(optin_builtin_traits)]
 
 extern crate atty;
index acdcf2b459e92efc99006e02a97e445be61aaf45..4ffd726c1d47ce2b5aba82c21f2e403fdcc28992 100644 (file)
@@ -15,6 +15,7 @@
       html_root_url = "https://doc.rust-lang.org/nightly/")]
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(specialization)]
 
 #![recursion_limit="256"]
index 9ed69a2dc9b8ec95528f6cc2a09712985204624c..7e5f449d07c5066ec6677f0edb25ff9290f1338a 100644 (file)
@@ -28,6 +28,7 @@
 #![feature(box_syntax)]
 #![cfg_attr(stage0, feature(macro_vis_matcher))]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(macro_at_most_once_rep)]
@@ -312,7 +313,7 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
         },
         FutureIncompatibleInfo {
             id: LintId::of(ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE),
-            reference: "issue TBD",
+            reference: "issue #53130 <https://github.com/rust-lang/rust/issues/53130>",
             edition: Some(Edition::Edition2018),
         },
         FutureIncompatibleInfo {
index 387660473a887dea0a2524a4bdceefbd0b78b515..13605e993a59cc5140811691c94590fc9964a15f 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(static_nobundle)]
 
 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
index b3ba86ad8a4b32af8f7f6629cca53f8891221b8f..ed8fd305977e5e9b7a71359411211774d4d81420 100644 (file)
@@ -11,6 +11,7 @@
 #![sanitizer_runtime]
 #![feature(alloc_system)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(sanitizer_runtime)]
 #![feature(staged_api)]
 #![no_std]
index 6eef2397f9c6ed9b0cb28e0bd0ca9048aed2c27d..fa2debf2c0dc75e1cad65d7bf402f87c5d615af8 100644 (file)
@@ -256,6 +256,7 @@ impl<'a> CrateLoader<'a> {
 
         let cmeta = cstore::CrateMetadata {
             name: crate_root.name,
+            imported_name: ident,
             extern_crate: Lock::new(None),
             def_path_table: Lrc::new(def_path_table),
             trait_impls,
index aad632f89180dd09e52b5fe963f5b82fcba71b03..ec48a4a4c6997187fd3e2a8cf1cbdbfa39e087a1 100644 (file)
@@ -53,8 +53,13 @@ pub struct ImportedSourceFile {
 }
 
 pub struct CrateMetadata {
+    /// Original name of the crate.
     pub name: Symbol,
 
+    /// Name of the crate as imported.  I.e. if imported with
+    /// `extern crate foo as bar;` this will be `bar`.
+    pub imported_name: Symbol,
+
     /// Information about the extern crate that caused this crate to
     /// be loaded. If this is `None`, then the crate was injected
     /// (e.g., by the allocator)
index 4382a3c12c961e15ffc3e91b2d900529535adc7a..4bea8558ffe273cc04c442b1a54fca0faf116947 100644 (file)
@@ -441,8 +441,7 @@ impl cstore::CStore {
         let data = self.get_crate_data(id.krate);
         if let Some(ref proc_macros) = data.proc_macros {
             return LoadedMacro::ProcMacro(proc_macros[id.index.to_proc_macro_index()].1.clone());
-        } else if data.name == "proc_macro" &&
-                  self.get_crate_data(id.krate).item_name(id.index) == "quote" {
+        } else if data.name == "proc_macro" && data.item_name(id.index) == "quote" {
             use syntax::ext::base::SyntaxExtension;
             use syntax_ext::proc_macro_impl::BangProcMacro;
 
@@ -454,8 +453,9 @@ impl cstore::CStore {
             return LoadedMacro::ProcMacro(Lrc::new(ext));
         }
 
-        let (name, def) = data.get_macro(id.index);
-        let source_name = FileName::Macros(name.to_string());
+        let def = data.get_macro(id.index);
+        let macro_full_name = data.def_path(id.index).to_string_friendly(|_| data.imported_name);
+        let source_name = FileName::Macros(macro_full_name);
 
         let source_file = sess.parse_sess.source_map().new_source_file(source_name, def.body);
         let local_span = Span::new(source_file.start_pos, source_file.end_pos, NO_EXPANSION);
index 43b03cb863c746acc95011aa2d16a67e014943fc..044d23270aa061a14e4b0b9ecee69fdf6934bdf9 100644 (file)
@@ -1101,10 +1101,10 @@ impl<'a, 'tcx> CrateMetadata {
         }
     }
 
-    pub fn get_macro(&self, id: DefIndex) -> (InternedString, MacroDef) {
+    pub fn get_macro(&self, id: DefIndex) -> MacroDef {
         let entry = self.entry(id);
         match entry.kind {
-            EntryKind::MacroDef(macro_def) => (self.item_name(id), macro_def.decode(self)),
+            EntryKind::MacroDef(macro_def) => macro_def.decode(self),
             _ => bug!(),
         }
     }
index 09a8bea0941b618a20933ac77ec9a5a079fb1711..107245488acf322c30c58eb911cf2bafaa46315b 100644 (file)
@@ -16,6 +16,7 @@
 #![feature(libc)]
 #![feature(macro_at_most_once_rep)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(proc_macro_internals)]
 #![feature(proc_macro_quote)]
 #![feature(quote)]
index 82cc1b7f66166a848597ea814a7f99be8bce9dbd..dd6f5fc0446181a5f6f8b9253082eb65edc3137d 100644 (file)
@@ -17,7 +17,7 @@ use rustc::hir::{self, def_id::DefId};
 use rustc::mir::interpret::ConstEvalErr;
 use rustc::mir;
 use rustc::ty::{self, TyCtxt, Instance, query::TyCtxtAt};
-use rustc::ty::layout::{LayoutOf, TyLayout};
+use rustc::ty::layout::{self, LayoutOf, TyLayout};
 use rustc::ty::subst::Subst;
 use rustc_data_structures::indexed_vec::IndexVec;
 
@@ -90,8 +90,18 @@ pub fn eval_promoted<'a, 'mir, 'tcx>(
 pub fn op_to_const<'tcx>(
     ecx: &EvalContext<'_, '_, 'tcx, CompileTimeEvaluator>,
     op: OpTy<'tcx>,
-    normalize: bool,
+    may_normalize: bool,
 ) -> EvalResult<'tcx, &'tcx ty::Const<'tcx>> {
+    // We do not normalize just any data.  Only scalar layout and fat pointers.
+    let normalize = may_normalize
+        && match op.layout.abi {
+            layout::Abi::Scalar(..) => true,
+            layout::Abi::ScalarPair(..) => {
+                // Must be a fat pointer
+                op.layout.ty.builtin_deref(true).is_some()
+            },
+            _ => false,
+        };
     let normalized_op = if normalize {
         ecx.try_read_value(op)?
     } else {
index 1594755b4ab87191b6bc13362f2f335ccca75ad6..073e806fe028cf7b2f90dff8c8e390f698115dda 100644 (file)
@@ -15,6 +15,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
 */
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(in_band_lifetimes)]
 #![feature(impl_header_lifetime_elision)]
 #![feature(slice_patterns)]
index b3ba86ad8a4b32af8f7f6629cca53f8891221b8f..ed8fd305977e5e9b7a71359411211774d4d81420 100644 (file)
@@ -11,6 +11,7 @@
 #![sanitizer_runtime]
 #![feature(alloc_system)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(sanitizer_runtime)]
 #![feature(staged_api)]
 #![no_std]
index d62cb00923f7047411ff3a17d5da3886d33d6ea9..94ea229cbd91ba03f01697adc3057d2f81322390 100644 (file)
@@ -19,6 +19,7 @@
        html_root_url = "https://doc.rust-lang.org/nightly/")]
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(rustc_diagnostic_macros)]
 
 #[macro_use]
index fa7008be73a0797d7a4570886396af6b3a0db7d9..f093d672498ad4b2483ad71133cb43b4a38cd852 100644 (file)
@@ -11,6 +11,7 @@
 #![allow(nonstandard_style)]
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 
 pub struct Intrinsic {
     pub inputs: &'static [&'static Type],
index 67f53a67313f798f1f9d2979d9f57e0a949095af..5b56266638552490473463f22f13505052b0fdab 100644 (file)
@@ -65,6 +65,7 @@
        html_root_url = "https://doc.rust-lang.org/nightly/")]
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(rustc_diagnostic_macros)]
 
 #[macro_use] extern crate syntax;
index 47e8588857d6a3303b77ef3dfb16c7906d2b0de4..fe66110120d40e2a1c212ce8371dbf402349fd17 100644 (file)
@@ -13,6 +13,7 @@
        html_root_url = "https://doc.rust-lang.org/nightly/")]
 
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(rustc_diagnostic_macros)]
 
 #![recursion_limit="256"]
@@ -1380,13 +1381,7 @@ impl<'a, 'tcx: 'a> SearchInterfaceForPrivateItemsVisitor<'a, 'tcx> {
     }
 
     fn predicates(&mut self) -> &mut Self {
-        // NB: We use `explicit_predicates_of` and not `predicates_of`
-        // because we don't want to report privacy errors due to where
-        // clauses that the compiler inferred. We only want to
-        // consider the ones that the user wrote. This is important
-        // for the inferred outlives rules; see
-        // `src/test/ui/rfc-2093-infer-outlives/privacy.rs`.
-        let predicates = self.tcx.explicit_predicates_of(self.item_def_id);
+        let predicates = self.tcx.predicates_of(self.item_def_id);
         for predicate in &predicates.predicates {
             predicate.visit_with(self);
             match predicate {
index 168603d4179a7310713e5e42a522b5dad29f48f7..5101b7fcaa5fb918fa5d84b38d8cf8863a4420c4 100644 (file)
@@ -14,6 +14,7 @@
 
 #![feature(crate_visibility_modifier)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(rustc_diagnostic_macros)]
 #![feature(slice_sort_by_cached_key)]
 
@@ -71,11 +72,10 @@ use syntax_pos::{Span, DUMMY_SP, MultiSpan};
 use errors::{Applicability, DiagnosticBuilder, DiagnosticId};
 
 use std::cell::{Cell, RefCell};
-use std::cmp;
+use std::{cmp, fmt, iter, ptr};
 use std::collections::BTreeSet;
-use std::fmt;
-use std::iter;
 use std::mem::replace;
+use rustc_data_structures::ptr_key::PtrKey;
 use rustc_data_structures::sync::Lrc;
 
 use resolve_imports::{ImportDirective, ImportDirectiveSubclass, NameResolution, ImportResolver};
@@ -1113,6 +1113,17 @@ impl<'a> ModuleData<'a> {
     fn nearest_item_scope(&'a self) -> Module<'a> {
         if self.is_trait() { self.parent.unwrap() } else { self }
     }
+
+    fn is_ancestor_of(&self, mut other: &Self) -> bool {
+        while !ptr::eq(self, other) {
+            if let Some(parent) = other.parent {
+                other = parent;
+            } else {
+                return false;
+            }
+        }
+        true
+    }
 }
 
 impl<'a> fmt::Debug for ModuleData<'a> {
@@ -1350,7 +1361,7 @@ pub struct Resolver<'a, 'b: 'a> {
     graph_root: Module<'a>,
 
     prelude: Option<Module<'a>>,
-    extern_prelude: FxHashSet<Name>,
+    pub extern_prelude: FxHashSet<Name>,
 
     /// n.b. This is used only for better diagnostics, not name resolution itself.
     has_self: FxHashSet<DefId>,
@@ -1408,6 +1419,7 @@ pub struct Resolver<'a, 'b: 'a> {
     block_map: NodeMap<Module<'a>>,
     module_map: FxHashMap<DefId, Module<'a>>,
     extern_module_map: FxHashMap<(DefId, bool /* MacrosOnly? */), Module<'a>>,
+    binding_parent_modules: FxHashMap<PtrKey<'a, NameBinding<'a>>, Module<'a>>,
 
     pub make_glob_map: bool,
     /// Maps imports to the names of items actually imported (this actually maps
@@ -1666,13 +1678,15 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
         let mut extern_prelude: FxHashSet<Name> =
             session.opts.externs.iter().map(|kv| Symbol::intern(kv.0)).collect();
 
-        // HACK(eddyb) this ignore the `no_{core,std}` attributes.
-        // FIXME(eddyb) warn (elsewhere) if core/std is used with `no_{core,std}`.
-        // if !attr::contains_name(&krate.attrs, "no_core") {
-        // if !attr::contains_name(&krate.attrs, "no_std") {
-        extern_prelude.insert(Symbol::intern("core"));
-        extern_prelude.insert(Symbol::intern("std"));
-        extern_prelude.insert(Symbol::intern("meta"));
+        if !attr::contains_name(&krate.attrs, "no_core") {
+            extern_prelude.insert(Symbol::intern("core"));
+            if !attr::contains_name(&krate.attrs, "no_std") {
+                extern_prelude.insert(Symbol::intern("std"));
+                if session.rust_2018() {
+                    extern_prelude.insert(Symbol::intern("meta"));
+                }
+            }
+        }
 
         let mut invocations = FxHashMap();
         invocations.insert(Mark::root(),
@@ -1722,6 +1736,7 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
             module_map,
             block_map: NodeMap(),
             extern_module_map: FxHashMap(),
+            binding_parent_modules: FxHashMap(),
 
             make_glob_map: make_glob_map == MakeGlobMap::Yes,
             glob_map: NodeMap(),
@@ -1962,9 +1977,15 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
         }
 
         if !module.no_implicit_prelude {
-            // `record_used` means that we don't try to load crates during speculative resolution
-            if record_used && ns == TypeNS && self.extern_prelude.contains(&ident.name) {
-                let crate_id = self.crate_loader.process_path_extern(ident.name, ident.span);
+            if ns == TypeNS && self.extern_prelude.contains(&ident.name) {
+                let crate_id = if record_used {
+                    self.crate_loader.process_path_extern(ident.name, ident.span)
+                } else if let Some(crate_id) =
+                        self.crate_loader.maybe_process_path_extern(ident.name, ident.span) {
+                    crate_id
+                } else {
+                    return None;
+                };
                 let crate_root = self.get_module(DefId { krate: crate_id, index: CRATE_DEF_INDEX });
                 self.populate_module_if_necessary(&crate_root);
 
@@ -4540,6 +4561,31 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
         vis.is_accessible_from(module.normal_ancestor_id, self)
     }
 
+    fn set_binding_parent_module(&mut self, binding: &'a NameBinding<'a>, module: Module<'a>) {
+        if let Some(old_module) = self.binding_parent_modules.insert(PtrKey(binding), module) {
+            if !ptr::eq(module, old_module) {
+                span_bug!(binding.span, "parent module is reset for binding");
+            }
+        }
+    }
+
+    fn disambiguate_legacy_vs_modern(
+        &self,
+        legacy: &'a NameBinding<'a>,
+        modern: &'a NameBinding<'a>,
+    ) -> bool {
+        // Some non-controversial subset of ambiguities "modern macro name" vs "macro_rules"
+        // is disambiguated to mitigate regressions from macro modularization.
+        // Scoping for `macro_rules` behaves like scoping for `let` at module level, in general.
+        match (self.binding_parent_modules.get(&PtrKey(legacy)),
+               self.binding_parent_modules.get(&PtrKey(modern))) {
+            (Some(legacy), Some(modern)) =>
+                legacy.normal_ancestor_id == modern.normal_ancestor_id &&
+                modern.is_ancestor_of(legacy),
+            _ => false,
+        }
+    }
+
     fn report_ambiguity_error(&self, ident: Ident, b1: &NameBinding, b2: &NameBinding) {
         let participle = |is_import: bool| if is_import { "imported" } else { "defined" };
         let msg1 =
index 35d96b9302b43229575ebec76abb445b2c64e48c..349ddcd9a425233ca830136a9c81519cc2ab671b 100644 (file)
@@ -575,6 +575,13 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
         // 5. Standard library prelude (de-facto closed, controlled).
         // 6. Language prelude (closed, controlled).
         // (Macro NS)
+        // 0. Derive helpers (open, not controlled). All ambiguities with other names
+        //    are currently reported as errors. They should be higher in priority than preludes
+        //    and probably even names in modules according to the "general principles" above. They
+        //    also should be subject to restricted shadowing because are effectively produced by
+        //    derives (you need to resolve the derive first to add helpers into scope), but they
+        //    should be available before the derive is expanded for compatibility.
+        //    It's mess in general, so we are being conservative for now.
         // 1. Names in modules (both normal `mod`ules and blocks), loop through hygienic parents
         //    (open, not controlled).
         // 2. `macro_use` prelude (open, the open part is from macro expansions, not controlled).
@@ -583,13 +590,6 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
         // 2b. Standard library prelude is currently implemented as `macro-use` (closed, controlled)
         // 3. Language prelude: builtin macros (closed, controlled, except for legacy plugins).
         // 4. Language prelude: builtin attributes (closed, controlled).
-        // N (unordered). Derive helpers (open, not controlled). All ambiguities with other names
-        //    are currently reported as errors. They should be higher in priority than preludes
-        //    and maybe even names in modules according to the "general principles" above. They
-        //    also should be subject to restricted shadowing because are effectively produced by
-        //    derives (you need to resolve the derive first to add helpers into scope), but they
-        //    should be available before the derive is expanded for compatibility.
-        //    It's mess in general, so we are being conservative for now.
 
         assert!(ns == TypeNS  || ns == MacroNS);
         assert!(force || !record_used); // `record_used` implies `force`
@@ -621,7 +621,7 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
         }
 
         // Go through all the scopes and try to resolve the name.
-        let mut where_to_resolve = WhereToResolve::Module(parent_scope.module);
+        let mut where_to_resolve = WhereToResolve::DeriveHelpers;
         let mut use_prelude = !parent_scope.module.no_implicit_prelude;
         loop {
             let result = match where_to_resolve {
@@ -751,8 +751,8 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
                     }
                     WhereToResolve::MacroUsePrelude => WhereToResolve::BuiltinMacros,
                     WhereToResolve::BuiltinMacros => WhereToResolve::BuiltinAttrs,
-                    WhereToResolve::BuiltinAttrs => WhereToResolve::DeriveHelpers,
-                    WhereToResolve::DeriveHelpers => break, // nowhere else to search
+                    WhereToResolve::BuiltinAttrs => break, // nowhere else to search
+                    WhereToResolve::DeriveHelpers => WhereToResolve::Module(parent_scope.module),
                     WhereToResolve::ExternPrelude => WhereToResolve::ToolPrelude,
                     WhereToResolve::ToolPrelude => WhereToResolve::StdLibPrelude,
                     WhereToResolve::StdLibPrelude => WhereToResolve::BuiltinTypes,
@@ -956,11 +956,13 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
                 },
                 (Some(legacy_binding), Ok((binding, FromPrelude(from_prelude))))
                         if legacy_binding.def() != binding.def_ignoring_ambiguity() &&
-                           (!from_prelude ||
+                           (!from_prelude &&
+                            !self.disambiguate_legacy_vs_modern(legacy_binding, binding) ||
                             legacy_binding.may_appear_after(parent_scope.expansion, binding)) => {
                     self.report_ambiguity_error(ident, legacy_binding, binding);
                 },
                 // OK, non-macro-expanded legacy wins over prelude even if defs are different
+                // Also, non-macro-expanded legacy wins over modern from the same module
                 // Also, legacy and modern can co-exist if their defs are same
                 (Some(legacy_binding), Ok(_)) |
                 // OK, unambiguous resolution
@@ -1096,6 +1098,7 @@ impl<'a, 'cl> Resolver<'a, 'cl> {
             let def = Def::Macro(def_id, MacroKind::Bang);
             let vis = ty::Visibility::Invisible; // Doesn't matter for legacy bindings
             let binding = (def, vis, item.span, expansion).to_name_binding(self.arenas);
+            self.set_binding_parent_module(binding, self.current_module);
             let legacy_binding = self.arenas.alloc_legacy_binding(LegacyBinding {
                 parent_legacy_scope: *current_legacy_scope, binding, ident
             });
index dc4a76db6926654ad3af964ed30f5eec4befeba5..2628772745b15213aea2607218478eb14dab78e7 100644 (file)
@@ -478,6 +478,7 @@ impl<'a, 'crateloader> Resolver<'a, 'crateloader> {
                       binding: &'a NameBinding<'a>)
                       -> Result<(), &'a NameBinding<'a>> {
         self.check_reserved_macro_name(ident, ns);
+        self.set_binding_parent_module(binding, module);
         self.update_resolution(module, ident, ns, |this, resolution| {
             if let Some(old_binding) = resolution.binding {
                 if binding.is_glob_import() {
index c9bae297031fffe6a976551e62acb5b17d74e46a..30cf24d2ba9ece0ff8419b710ea839a7ab5914bd 100644 (file)
@@ -13,6 +13,7 @@
        html_root_url = "https://doc.rust-lang.org/nightly/")]
 #![feature(custom_attribute)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![allow(unused_attributes)]
 
 #![recursion_limit="256"]
index c198b19ce616075e3cc55b88973ee1263478363f..e4d958e3b6f3520e84ae3a76b6f6fa098a65fc25 100644 (file)
@@ -25,6 +25,7 @@
 #![cfg_attr(stage0, feature(const_fn))]
 #![cfg_attr(not(stage0), feature(min_const_fn))]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(slice_patterns)]
 
 #[macro_use]
index a6618efebb31017bf933de30bace186678c546e4..00d0d147fe9c3108ec3dbc6b8e8ed5f0cd571326 100644 (file)
@@ -16,6 +16,7 @@
 #![cfg_attr(stage0, feature(extern_prelude))]
 #![feature(in_band_lifetimes)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 
 #![recursion_limit="256"]
 
index b3ba86ad8a4b32af8f7f6629cca53f8891221b8f..ed8fd305977e5e9b7a71359411211774d4d81420 100644 (file)
@@ -11,6 +11,7 @@
 #![sanitizer_runtime]
 #![feature(alloc_system)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(sanitizer_runtime)]
 #![feature(staged_api)]
 #![no_std]
index 5967bd1ba3eea9dcd93cf23e930083c642aa6198..9d62afa232b1466afea7b38d9a301fc2e3be46e1 100644 (file)
@@ -130,15 +130,13 @@ fn unused_crates_lint<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>) {
     });
 
     for extern_crate in &crates_to_lint {
-        assert!(extern_crate.def_id.is_local());
+        let id = tcx.hir.as_local_node_id(extern_crate.def_id).unwrap();
+        let item = tcx.hir.expect_item(id);
 
         // If the crate is fully unused, we suggest removing it altogether.
         // We do this in any edition.
         if extern_crate.warn_if_unused {
             if let Some(&span) = unused_extern_crates.get(&extern_crate.def_id) {
-                assert_eq!(extern_crate.def_id.krate, LOCAL_CRATE);
-                let hir_id = tcx.hir.definitions().def_index_to_hir_id(extern_crate.def_id.index);
-                let id = tcx.hir.hir_to_node_id(hir_id);
                 let msg = "unused extern crate";
                 tcx.struct_span_lint_node(lint, id, span, msg)
                     .span_suggestion_short_with_applicability(
@@ -157,6 +155,13 @@ fn unused_crates_lint<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>) {
             continue;
         }
 
+        // If the extern crate isn't in the extern prelude,
+        // there is no way it can be written as an `use`.
+        let orig_name = extern_crate.orig_name.unwrap_or(item.name);
+        if !tcx.extern_prelude.contains(&orig_name) {
+            continue;
+        }
+
         // If the extern crate has any attributes, they may have funky
         // semantics we can't faithfully represent using `use` (most
         // notably `#[macro_use]`). Ignore it.
@@ -165,9 +170,6 @@ fn unused_crates_lint<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>) {
         }
 
         // Otherwise, we can convert it into a `use` of some kind.
-        let hir_id = tcx.hir.definitions().def_index_to_hir_id(extern_crate.def_id.index);
-        let id = tcx.hir.hir_to_node_id(hir_id);
-        let item = tcx.hir.expect_item(id);
         let msg = "`extern crate` is not idiomatic in the new edition";
         let help = format!(
             "convert it to a `{}`",
index 5309be21768f1553fd575177a12c2e3ae8b55b89..cc83c24e51c04e0bb88806624e2529ac38f18ae9 100644 (file)
@@ -1578,10 +1578,14 @@ fn predicates_defined_on<'a, 'tcx>(
     def_id: DefId,
 ) -> ty::GenericPredicates<'tcx> {
     let explicit = tcx.explicit_predicates_of(def_id);
-    let predicates = [
-      &explicit.predicates[..],
-      &tcx.inferred_outlives_of(def_id)[..],
-    ].concat();
+    let predicates = if tcx.sess.features_untracked().infer_outlives_requirements {
+        [
+            &explicit.predicates[..],
+            &tcx.inferred_outlives_of(def_id)[..],
+        ].concat()
+    } else {
+        explicit.predicates
+    };
 
     ty::GenericPredicates {
         parent: explicit.parent,
index c9aa0339dd469f8fc00c2b7358218fbe41940861..13ea2fdd89d050defac764beb3102585478573c0 100644 (file)
@@ -76,6 +76,7 @@ This API is completely unstable and subject to change.
 #![feature(crate_visibility_modifier)]
 #![feature(exhaustive_patterns)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(quote)]
 #![feature(refcell_replace_swap)]
 #![feature(rustc_diagnostic_macros)]
index 254146c0ef3aa3dbe61976a7c7dc2705b99e8c24..092e4d62e2e9fa5724d4618bea8f6bf957897cb8 100644 (file)
@@ -66,8 +66,7 @@ impl<'cx, 'tcx> ItemLikeVisitor<'tcx> for InferVisitor<'cx, 'tcx> {
 
         debug!("InferVisitor::visit_item(item={:?})", item_did);
 
-        let node_id = self
-            .tcx
+        let node_id = self.tcx
             .hir
             .as_local_node_id(item_did)
             .expect("expected local def-id");
@@ -109,8 +108,7 @@ impl<'cx, 'tcx> ItemLikeVisitor<'tcx> for InferVisitor<'cx, 'tcx> {
         // Therefore mark `predicates_added` as true and which will ensure
         // we walk the crates again and re-calculate predicates for all
         // items.
-        let item_predicates_len: usize = self
-            .global_inferred_outlives
+        let item_predicates_len: usize = self.global_inferred_outlives
             .get(&item_did)
             .map(|p| p.len())
             .unwrap_or(0);
index ee0c6ee005d7c0b896bce309e49402b62266e827..7b46b632b1a075954a8f3afb3dde924c5e79d85f 100644 (file)
@@ -457,6 +457,7 @@ pub fn run_core(search_paths: SearchPaths,
             trait_map: resolver.trait_map.clone(),
             maybe_unused_trait_imports: resolver.maybe_unused_trait_imports.clone(),
             maybe_unused_extern_crates: resolver.maybe_unused_extern_crates.clone(),
+            extern_prelude: resolver.extern_prelude.clone(),
         };
         let analysis = ty::CrateAnalysis {
             access_levels: Lrc::new(AccessLevels::default()),
index 73057b19016c6a6081095cec2216e44bb1e44879..3a70c55e1737f977c3c27ccf53d189bf901136da 100644 (file)
@@ -17,6 +17,7 @@
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(set_stdio)]
 #![feature(slice_sort_by_cached_key)]
 #![feature(test)]
@@ -285,7 +286,7 @@ fn opts() -> Vec<RustcOptGroup> {
                       \"light-suffix.css\"",
                      "PATH")
         }),
-        stable("edition", |o| {
+        unstable("edition", |o| {
             o.optopt("", "edition",
                      "edition to use when compiling rust code (default: 2015)",
                      "EDITION")
index 3b07a2ccdde09379e8e10fd706d8db6b733f80ca..0d9fae37c0e7255fb08d6d09c272a9a6694d6fd3 100644 (file)
@@ -220,7 +220,6 @@ fn run_test(test: &str, cratename: &str, filename: &FileName, line: usize,
         output_types: outputs,
         externs,
         cg: config::CodegenOptions {
-            prefer_dynamic: true,
             linker,
             ..cg
         },
index 1f6ee3d867b17b3c7225b31a84266de1f039df8a..e87c2793ee86701ab2d5b88d2a3bf9e2f6ad07e6 100644 (file)
@@ -25,6 +25,7 @@ Core encoding and decoding interfaces.
 #![feature(specialization)]
 #![feature(never_type)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![cfg_attr(test, feature(test))]
 
 pub use self::serialize::{Decoder, Encoder, Decodable, Encodable};
index 17f6923eae72368b6190bc70fde284aca26b2ae4..5c9e88dc57ca6ea869c72dbca80edf95b7785fce 100644 (file)
 #![feature(needs_panic_runtime)]
 #![feature(never_type)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(exhaustive_patterns)]
 #![feature(on_unimplemented)]
 #![feature(optin_builtin_traits)]
index 63b70b1224840a6afb70c42754e0bec111d7feda..bc4b7385d8affdd7965b4cd7c31f8903c581c638 100644 (file)
@@ -89,6 +89,7 @@ impl<'a> StripUnconfigured<'a> {
             parser.expect(&token::Comma)?;
             let lo = parser.span.lo();
             let (path, tokens) = parser.parse_meta_item_unrestricted()?;
+            parser.eat(&token::Comma); // Optional trailing comma
             parser.expect(&token::CloseDelim(token::Paren))?;
             Ok((cfg, path, tokens, parser.prev_span.with_lo(lo)))
         }) {
index fa4346ee70d960518af24ca1451c4a0f85bdf618..26067304f92b707f507353cc402f07628934578e 100644 (file)
@@ -37,7 +37,7 @@ use visit::{self, FnKind, Visitor};
 use parse::ParseSess;
 use symbol::{keywords, Symbol};
 
-use std::{env};
+use std::{env, path};
 
 macro_rules! set {
     // The const_fn feature also enables the min_const_fn feature, because `min_const_fn` allows
@@ -403,9 +403,15 @@ declare_features! (
     // `extern` in paths
     (active, extern_in_paths, "1.23.0", Some(44660), None),
 
+    // `foo.rs` as an alternative to `foo/mod.rs`
+    (active, non_modrs_mods, "1.24.0", Some(44660), Some(Edition::Edition2018)),
+
     // Use `?` as the Kleene "at most one" operator
     (active, macro_at_most_once_rep, "1.25.0", Some(48075), None),
 
+    // Infer outlives requirements; RFC 2093
+    (active, infer_outlives_requirements, "1.26.0", Some(44493), None),
+
     // Infer static outlives requirements; RFC 2093
     (active, infer_static_outlives_requirements, "1.26.0", Some(44493), None),
 
@@ -648,8 +654,6 @@ declare_features! (
     (accepted, repr_transparent, "1.28.0", Some(43036), None),
     // Defining procedural macros in `proc-macro` crates
     (accepted, proc_macro, "1.29.0", Some(38356), None),
-    // `foo.rs` as an alternative to `foo/mod.rs`
-    (accepted, non_modrs_mods, "1.30.0", Some(44660), None),
     // Allows use of the :vis macro fragment specifier
     (accepted, macro_vis_matcher, "1.30.0", Some(41022), None),
     // Allows importing and reexporting macros with `use`,
@@ -663,8 +667,6 @@ declare_features! (
     (accepted, proc_macro_path_invoc, "1.30.0", Some(38356), None),
     // Allows all literals in attribute lists and values of key-value pairs.
     (accepted, attr_literals, "1.30.0", Some(34981), None),
-    // Infer outlives requirements; RFC 2093
-    (accepted, infer_outlives_requirements, "1.30.0", Some(44493), None),
     (accepted, panic_handler, "1.30.0", Some(44489), None),
     // Used to preserve symbols (see llvm.used)
     (accepted, used, "1.30.0", Some(40289), None),
@@ -1126,6 +1128,12 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
                                  "never will be stable",
                                  cfg_fn!(rustc_attrs))),
 
+    // RFC #2093
+    ("infer_outlives_requirements", Normal, Gated(Stability::Unstable,
+                                   "infer_outlives_requirements",
+                                   "infer outlives requirements is an experimental feature",
+                                   cfg_fn!(infer_outlives_requirements))),
+
     // RFC #2093
     ("infer_static_outlives_requirements", Normal, Gated(Stability::Unstable,
                                    "infer_static_outlives_requirements",
@@ -1493,6 +1501,31 @@ impl<'a> PostExpansionVisitor<'a> {
     }
 }
 
+impl<'a> PostExpansionVisitor<'a> {
+    fn whole_crate_feature_gates(&mut self, _krate: &ast::Crate) {
+        for &(ident, span) in &*self.context.parse_sess.non_modrs_mods.borrow() {
+            if !span.allows_unstable() {
+                let cx = &self.context;
+                let level = GateStrength::Hard;
+                let has_feature = cx.features.non_modrs_mods;
+                let name = "non_modrs_mods";
+                debug!("gate_feature(feature = {:?}, span = {:?}); has? {}",
+                        name, span, has_feature);
+
+                if !has_feature && !span.allows_unstable() {
+                    leveled_feature_err(
+                        cx.parse_sess, name, span, GateIssue::Language,
+                        "mod statements in non-mod.rs files are unstable", level
+                    )
+                    .help(&format!("on stable builds, rename this file to {}{}mod.rs",
+                                   ident, path::MAIN_SEPARATOR))
+                    .emit();
+                }
+            }
+        }
+    }
+}
+
 impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
     fn visit_attribute(&mut self, attr: &ast::Attribute) {
         if !attr.span.allows_unstable() {
@@ -2059,6 +2092,7 @@ pub fn check_crate(krate: &ast::Crate,
     };
 
     let visitor = &mut PostExpansionVisitor { context: &ctx };
+    visitor.whole_crate_feature_gates(krate);
     visit::walk_crate(visitor, krate);
 }
 
index 2aaab6aaa16d931942844d5f06e73ff3bb076b3d..c8ec273a03f2866e4fd77bb57cb02e8c2fff7a04 100644 (file)
@@ -22,6 +22,7 @@
 #![feature(crate_visibility_modifier)]
 #![feature(macro_at_most_once_rep)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(rustc_attrs)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(slice_sort_by_cached_key)]
index 31089c9ff82cefefc9a3111d6e65b91aafcbb024..88af4a73a1515a93b58592f3c7628f54050decf7 100644 (file)
@@ -17,6 +17,7 @@
 #![feature(proc_macro_internals)]
 #![feature(decl_macro)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(str_escape)]
 #![feature(quote)]
 #![feature(rustc_diagnostic_macros)]
index 7709db72a02fb4c0f11790987f5ac0981b10dec1..fce8fc3db4e4ed0f55f8ed867f8b6c4f4f541a18 100644 (file)
@@ -65,7 +65,7 @@ impl Edition {
     pub fn is_stable(&self) -> bool {
         match *self {
             Edition::Edition2015 => true,
-            Edition::Edition2018 => true,
+            Edition::Edition2018 => false,
         }
     }
 }
index bd70344b018127992879e1f0684868c91cad8035..e7310dbfd34056c0c400cc18554d0d6a2ecf243a 100644 (file)
@@ -22,6 +22,7 @@
 #![feature(crate_visibility_modifier)]
 #![feature(custom_attribute)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(non_exhaustive)]
 #![feature(optin_builtin_traits)]
 #![feature(specialization)]
@@ -87,7 +88,7 @@ scoped_thread_local!(pub static GLOBALS: Globals);
 #[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd, Hash, RustcDecodable, RustcEncodable)]
 pub enum FileName {
     Real(PathBuf),
-    /// e.g. "std" macros
+    /// A macro.  This includes the full name of the macro, so that there are no clashes.
     Macros(String),
     /// call to `quote!`
     QuoteExpansion,
index a49fd67639dbe5210fe1118a2f1e672f8958f7b5..df90be6393743a75dfc058d41c556c3116a1e580 100644 (file)
@@ -51,6 +51,7 @@
 // Handle rustfmt skips
 #![feature(custom_attribute)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![allow(unused_attributes)]
 
 use std::io::prelude::*;
index 6ffa6e9be937d134c91b661134d31a00b8603f18..bf3cb7c537bd0da9879851e85c5c1d5312c49d94 100644 (file)
@@ -36,6 +36,7 @@
 #![feature(fnbox)]
 #![cfg_attr(any(unix, target_os = "cloudabi"), feature(libc))]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(set_stdio)]
 #![feature(panic_unwind)]
 #![feature(staged_api)]
index 424a7e3d009ecaa6c930c200c7819552b7609e89..3b94dc238d91cf9aab3686fc3671bb4caa4b9e11 100644 (file)
@@ -14,6 +14,7 @@
 #![feature(cfg_target_vendor)]
 #![feature(link_cfg)]
 #![cfg_attr(not(stage0), feature(nll))]
+#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
 #![feature(staged_api)]
 #![feature(unwind_attributes)]
 #![feature(static_nobundle)]
index b791a07f48e65b95fbf44473ce4fb42a5958734f..46089135e323f4e8ae7a8a08fcab3ea16268df0e 100644 (file)
@@ -12,8 +12,8 @@
 # source tarball for a stable release you'll likely see `1.x.0` for rustc and
 # `0.x.0` for Cargo where they were released on `date`.
 
-date: 2018-09-13
-rustc: 1.29.0
+date: 2018-10-12
+rustc: 1.29.2
 cargo: 0.30.0
 
 # When making a stable release the process currently looks like:
index 0bd021f8ae2d68a90127754ec2a9e1719a339e27..5061d9a915e2e9296fe462c750dc1f7f0a3a02ec 100644 (file)
@@ -53,13 +53,13 @@ pub fn named_borrow<'r>(_: &'r i32) {
 pub fn unsafe_borrow(_: &UnsafeInner) {
 }
 
-// CHECK: @mutable_unsafe_borrow(i16* noalias dereferenceable(2) %arg0)
+// CHECK: @mutable_unsafe_borrow(i16* dereferenceable(2) %arg0)
 // ... unless this is a mutable borrow, those never alias
 #[no_mangle]
 pub fn mutable_unsafe_borrow(_: &mut UnsafeInner) {
 }
 
-// CHECK: @mutable_borrow(i32* noalias dereferenceable(4) %arg0)
+// CHECK: @mutable_borrow(i32* dereferenceable(4) %arg0)
 // FIXME #25759 This should also have `nocapture`
 #[no_mangle]
 pub fn mutable_borrow(_: &mut i32) {
@@ -102,7 +102,7 @@ pub fn helper(_: usize) {
 pub fn slice(_: &[u8]) {
 }
 
-// CHECK: @mutable_slice([0 x i8]* noalias nonnull %arg0.0, [[USIZE]] %arg0.1)
+// CHECK: @mutable_slice([0 x i8]* nonnull %arg0.0, [[USIZE]] %arg0.1)
 // FIXME #25759 This should also have `nocapture`
 #[no_mangle]
 pub fn mutable_slice(_: &mut [u8]) {
index 83bbb7c13c43f8acb74000f15f55b174084f8f25..d0aed8b1624867c721de0dd544be438ee6ff68f5 100644 (file)
 // aux-build:derive-b.rs
 // ignore-stage1
 
-#![allow(warnings)]
-
 #[macro_use]
 extern crate derive_b;
 
-#[B] //~ ERROR `B` is a derive mode
-#[C]
+#[B]
+#[C] //~ ERROR attribute `C` is currently unknown to the compiler
 #[B(D)]
 #[B(E = "foo")]
 #[B(arbitrary tokens)]
index 8aa75e6315d1ddf245844a938d47d8f745e4e9f1..d7aff5afe409e04b300c4c2691c4234138c85522 100644 (file)
@@ -13,6 +13,8 @@
 // Regression test that `infer_outlives_predicates` can be
 // used with incremental without an ICE.
 
+#![feature(infer_outlives_requirements)]
+
 struct Foo<'a, T> {
   x: &'a T
 }
index f692f57abb9c3cd80f334410a37e52a40dc157a7..2c634f3449083150de059cdce847790d15821e8e 100644 (file)
@@ -183,6 +183,7 @@ fn main() {
         async_closure,
         async_fn,
         async_fn_with_internal_borrow,
+        Foo::async_method,
         |x| {
             async move {
                 unsafe { await!(unsafe_async_fn(x)) }
diff --git a/src/test/run-pass/impl-trait/existential-minimal.stderr b/src/test/run-pass/impl-trait/existential-minimal.stderr
new file mode 100644 (file)
index 0000000..dd1f749
--- /dev/null
@@ -0,0 +1,8 @@
+warning: function is never used: `foo`
+  --> $DIR/existential-minimal.rs:15:1
+   |
+LL | fn foo() -> impl std::fmt::Debug { "cake" }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: #[warn(dead_code)] on by default
+
diff --git a/src/test/run-pass/impl-trait/issue-42479.stderr b/src/test/run-pass/impl-trait/issue-42479.stderr
new file mode 100644 (file)
index 0000000..5a6a303
--- /dev/null
@@ -0,0 +1,14 @@
+warning: struct is never constructed: `Foo`
+  --> $DIR/issue-42479.rs:15:1
+   |
+LL | struct Foo {
+   | ^^^^^^^^^^
+   |
+   = note: #[warn(dead_code)] on by default
+
+warning: method is never used: `inside`
+  --> $DIR/issue-42479.rs:20:5
+   |
+LL |     fn inside(&self) -> impl Iterator<Item = &i32> {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
diff --git a/src/test/run-pass/impl-trait/issue-49376.stderr b/src/test/run-pass/impl-trait/issue-49376.stderr
new file mode 100644 (file)
index 0000000..f5f3600
--- /dev/null
@@ -0,0 +1,32 @@
+warning: function is never used: `gen`
+  --> $DIR/issue-49376.rs:18:1
+   |
+LL | fn gen() -> impl PartialOrd + PartialEq + Debug { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: #[warn(dead_code)] on by default
+
+warning: struct is never constructed: `Bar`
+  --> $DIR/issue-49376.rs:20:1
+   |
+LL | struct Bar {}
+   | ^^^^^^^^^^
+
+warning: function is never used: `foo`
+  --> $DIR/issue-49376.rs:24:1
+   |
+LL | fn foo() -> impl Foo {
+   | ^^^^^^^^^^^^^^^^^^^^
+
+warning: function is never used: `test_impl_ops`
+  --> $DIR/issue-49376.rs:28:1
+   |
+LL | fn test_impl_ops() -> impl Add + Sub + Mul + Div { 1 }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+warning: function is never used: `test_impl_assign_ops`
+  --> $DIR/issue-49376.rs:29:1
+   |
+LL | fn test_impl_assign_ops() -> impl AddAssign + SubAssign + MulAssign + DivAssign { 1 }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
diff --git a/src/test/run-pass/issue-54462-mutable-noalias-correctness.rs b/src/test/run-pass/issue-54462-mutable-noalias-correctness.rs
new file mode 100644 (file)
index 0000000..f0e52b2
--- /dev/null
@@ -0,0 +1,33 @@
+// 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.
+//
+// compile-flags: -Ccodegen-units=1 -O
+
+fn linidx(row: usize, col: usize) -> usize {
+    row * 1 + col * 3
+}
+
+fn main() {
+    let mut mat = [1.0f32, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0];
+
+    for i in 0..2 {
+        for j in i+1..3 {
+            if mat[linidx(j, 3)] > mat[linidx(i, 3)] {
+                    for k in 0..4 {
+                            let (x, rest) = mat.split_at_mut(linidx(i, k) + 1);
+                            let a = x.last_mut().unwrap();
+                            let b = rest.get_mut(linidx(j, k) - linidx(i, k) - 1).unwrap();
+                            ::std::mem::swap(a, b);
+                    }
+            }
+        }
+    }
+    assert_eq!([9.0, 5.0, 1.0, 10.0, 6.0, 2.0, 11.0, 7.0, 3.0, 12.0, 8.0, 4.0], mat);
+}
diff --git a/src/test/run-pass/issue-54467.rs b/src/test/run-pass/issue-54467.rs
new file mode 100644 (file)
index 0000000..033925a
--- /dev/null
@@ -0,0 +1,54 @@
+// 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.
+
+pub trait Stream {
+    type Item;
+    type Error;
+}
+
+pub trait ParseError<I> {
+    type Output;
+}
+
+impl ParseError<char> for u32 {
+    type Output = ();
+}
+
+impl Stream for () {
+    type Item = char;
+    type Error = u32;
+}
+
+pub struct Lex<'a, I>
+    where I: Stream,
+          I::Error: ParseError<char>,
+          <<I as Stream>::Error as ParseError<char>>::Output: 'a
+{
+    x: &'a <I::Error as ParseError<char>>::Output
+}
+
+pub struct Reserved<'a, I> where
+    I: Stream<Item=char> + 'a,
+    I::Error: ParseError<I::Item>,
+//    <<I as Stream>::Error as ParseError<char>>::Output: 'a // comment this to compile
+
+{
+    x: Lex<'a, I>
+}
+
+fn main() {
+    let r: Reserved<()> = Reserved {
+        x: Lex {
+            x: &()
+        }
+    };
+
+    let _v = r.x.x;
+}
diff --git a/src/test/run-pass/issues/issue-49556.stderr b/src/test/run-pass/issues/issue-49556.stderr
new file mode 100644 (file)
index 0000000..8657d4a
--- /dev/null
@@ -0,0 +1,8 @@
+warning: function is never used: `iter`
+  --> $DIR/issue-49556.rs:12:1
+   |
+LL | fn iter<'a>(data: &'a [usize]) -> impl Iterator<Item = usize> + 'a {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: #[warn(dead_code)] on by default
+
diff --git a/src/test/run-pass/traits/conservative_impl_trait.stderr b/src/test/run-pass/traits/conservative_impl_trait.stderr
new file mode 100644 (file)
index 0000000..26c29bf
--- /dev/null
@@ -0,0 +1,8 @@
+warning: function is never used: `batches`
+  --> $DIR/conservative_impl_trait.rs:14:1
+   |
+LL | fn batches(n: &u32) -> impl Iterator<Item=&u32> {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: #[warn(dead_code)] on by default
+
index dbc65569afa876bab3c59bd270d7073c4ccd9483..cf417f8d412eeb93232039968efe2b9a74ef3c44 100644 (file)
@@ -12,7 +12,7 @@ error[E0425]: cannot find value `no` in this scope
 3 | no
   | ^^ not found in this scope
 
-thread '$DIR/failed-doctest-output.rs - OtherStruct (line 26)' panicked at 'couldn't compile the test', librustdoc/test.rs:333:13
+thread '$DIR/failed-doctest-output.rs - OtherStruct (line 26)' panicked at 'couldn't compile the test', librustdoc/test.rs:332:13
 note: Run with `RUST_BACKTRACE=1` for a backtrace.
 
 ---- $DIR/failed-doctest-output.rs - SomeStruct (line 20) stdout ----
@@ -21,7 +21,7 @@ thread '$DIR/failed-doctest-output.rs - SomeStruct (line 20)' panicked at 'test
 thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:3:1
 note: Run with `RUST_BACKTRACE=1` for a backtrace.
 
-', librustdoc/test.rs:368:17
+', librustdoc/test.rs:367:17
 
 
 failures:
index 7be909c3c9e87f6a4322719fa241f0a3fe989fc8..124bc05b7a348cff354af2bdc772ee054efa4b69 100644 (file)
@@ -25,3 +25,13 @@ pub fn derive_foo(input: TokenStream) -> TokenStream {
 pub fn derive_bar(input: TokenStream) -> TokenStream {
     panic!("lolnope");
 }
+
+#[proc_macro_derive(WithHelper, attributes(helper))]
+pub fn with_helper(input: TokenStream) -> TokenStream {
+    TokenStream::new()
+}
+
+#[proc_macro_attribute]
+pub fn helper(_: TokenStream, input: TokenStream) -> TokenStream {
+    input
+}
diff --git a/src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import-ambig.rs b/src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import-ambig.rs
new file mode 100644 (file)
index 0000000..b750a8b
--- /dev/null
@@ -0,0 +1,13 @@
+// aux-build:plugin.rs
+// ignore-stage1
+
+#[macro_use(WithHelper)]
+extern crate plugin;
+
+use plugin::helper;
+
+#[derive(WithHelper)]
+#[helper] //~ ERROR `helper` is ambiguous
+struct S;
+
+fn main() {}
diff --git a/src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import-ambig.stderr b/src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import-ambig.stderr
new file mode 100644 (file)
index 0000000..059629c
--- /dev/null
@@ -0,0 +1,20 @@
+error[E0659]: `helper` is ambiguous
+  --> $DIR/helper-attr-blocked-by-import-ambig.rs:10:3
+   |
+LL | #[helper] //~ ERROR `helper` is ambiguous
+   |   ^^^^^^ ambiguous name
+   |
+note: `helper` could refer to the name defined here
+  --> $DIR/helper-attr-blocked-by-import-ambig.rs:9:10
+   |
+LL | #[derive(WithHelper)]
+   |          ^^^^^^^^^^
+note: `helper` could also refer to the name imported here
+  --> $DIR/helper-attr-blocked-by-import-ambig.rs:7:5
+   |
+LL | use plugin::helper;
+   |     ^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0659`.
diff --git a/src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import.rs b/src/test/ui-fulldeps/custom-derive/helper-attr-blocked-by-import.rs
new file mode 100644 (file)
index 0000000..03b774f
--- /dev/null
@@ -0,0 +1,29 @@
+// compile-pass
+// aux-build:plugin.rs
+// ignore-stage1
+
+#[macro_use(WithHelper)]
+extern crate plugin;
+
+use self::one::*;
+use self::two::*;
+
+mod helper {}
+
+mod one {
+    use helper;
+
+    #[derive(WithHelper)]
+    #[helper]
+    struct One;
+}
+
+mod two {
+    use helper;
+
+    #[derive(WithHelper)]
+    #[helper]
+    struct Two;
+}
+
+fn main() {}
diff --git a/src/test/ui-fulldeps/lint_tool_test.rs b/src/test/ui-fulldeps/lint_tool_test.rs
deleted file mode 100644 (file)
index ebe10b3..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// 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.
-
-// aux-build:lint_tool_test.rs
-// ignore-stage1
-// compile-flags: --cfg foo
-#![feature(plugin)]
-#![feature(tool_lints)]
-#![plugin(lint_tool_test)]
-#![allow(dead_code)]
-#![cfg_attr(foo, warn(test_lint))]
-//~^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future
-//~^^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future
-#![deny(clippy_group)]
-//~^ WARNING lint name `clippy_group` is deprecated and may not have an effect in the future
-
-fn lintme() { } //~ ERROR item is named 'lintme'
-
-#[allow(clippy::group)]
-fn lintmetoo() {}
-
-#[allow(clippy::test_lint)]
-pub fn main() {
-    fn lintme() { }
-    fn lintmetoo() { } //~ ERROR item is named 'lintmetoo'
-}
-
-#[allow(test_group)]
-//~^ WARNING lint name `test_group` is deprecated and may not have an effect in the future
-#[deny(this_lint_does_not_exist)] //~ WARNING unknown lint: `this_lint_does_not_exist`
-fn hello() {
-    fn lintmetoo() { }
-}
diff --git a/src/test/ui-fulldeps/lint_tool_test.stderr b/src/test/ui-fulldeps/lint_tool_test.stderr
deleted file mode 100644 (file)
index ab0c317..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-warning: lint name `test_lint` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
-  --> $DIR/lint_tool_test.rs:18:23
-   |
-LL | #![cfg_attr(foo, warn(test_lint))]
-   |                       ^^^^^^^^^ help: change it to: `clippy::test_lint`
-   |
-   = note: #[warn(renamed_and_removed_lints)] on by default
-
-warning: lint name `clippy_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
-  --> $DIR/lint_tool_test.rs:21:9
-   |
-LL | #![deny(clippy_group)]
-   |         ^^^^^^^^^^^^ help: change it to: `clippy::group`
-
-warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
-  --> $DIR/lint_tool_test.rs:35:9
-   |
-LL | #[allow(test_group)]
-   |         ^^^^^^^^^^ help: change it to: `clippy::test_group`
-
-warning: unknown lint: `this_lint_does_not_exist`
-  --> $DIR/lint_tool_test.rs:37:8
-   |
-LL | #[deny(this_lint_does_not_exist)] //~ WARNING unknown lint: `this_lint_does_not_exist`
-   |        ^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: #[warn(unknown_lints)] on by default
-
-warning: lint name `test_lint` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
-  --> $DIR/lint_tool_test.rs:18:23
-   |
-LL | #![cfg_attr(foo, warn(test_lint))]
-   |                       ^^^^^^^^^ help: change it to: `clippy::test_lint`
-
-error: item is named 'lintme'
-  --> $DIR/lint_tool_test.rs:24:1
-   |
-LL | fn lintme() { } //~ ERROR item is named 'lintme'
-   | ^^^^^^^^^^^^^^^
-   |
-note: lint level defined here
-  --> $DIR/lint_tool_test.rs:21:9
-   |
-LL | #![deny(clippy_group)]
-   |         ^^^^^^^^^^^^
-   = note: #[deny(clippy::test_lint)] implied by #[deny(clippy::group)]
-
-error: item is named 'lintmetoo'
-  --> $DIR/lint_tool_test.rs:32:5
-   |
-LL |     fn lintmetoo() { } //~ ERROR item is named 'lintmetoo'
-   |     ^^^^^^^^^^^^^^^^^^
-   |
-note: lint level defined here
-  --> $DIR/lint_tool_test.rs:21:9
-   |
-LL | #![deny(clippy_group)]
-   |         ^^^^^^^^^^^^
-   = note: #[deny(clippy::test_group)] implied by #[deny(clippy::group)]
-
-error: aborting due to 2 previous errors
-
index cdfecb3d1014667d6c0c60eb8fd774b233105993..e0aeae4ba6c54ffa2202bccc166f042d061c3c91 100644 (file)
@@ -4,17 +4,16 @@ error[E0659]: `my_attr` is ambiguous
 LL | #[my_attr] //~ ERROR `my_attr` is ambiguous
    |   ^^^^^^^ ambiguous name
    |
-note: `my_attr` could refer to the name imported here
-  --> $DIR/derive-helper-shadowing.rs:4:5
-   |
-LL | use derive_helper_shadowing::*;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: `my_attr` could also refer to the name defined here
+note: `my_attr` could refer to the name defined here
   --> $DIR/derive-helper-shadowing.rs:7:10
    |
 LL | #[derive(MyTrait)]
    |          ^^^^^^^
-   = note: consider adding an explicit import of `my_attr` to disambiguate
+note: `my_attr` could also refer to the name imported here
+  --> $DIR/derive-helper-shadowing.rs:4:5
+   |
+LL | use derive_helper_shadowing::*;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to previous error
 
index 76dc139b58f077235ef1e67295d697117ca6dee2..415733a346fc6a60397df89f4b25b9c8bf9c2495 100644 (file)
@@ -11,7 +11,7 @@ LL | #![warn(rust_2018_compatibility)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^
    = note: #[warn(absolute_paths_not_starting_with_crate)] implied by #[warn(rust_2018_compatibility)]
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 warning: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
   --> $DIR/suggestions-not-always-applicable.rs:27:5
@@ -20,5 +20,5 @@ LL |     #[foo] //~ WARN: absolute paths must start with
    |     ^^^^^^
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
index df723ddf590c40554142b2bcd01671310900dea6..1cdc9229d078c8f53f2b78f70eb9bdd639a94a55 100644 (file)
@@ -20,33 +20,23 @@ extern crate alloc as x;
 //~^ ERROR unused extern crate
 //~| HELP remove
 
+extern crate proc_macro;
+
 #[macro_use]
 extern crate test;
 
 pub extern crate test as y;
-//~^ ERROR `extern crate` is not idiomatic in the new edition
-//~| HELP convert it to a `pub use`
 
 pub extern crate libc;
-//~^ ERROR `extern crate` is not idiomatic in the new edition
-//~| HELP convert it to a `pub use`
 
 pub(crate) extern crate libc as a;
-//~^ ERROR `extern crate` is not idiomatic in the new edition
-//~| HELP convert it to a `pub(crate) use`
 
 crate extern crate libc as b;
-//~^ ERROR `extern crate` is not idiomatic in the new edition
-//~| HELP convert it to a `crate use`
 
 mod foo {
     pub(in crate::foo) extern crate libc as c;
-    //~^ ERROR `extern crate` is not idiomatic in the new edition
-    //~| HELP convert it to a `pub(in crate::foo) use`
 
     pub(super) extern crate libc as d;
-    //~^ ERROR `extern crate` is not idiomatic in the new edition
-    //~| HELP convert it to a `pub(super) use`
 
     extern crate alloc;
     //~^ ERROR unused extern crate
@@ -57,12 +47,8 @@ mod foo {
     //~| HELP remove
 
     pub extern crate test;
-    //~^ ERROR `extern crate` is not idiomatic in the new edition
-    //~| HELP convert it
 
     pub extern crate test as y;
-    //~^ ERROR `extern crate` is not idiomatic in the new edition
-    //~| HELP convert it
 
     mod bar {
         extern crate alloc;
@@ -74,8 +60,6 @@ mod foo {
         //~| HELP remove
 
         pub(in crate::foo::bar) extern crate libc as e;
-        //~^ ERROR `extern crate` is not idiomatic in the new edition
-        //~| HELP convert it to a `pub(in crate::foo::bar) use`
 
         fn dummy() {
             unsafe {
@@ -96,4 +80,6 @@ mod foo {
 fn main() {
     unsafe { a::getpid(); }
     unsafe { b::getpid(); }
+
+    proc_macro::TokenStream::new();
 }
index a4307112157b068e6929388aad3faf9c90127ce6..58ec5901585d4888fb91ef20adeb3f4bc63ed82e 100644 (file)
@@ -16,83 +16,29 @@ error: unused extern crate
 LL | extern crate alloc as x;
    | ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it
 
-error: `extern crate` is not idiomatic in the new edition
-  --> $DIR/unnecessary-extern-crate.rs:26:1
-   |
-LL | pub extern crate test as y;
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `pub use`
-
-error: `extern crate` is not idiomatic in the new edition
-  --> $DIR/unnecessary-extern-crate.rs:30:1
-   |
-LL | pub extern crate libc;
-   | ^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `pub use`
-
-error: `extern crate` is not idiomatic in the new edition
-  --> $DIR/unnecessary-extern-crate.rs:34:1
-   |
-LL | pub(crate) extern crate libc as a;
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `pub(crate) use`
-
-error: `extern crate` is not idiomatic in the new edition
-  --> $DIR/unnecessary-extern-crate.rs:38:1
-   |
-LL | crate extern crate libc as b;
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `crate use`
-
-error: `extern crate` is not idiomatic in the new edition
-  --> $DIR/unnecessary-extern-crate.rs:43:5
-   |
-LL |     pub(in crate::foo) extern crate libc as c;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `pub(in crate::foo) use`
-
-error: `extern crate` is not idiomatic in the new edition
-  --> $DIR/unnecessary-extern-crate.rs:47:5
-   |
-LL |     pub(super) extern crate libc as d;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `pub(super) use`
-
 error: unused extern crate
-  --> $DIR/unnecessary-extern-crate.rs:51:5
+  --> $DIR/unnecessary-extern-crate.rs:41:5
    |
 LL |     extern crate alloc;
    |     ^^^^^^^^^^^^^^^^^^^ help: remove it
 
 error: unused extern crate
-  --> $DIR/unnecessary-extern-crate.rs:55:5
+  --> $DIR/unnecessary-extern-crate.rs:45:5
    |
 LL |     extern crate alloc as x;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it
 
-error: `extern crate` is not idiomatic in the new edition
-  --> $DIR/unnecessary-extern-crate.rs:59:5
-   |
-LL |     pub extern crate test;
-   |     ^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `pub use`
-
-error: `extern crate` is not idiomatic in the new edition
-  --> $DIR/unnecessary-extern-crate.rs:63:5
-   |
-LL |     pub extern crate test as y;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `pub use`
-
 error: unused extern crate
-  --> $DIR/unnecessary-extern-crate.rs:68:9
+  --> $DIR/unnecessary-extern-crate.rs:54:9
    |
 LL |         extern crate alloc;
    |         ^^^^^^^^^^^^^^^^^^^ help: remove it
 
 error: unused extern crate
-  --> $DIR/unnecessary-extern-crate.rs:72:9
+  --> $DIR/unnecessary-extern-crate.rs:58:9
    |
 LL |         extern crate alloc as x;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it
 
-error: `extern crate` is not idiomatic in the new edition
-  --> $DIR/unnecessary-extern-crate.rs:76:9
-   |
-LL |         pub(in crate::foo::bar) extern crate libc as e;
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `pub(in crate::foo::bar) use`
-
-error: aborting due to 15 previous errors
+error: aborting due to 6 previous errors
 
diff --git a/src/test/ui/cfg-attr-trailing-comma.rs b/src/test/ui/cfg-attr-trailing-comma.rs
new file mode 100644 (file)
index 0000000..21e0054
--- /dev/null
@@ -0,0 +1,13 @@
+// compile-flags: --cfg TRUE
+
+#[cfg_attr(TRUE, inline,)] // OK
+fn f() {}
+
+#[cfg_attr(FALSE, inline,)] // OK
+fn g() {}
+
+#[cfg_attr(TRUE, inline,,)] //~ ERROR expected `)`, found `,`
+fn h() {}
+
+#[cfg_attr(FALSE, inline,,)] //~ ERROR expected `)`, found `,`
+fn i() {}
diff --git a/src/test/ui/cfg-attr-trailing-comma.stderr b/src/test/ui/cfg-attr-trailing-comma.stderr
new file mode 100644 (file)
index 0000000..76a4704
--- /dev/null
@@ -0,0 +1,14 @@
+error: expected `)`, found `,`
+  --> $DIR/cfg-attr-trailing-comma.rs:9:25
+   |
+LL | #[cfg_attr(TRUE, inline,,)] //~ ERROR expected `)`, found `,`
+   |                         ^ expected `)`
+
+error: expected `)`, found `,`
+  --> $DIR/cfg-attr-trailing-comma.rs:12:26
+   |
+LL | #[cfg_attr(FALSE, inline,,)] //~ ERROR expected `)`, found `,`
+   |                          ^ expected `)`
+
+error: aborting due to 2 previous errors
+
index 0cdb78c97803c7f80cf3ef89614173154971812f..5d50004e5549d112925063af615bf2cb444cca51 100644 (file)
@@ -22,7 +22,7 @@ const UNION: DummyUnion = DummyUnion { field1: 1065353216 };
 
 const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR this constant cannot be used
 
-const FIELD_PATH: Struct = Struct { //~ ERROR this constant cannot be used
+const FIELD_PATH: Struct = Struct { //~ ERROR this constant likely exhibits undefined behavior
     a: 42,
     b: unsafe { UNION.field3 },
 };
index e8a7b2f500561e31cbee5926bd8b7d8893e1d003..ec51802681e0df40295b55d80407b9800539969f 100644 (file)
@@ -6,14 +6,16 @@ LL | const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR this constant can
    |
    = note: #[deny(const_err)] on by default
 
-error: this constant cannot be used
+error[E0080]: this constant likely exhibits undefined behavior
   --> $DIR/union-ice.rs:25:1
    |
-LL | / const FIELD_PATH: Struct = Struct { //~ ERROR this constant cannot be used
+LL | / const FIELD_PATH: Struct = Struct { //~ ERROR this constant likely exhibits undefined behavior
 LL | |     a: 42,
 LL | |     b: unsafe { UNION.field3 },
 LL | | };
-   | |__^ attempted to read undefined bytes
+   | |__^ type validation failed: encountered undefined bytes at .b
+   |
+   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior
 
 error[E0080]: this constant likely exhibits undefined behavior
   --> $DIR/union-ice.rs:35:1
index 6343dc201c5d9f3e3980f0753798649e856fc423..647605ae4383e823623bf7314139624dc798b0bd 100644 (file)
@@ -88,6 +88,7 @@ mod invalid_signatures {
     }
 
     #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path
+    #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path
     fn b(x: WontChange) { }
 
     #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path from `WillChange`
index 0d75bf5a9adc0831109ade2e8e4558ba051d27a8..cbb695d0cf2b96696cd768cfe4d1f172acdebe6f 100644 (file)
@@ -82,14 +82,20 @@ error: no path from `WillChange` to `FnSignature`
 LL |     #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+error: no path from `WillChange` to `TypeckTables`
+  --> $DIR/dep-graph-struct-signature.rs:91:5
+   |
+LL |     #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 error: no path from `WillChange` to `FnSignature`
-  --> $DIR/dep-graph-struct-signature.rs:93:5
+  --> $DIR/dep-graph-struct-signature.rs:94:5
    |
 LL |     #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path from `WillChange`
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: no path from `WillChange` to `TypeckTables`
-  --> $DIR/dep-graph-struct-signature.rs:94:5
+  --> $DIR/dep-graph-struct-signature.rs:95:5
    |
 LL |     #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path from `WillChange`
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -130,5 +136,5 @@ error: OK
 LL |         #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 22 previous errors
+error: aborting due to 23 previous errors
 
diff --git a/src/test/ui/directory_ownership/mod_file_not_owning.rs b/src/test/ui/directory_ownership/mod_file_not_owning.rs
new file mode 100644 (file)
index 0000000..ff93fdd
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2014 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.
+
+// error-pattern: mod statements in non-mod.rs files are unstable
+
+mod mod_file_not_owning_aux1;
+
+fn main() {}
diff --git a/src/test/ui/directory_ownership/mod_file_not_owning.stderr b/src/test/ui/directory_ownership/mod_file_not_owning.stderr
new file mode 100644 (file)
index 0000000..e293757
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0658]: mod statements in non-mod.rs files are unstable (see issue #44660)
+  --> $DIR/mod_file_not_owning_aux1.rs:14:17
+   |
+LL |     () => { mod mod_file_not_owning_aux2; }
+   |                 ^^^^^^^^^^^^^^^^^^^^^^^^
+LL | }
+LL | m!();
+   | ----- in this macro invocation
+   |
+   = help: add #![feature(non_modrs_mods)] to the crate attributes to enable
+   = help: on stable builds, rename this file to mod_file_not_owning_aux1/mod.rs
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/directory_ownership/unowned_mod_with_path.rs b/src/test/ui/directory_ownership/unowned_mod_with_path.rs
new file mode 100644 (file)
index 0000000..0cffb7c
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2016 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.
+
+// error-pattern: mod statements in non-mod.rs files are unstable
+
+// This is not a directory owner since the file name is not "mod.rs".
+#[path = "mod_file_not_owning_aux1.rs"]
+mod foo;
diff --git a/src/test/ui/directory_ownership/unowned_mod_with_path.stderr b/src/test/ui/directory_ownership/unowned_mod_with_path.stderr
new file mode 100644 (file)
index 0000000..0c0b428
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0658]: mod statements in non-mod.rs files are unstable (see issue #44660)
+  --> $DIR/mod_file_not_owning_aux1.rs:14:17
+   |
+LL |     () => { mod mod_file_not_owning_aux2; }
+   |                 ^^^^^^^^^^^^^^^^^^^^^^^^
+LL | }
+LL | m!();
+   | ----- in this macro invocation
+   |
+   = help: add #![feature(non_modrs_mods)] to the crate attributes to enable
+   = help: on stable builds, rename this file to foo/mod.rs
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
index 02e7d5b7cd01cc530acf271dc580df69078a0c46..5955410aa106b15582ac56b85c2e04d29e5a31f0 100644 (file)
@@ -23,7 +23,7 @@ LL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the t
    |                                   ^^^^^
 
 error: expected one of `move`, `|`, or `||`, found `<eof>`
-  --> <passes_ident macros>:1:22
+  --> <::edition_kw_macro_2015::passes_ident macros>:1:22
    |
 LL | ( $ i : ident ) => ( $ i )
    |                      ^^^ expected one of `move`, `|`, or `||` here
index 435e395c2910e39919a5c93dbc27d244b53a55ff..6ea736828f9078e95716a36760032b4b3d3b50fe 100644 (file)
@@ -23,7 +23,7 @@ LL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the t
    |                                   ^^^^^
 
 error: expected one of `move`, `|`, or `||`, found `<eof>`
-  --> <passes_ident macros>:1:22
+  --> <::edition_kw_macro_2018::passes_ident macros>:1:22
    |
 LL | ( $ i : ident ) => ( $ i )
    |                      ^^^ expected one of `move`, `|`, or `||` here
diff --git a/src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.rs b/src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.rs
new file mode 100644 (file)
index 0000000..01ccc50
--- /dev/null
@@ -0,0 +1,18 @@
+// Copyright 2015 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.
+
+// Needs an explicit where clause stating outlives condition. (RFC 2093)
+
+// Type T needs to outlive lifetime 'a.
+struct Foo<'a, T> {
+    bar: &'a [T] //~ ERROR the parameter type `T` may not live long enough [E0309]
+}
+
+fn main() { }
diff --git a/src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.stderr b/src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.stderr
new file mode 100644 (file)
index 0000000..560e494
--- /dev/null
@@ -0,0 +1,17 @@
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/feature-gate-infer_outlives_requirements.rs:15:5
+   |
+LL | struct Foo<'a, T> {
+   |                - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     bar: &'a [T] //~ ERROR the parameter type `T` may not live long enough [E0309]
+   |     ^^^^^^^^^^^^
+   |
+note: ...so that the reference type `&'a [T]` does not outlive the data it points at
+  --> $DIR/feature-gate-infer_outlives_requirements.rs:15:5
+   |
+LL |     bar: &'a [T] //~ ERROR the parameter type `T` may not live long enough [E0309]
+   |     ^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/impl-trait/auxiliary/extra-item.rs b/src/test/ui/impl-trait/auxiliary/extra-item.rs
new file mode 100644 (file)
index 0000000..8eaeafa
--- /dev/null
@@ -0,0 +1 @@
+pub trait MyTrait {}
diff --git a/src/test/ui/impl-trait/extra-item.rs b/src/test/ui/impl-trait/extra-item.rs
new file mode 100644 (file)
index 0000000..d82237c
--- /dev/null
@@ -0,0 +1,10 @@
+// aux-build:extra-item.rs
+// compile-flags:--extern extra_item
+
+struct S;
+
+impl extra_item::MyTrait for S {
+    fn extra() {} //~ ERROR method `extra` is not a member of trait `extra_item::MyTrait`
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/extra-item.stderr b/src/test/ui/impl-trait/extra-item.stderr
new file mode 100644 (file)
index 0000000..de3c7ba
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0407]: method `extra` is not a member of trait `extra_item::MyTrait`
+  --> $DIR/extra-item.rs:7:5
+   |
+LL |     fn extra() {} //~ ERROR method `extra` is not a member of trait `extra_item::MyTrait`
+   |     ^^^^^^^^^^^^^ not a member of trait `extra_item::MyTrait`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0407`.
index cce1fd30f1d6db14ae3e90934113884afbc47c88..9c475451ce32f64e14cdd86af0a7e6512f7c0968 100644 (file)
@@ -60,7 +60,7 @@ LL |       define_panic!();
    = note: macro-expanded macros do not shadow
 
 error[E0659]: `panic` is ambiguous
-  --> <panic macros>:1:13
+  --> <::std::macros::panic macros>:1:13
    |
 LL | (  ) => ( { panic ! ( "explicit panic" ) } ) ; ( $ msg : expr ) => (
    |             ^^^^^ ambiguous name
index 47ab8fc6c2f75ccbd663fd47f3e99c176f421f67..f7dc7ac9eac81a4e0e65010b47afb308ab726ad1 100644 (file)
@@ -45,7 +45,7 @@ mod m3 {
 mod m4 {
     macro_rules! m { () => {} }
     use two_macros::m;
-    m!(); //~ ERROR ambiguous
+    m!();
 }
 
 fn main() {}
index c54101fc6e6a8ec69d2d43f6665c58c7b98d73d2..209d449dfd84016acb13a3417fe0293c86ccf6b6 100644 (file)
@@ -1,20 +1,3 @@
-error[E0659]: `m` is ambiguous
-  --> $DIR/macros.rs:48:5
-   |
-LL |     m!(); //~ ERROR ambiguous
-   |     ^ ambiguous name
-   |
-note: `m` could refer to the name defined here
-  --> $DIR/macros.rs:46:5
-   |
-LL |     macro_rules! m { () => {} }
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: `m` could also refer to the name imported here
-  --> $DIR/macros.rs:47:9
-   |
-LL |     use two_macros::m;
-   |         ^^^^^^^^^^^^^
-
 error[E0659]: `m` is ambiguous
   --> $DIR/macros.rs:26:5
    |
@@ -51,6 +34,6 @@ LL |     use two_macros::m;
    |         ^^^^^^^^^^^^^
    = note: macro-expanded macro imports do not shadow
 
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0659`.
index 0dd5a8512852a53033649ebb2e800ccb3e52542b..e4ade1b6323b7b30023a06bfba6b1fbea9e76126 100644 (file)
@@ -10,6 +10,8 @@
 
 //compile-pass
 
+#![feature(infer_outlives_requirements)]
+
 struct Foo {
     bar: for<'r> Fn(usize, &'r FnMut())
 }
index 24ed7ce92bfda9e14f7e3aa37dc562724fe106a5..98806cdd1b9aff8e720f05d42568cf1588c2ca71 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-pass
-
 #![feature(rustc_attrs)]
 #![allow(warnings)]
 
@@ -19,6 +17,7 @@ struct Point {
 
 struct NestedA<'a, 'b> {
     x: &'a NestedB<'b>
+    //~^ ERROR E0491
 }
 
 struct NestedB<'a> {
diff --git a/src/test/ui/issues/issue-37323.stderr b/src/test/ui/issues/issue-37323.stderr
new file mode 100644 (file)
index 0000000..a83923a
--- /dev/null
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a NestedB<'b>`, reference has a longer lifetime than the data it references
+  --> $DIR/issue-37323.rs:19:5
+   |
+LL |     x: &'a NestedB<'b>
+   |     ^^^^^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the struct at 18:16
+  --> $DIR/issue-37323.rs:18:16
+   |
+LL | struct NestedA<'a, 'b> {
+   |                ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 18:20
+  --> $DIR/issue-37323.rs:18:20
+   |
+LL | struct NestedA<'a, 'b> {
+   |                    ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/issues/issue-54387.rs b/src/test/ui/issues/issue-54387.rs
new file mode 100644 (file)
index 0000000..ac1033a
--- /dev/null
@@ -0,0 +1,12 @@
+// compile-pass
+
+pub struct GstRc {
+    _obj: *const (),
+    _borrowed: bool,
+}
+
+const FOO: Option<GstRc> = None;
+
+fn main() {
+    let _meh = FOO;
+}
index 7bc83fd750703b00d22bd2a09c1f6748bcec27ca..0099a8bc10f5a2a2682174a5fdd5e911a288664b 100644 (file)
@@ -14,9 +14,9 @@ trait ListItem<'a> {
 
 trait Collection { fn len(&self) -> usize; }
 
-// is now well formed. RFC 2093
 struct List<'a, T: ListItem<'a>> {
     slice: &'a [T]
+    //~^ ERROR may not live long enough
 }
 
 impl<'a, T: ListItem<'a>> Collection for List<'a, T> {
index db8d57bb19d03e931cb14ba35852606e900a7c29..ea79990bbb1fb21bdb5932d29e944c3f27a08dbd 100644 (file)
@@ -1,3 +1,17 @@
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/lifetime-doesnt-live-long-enough.rs:18:5
+   |
+LL | struct List<'a, T: ListItem<'a>> {
+   |                 -- help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     slice: &'a [T]
+   |     ^^^^^^^^^^^^^^
+   |
+note: ...so that the reference type `&'a [T]` does not outlive the data it points at
+  --> $DIR/lifetime-doesnt-live-long-enough.rs:18:5
+   |
+LL |     slice: &'a [T]
+   |     ^^^^^^^^^^^^^^
+
 error[E0310]: the parameter type `T` may not live long enough
   --> $DIR/lifetime-doesnt-live-long-enough.rs:29:5
    |
@@ -95,7 +109,7 @@ LL | |         //~^ ERROR may not live long enough
 LL | |     }
    | |_____^
 
-error: aborting due to 6 previous errors
+error: aborting due to 7 previous errors
 
 Some errors occurred: E0309, E0310.
 For more information about an error, try `rustc --explain E0309`.
index e09aabaf69253ee855c1b7a8368c033dd5af38f7..b8b1a675c5f6dbef301f694c8c6d52f2b46a2938 100644 (file)
@@ -11,8 +11,6 @@
 #![deny(improper_ctypes)]
 #![feature(libc)]
 
-#![allow(private_in_public)]
-
 extern crate libc;
 
 use std::marker::PhantomData;
index b243c49316f8cdacdb408ae449242a66eac784e2..b97e4662660fbd5c5236d5cca266c83a619beda6 100644 (file)
@@ -1,5 +1,5 @@
 error: `extern` block uses type `Foo` which is not FFI-safe: this struct has unspecified layout
-  --> $DIR/lint-ctypes.rs:56:28
+  --> $DIR/lint-ctypes.rs:54:28
    |
 LL |     pub fn ptr_type1(size: *const Foo); //~ ERROR: uses type `Foo`
    |                            ^^^^^^^^^^
@@ -11,26 +11,26 @@ LL | #![deny(improper_ctypes)]
    |         ^^^^^^^^^^^^^^^
    = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct
 note: type defined here
-  --> $DIR/lint-ctypes.rs:34:1
+  --> $DIR/lint-ctypes.rs:32:1
    |
 LL | pub struct Foo;
    | ^^^^^^^^^^^^^^^
 
 error: `extern` block uses type `Foo` which is not FFI-safe: this struct has unspecified layout
-  --> $DIR/lint-ctypes.rs:57:28
+  --> $DIR/lint-ctypes.rs:55:28
    |
 LL |     pub fn ptr_type2(size: *const Foo); //~ ERROR: uses type `Foo`
    |                            ^^^^^^^^^^
    |
    = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct
 note: type defined here
-  --> $DIR/lint-ctypes.rs:34:1
+  --> $DIR/lint-ctypes.rs:32:1
    |
 LL | pub struct Foo;
    | ^^^^^^^^^^^^^^^
 
 error: `extern` block uses type `[u32]` which is not FFI-safe: slices have no C equivalent
-  --> $DIR/lint-ctypes.rs:58:26
+  --> $DIR/lint-ctypes.rs:56:26
    |
 LL |     pub fn slice_type(p: &[u32]); //~ ERROR: uses type `[u32]`
    |                          ^^^^^^
@@ -38,7 +38,7 @@ LL |     pub fn slice_type(p: &[u32]); //~ ERROR: uses type `[u32]`
    = help: consider using a raw pointer instead
 
 error: `extern` block uses type `str` which is not FFI-safe: string slices have no C equivalent
-  --> $DIR/lint-ctypes.rs:59:24
+  --> $DIR/lint-ctypes.rs:57:24
    |
 LL |     pub fn str_type(p: &str); //~ ERROR: uses type `str`
    |                        ^^^^
@@ -46,7 +46,7 @@ LL |     pub fn str_type(p: &str); //~ ERROR: uses type `str`
    = help: consider using `*const u8` and a length instead
 
 error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout
-  --> $DIR/lint-ctypes.rs:60:24
+  --> $DIR/lint-ctypes.rs:58:24
    |
 LL |     pub fn box_type(p: Box<u32>); //~ ERROR uses type `std::boxed::Box<u32>`
    |                        ^^^^^^^^
@@ -54,7 +54,7 @@ LL |     pub fn box_type(p: Box<u32>); //~ ERROR uses type `std::boxed::Box<u32>
    = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct
 
 error: `extern` block uses type `char` which is not FFI-safe: the `char` type has no C equivalent
-  --> $DIR/lint-ctypes.rs:61:25
+  --> $DIR/lint-ctypes.rs:59:25
    |
 LL |     pub fn char_type(p: char); //~ ERROR uses type `char`
    |                         ^^^^
@@ -62,25 +62,25 @@ LL |     pub fn char_type(p: char); //~ ERROR uses type `char`
    = help: consider using `u32` or `libc::wchar_t` instead
 
 error: `extern` block uses type `i128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI
-  --> $DIR/lint-ctypes.rs:62:25
+  --> $DIR/lint-ctypes.rs:60:25
    |
 LL |     pub fn i128_type(p: i128); //~ ERROR uses type `i128`
    |                         ^^^^
 
 error: `extern` block uses type `u128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI
-  --> $DIR/lint-ctypes.rs:63:25
+  --> $DIR/lint-ctypes.rs:61:25
    |
 LL |     pub fn u128_type(p: u128); //~ ERROR uses type `u128`
    |                         ^^^^
 
 error: `extern` block uses type `dyn std::clone::Clone` which is not FFI-safe: trait objects have no C equivalent
-  --> $DIR/lint-ctypes.rs:64:26
+  --> $DIR/lint-ctypes.rs:62:26
    |
 LL |     pub fn trait_type(p: &Clone); //~ ERROR uses type `dyn std::clone::Clone`
    |                          ^^^^^^
 
 error: `extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have unspecified layout
-  --> $DIR/lint-ctypes.rs:65:26
+  --> $DIR/lint-ctypes.rs:63:26
    |
 LL |     pub fn tuple_type(p: (i32, i32)); //~ ERROR uses type `(i32, i32)`
    |                          ^^^^^^^^^^
@@ -88,7 +88,7 @@ LL |     pub fn tuple_type(p: (i32, i32)); //~ ERROR uses type `(i32, i32)`
    = help: consider using a struct instead
 
 error: `extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have unspecified layout
-  --> $DIR/lint-ctypes.rs:66:27
+  --> $DIR/lint-ctypes.rs:64:27
    |
 LL |     pub fn tuple_type2(p: I32Pair); //~ ERROR uses type `(i32, i32)`
    |                           ^^^^^^^
@@ -96,32 +96,32 @@ LL |     pub fn tuple_type2(p: I32Pair); //~ ERROR uses type `(i32, i32)`
    = help: consider using a struct instead
 
 error: `extern` block uses type `ZeroSize` which is not FFI-safe: this struct has no fields
-  --> $DIR/lint-ctypes.rs:67:25
+  --> $DIR/lint-ctypes.rs:65:25
    |
 LL |     pub fn zero_size(p: ZeroSize); //~ ERROR struct has no fields
    |                         ^^^^^^^^
    |
    = help: consider adding a member to this struct
 note: type defined here
-  --> $DIR/lint-ctypes.rs:30:1
+  --> $DIR/lint-ctypes.rs:28:1
    |
 LL | pub struct ZeroSize;
    | ^^^^^^^^^^^^^^^^^^^^
 
 error: `extern` block uses type `ZeroSizeWithPhantomData` which is not FFI-safe: composed only of PhantomData
-  --> $DIR/lint-ctypes.rs:68:33
+  --> $DIR/lint-ctypes.rs:66:33
    |
 LL |     pub fn zero_size_phantom(p: ZeroSizeWithPhantomData); //~ ERROR composed only of PhantomData
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^
 
 error: `extern` block uses type `std::marker::PhantomData<bool>` which is not FFI-safe: composed only of PhantomData
-  --> $DIR/lint-ctypes.rs:70:12
+  --> $DIR/lint-ctypes.rs:68:12
    |
 LL |         -> ::std::marker::PhantomData<bool>; //~ ERROR: composed only of PhantomData
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: `extern` block uses type `fn()` which is not FFI-safe: this function pointer has Rust-specific calling convention
-  --> $DIR/lint-ctypes.rs:71:23
+  --> $DIR/lint-ctypes.rs:69:23
    |
 LL |     pub fn fn_type(p: RustFn); //~ ERROR function pointer has Rust-specific
    |                       ^^^^^^
@@ -129,7 +129,7 @@ LL |     pub fn fn_type(p: RustFn); //~ ERROR function pointer has Rust-specific
    = help: consider using an `extern fn(...) -> ...` function pointer instead
 
 error: `extern` block uses type `fn()` which is not FFI-safe: this function pointer has Rust-specific calling convention
-  --> $DIR/lint-ctypes.rs:72:24
+  --> $DIR/lint-ctypes.rs:70:24
    |
 LL |     pub fn fn_type2(p: fn()); //~ ERROR function pointer has Rust-specific
    |                        ^^^^
@@ -137,7 +137,7 @@ LL |     pub fn fn_type2(p: fn()); //~ ERROR function pointer has Rust-specific
    = help: consider using an `extern fn(...) -> ...` function pointer instead
 
 error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout
-  --> $DIR/lint-ctypes.rs:73:28
+  --> $DIR/lint-ctypes.rs:71:28
    |
 LL |     pub fn fn_contained(p: RustBadRet); //~ ERROR: uses type `std::boxed::Box<u32>`
    |                            ^^^^^^^^^^
@@ -145,13 +145,13 @@ LL |     pub fn fn_contained(p: RustBadRet); //~ ERROR: uses type `std::boxed::B
    = help: consider adding a #[repr(C)] or #[repr(transparent)] attribute to this struct
 
 error: `extern` block uses type `i128` which is not FFI-safe: 128-bit integers don't currently have a known stable ABI
-  --> $DIR/lint-ctypes.rs:74:32
+  --> $DIR/lint-ctypes.rs:72:32
    |
 LL |     pub fn transparent_i128(p: TransparentI128); //~ ERROR: uses type `i128`
    |                                ^^^^^^^^^^^^^^^
 
 error: `extern` block uses type `str` which is not FFI-safe: string slices have no C equivalent
-  --> $DIR/lint-ctypes.rs:75:31
+  --> $DIR/lint-ctypes.rs:73:31
    |
 LL |     pub fn transparent_str(p: TransparentStr); //~ ERROR: uses type `str`
    |                               ^^^^^^^^^^^^^^
@@ -159,7 +159,7 @@ LL |     pub fn transparent_str(p: TransparentStr); //~ ERROR: uses type `str`
    = help: consider using `*const u8` and a length instead
 
 error: `extern` block uses type `std::boxed::Box<u32>` which is not FFI-safe: this struct has unspecified layout
-  --> $DIR/lint-ctypes.rs:76:30
+  --> $DIR/lint-ctypes.rs:74:30
    |
 LL |     pub fn transparent_fn(p: TransparentBadFn); //~ ERROR: uses type `std::boxed::Box<u32>`
    |                              ^^^^^^^^^^^^^^^^
index 2fe72365bab1cbf5e9d045b13789ac8b985cc18b..944d57b5ba8f5866860e639ca29ae3ee5bde6f29 100644 (file)
@@ -109,6 +109,10 @@ fn bar() { //~ ERROR: function is never used
     foo();
 }
 
+fn baz() -> impl Copy { //~ ERROR: function is never used
+    "I'm unused, too"
+}
+
 // Code with #[allow(dead_code)] should be marked live (and thus anything it
 // calls is marked live)
 #[allow(dead_code)]
index 9802b7e8f383b4ed31eed7c2fa1663108266fc8d..9d8e44c25d87e3a8f3a52e4a8927ea45954d09d0 100644 (file)
@@ -58,5 +58,11 @@ error: function is never used: `bar`
 LL | fn bar() { //~ ERROR: function is never used
    | ^^^^^^^^
 
-error: aborting due to 9 previous errors
+error: function is never used: `baz`
+  --> $DIR/lint-dead-code-1.rs:112:1
+   |
+LL | fn baz() -> impl Copy { //~ ERROR: function is never used
+   | ^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 10 previous errors
 
index 10eabca63538d319c427297e79a4c2cdcec179dd..8cecef508a2b295f4fd2f156f2ec7f9ab8892b17 100644 (file)
@@ -22,7 +22,7 @@ LL | | }
 LL |       ping!();
    |       -------- in this macro invocation
    | 
-  ::: <ping macros>:1:1
+  ::: <::ping::ping macros>:1:1
    |
 LL |   (  ) => { pong ! (  ) ; }
    |   -------------------------
@@ -42,7 +42,7 @@ LL | | }
 LL |       deep!();
    |       -------- in this macro invocation (#1)
    | 
-  ::: <deep macros>:1:1
+  ::: <::ping::deep macros>:1:1
    |
 LL |   (  ) => { foo ! (  ) ; }
    |   ------------------------
@@ -50,7 +50,7 @@ LL |   (  ) => { foo ! (  ) ; }
    |   |         in this macro invocation (#2)
    |   in this expansion of `deep!` (#1)
    | 
-  ::: <foo macros>:1:1
+  ::: <::ping::foo macros>:1:1
    |
 LL |   (  ) => { bar ! (  ) ; }
    |   ------------------------
@@ -58,7 +58,7 @@ LL |   (  ) => { bar ! (  ) ; }
    |   |         in this macro invocation (#3)
    |   in this expansion of `foo!` (#2)
    | 
-  ::: <bar macros>:1:1
+  ::: <::ping::bar macros>:1:1
    |
 LL |   (  ) => { ping ! (  ) ; }
    |   -------------------------
@@ -66,7 +66,7 @@ LL |   (  ) => { ping ! (  ) ; }
    |   |         in this macro invocation (#4)
    |   in this expansion of `bar!` (#3)
    | 
-  ::: <ping macros>:1:1
+  ::: <::ping::ping macros>:1:1
    |
 LL |   (  ) => { pong ! (  ) ; }
    |   -------------------------
diff --git a/src/test/ui/macros/ambiguity-legacy-vs-modern.rs b/src/test/ui/macros/ambiguity-legacy-vs-modern.rs
new file mode 100644 (file)
index 0000000..216b9dd
--- /dev/null
@@ -0,0 +1,46 @@
+// Some non-controversial subset of ambiguities "modern macro name" vs "macro_rules"
+// is disambiguated to mitigate regressions from macro modularization.
+// Scoping for `macro_rules` behaves like scoping for `let` at module level, in general.
+
+#![feature(decl_macro)]
+
+fn same_unnamed_mod() {
+    macro m() { 0 }
+
+    macro_rules! m { () => (()) }
+
+    m!() // OK
+}
+
+fn nested_unnamed_mod() {
+    macro m() { 0 }
+
+    {
+        macro_rules! m { () => (()) }
+
+        m!() // OK
+    }
+}
+
+fn nested_unnamed_mod_fail() {
+    macro_rules! m { () => (()) }
+
+    {
+        macro m() { 0 }
+
+        m!() //~ ERROR `m` is ambiguous
+    }
+}
+
+fn nexted_named_mod_fail() {
+    macro m() { 0 }
+
+    #[macro_use]
+    mod inner {
+        macro_rules! m { () => (()) }
+    }
+
+    m!() //~ ERROR `m` is ambiguous
+}
+
+fn main() {}
diff --git a/src/test/ui/macros/ambiguity-legacy-vs-modern.stderr b/src/test/ui/macros/ambiguity-legacy-vs-modern.stderr
new file mode 100644 (file)
index 0000000..b5e1e75
--- /dev/null
@@ -0,0 +1,37 @@
+error[E0659]: `m` is ambiguous
+  --> $DIR/ambiguity-legacy-vs-modern.rs:31:9
+   |
+LL |         m!() //~ ERROR `m` is ambiguous
+   |         ^ ambiguous name
+   |
+note: `m` could refer to the name defined here
+  --> $DIR/ambiguity-legacy-vs-modern.rs:26:5
+   |
+LL |     macro_rules! m { () => (()) }
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: `m` could also refer to the name defined here
+  --> $DIR/ambiguity-legacy-vs-modern.rs:29:9
+   |
+LL |         macro m() { 0 }
+   |         ^^^^^^^^^^^^^^^
+
+error[E0659]: `m` is ambiguous
+  --> $DIR/ambiguity-legacy-vs-modern.rs:43:5
+   |
+LL |     m!() //~ ERROR `m` is ambiguous
+   |     ^ ambiguous name
+   |
+note: `m` could refer to the name defined here
+  --> $DIR/ambiguity-legacy-vs-modern.rs:40:9
+   |
+LL |         macro_rules! m { () => (()) }
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: `m` could also refer to the name defined here
+  --> $DIR/ambiguity-legacy-vs-modern.rs:36:5
+   |
+LL |     macro m() { 0 }
+   |     ^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0659`.
index 34d1075f9b71dbd1d1bd766d2422bb3e1a606832..1c2bf1573dcc1900e2f2becbc6396ccc58a016f0 100644 (file)
 #![feature(lang_items, box_syntax)]
 #![no_std]
 
-use core::panic::PanicInfo;
-
 fn main() {
     let x = box 1i32;
 }
 
 #[lang = "eh_personality"] extern fn eh_personality() {}
 #[lang = "eh_unwind_resume"] extern fn eh_unwind_resume() {}
-#[lang = "panic_impl"] fn panic_impl(panic: &PanicInfo) -> ! { loop {} }
+#[lang = "panic_impl"] fn panic_impl() -> ! { loop {} }
diff --git a/src/test/ui/non_modrs_mods/non_modrs_mods.rs b/src/test/ui/non_modrs_mods/non_modrs_mods.rs
new file mode 100644 (file)
index 0000000..9dc85f4
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright 2017 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.
+//
+// Tests the formatting of the feature-gate errors for non_modrs_mods
+//
+// gate-test-non_modrs_mods
+// ignore-windows
+// ignore-pretty issue #37195
+pub mod modrs_mod;
+pub mod foors_mod;
+
+#[path = "some_crazy_attr_mod_dir/arbitrary_name.rs"]
+pub mod attr_mod;
+
+pub fn main() {
+    modrs_mod::inner_modrs_mod::innest::foo();
+    modrs_mod::inner_foors_mod::innest::foo();
+    foors_mod::inner_modrs_mod::innest::foo();
+    foors_mod::inner_foors_mod::innest::foo();
+    attr_mod::inner_modrs_mod::innest::foo();
+}
diff --git a/src/test/ui/non_modrs_mods/non_modrs_mods.stderr b/src/test/ui/non_modrs_mods/non_modrs_mods.stderr
new file mode 100644 (file)
index 0000000..c45ab73
--- /dev/null
@@ -0,0 +1,39 @@
+error[E0658]: mod statements in non-mod.rs files are unstable (see issue #44660)
+  --> $DIR/modrs_mod/inner_foors_mod.rs:11:9
+   |
+LL | pub mod innest;
+   |         ^^^^^^
+   |
+   = help: add #![feature(non_modrs_mods)] to the crate attributes to enable
+   = help: on stable builds, rename this file to inner_foors_mod/mod.rs
+
+error[E0658]: mod statements in non-mod.rs files are unstable (see issue #44660)
+  --> $DIR/foors_mod.rs:13:9
+   |
+LL | pub mod inner_modrs_mod;
+   |         ^^^^^^^^^^^^^^^
+   |
+   = help: add #![feature(non_modrs_mods)] to the crate attributes to enable
+   = help: on stable builds, rename this file to foors_mod/mod.rs
+
+error[E0658]: mod statements in non-mod.rs files are unstable (see issue #44660)
+  --> $DIR/foors_mod.rs:14:9
+   |
+LL | pub mod inner_foors_mod;
+   |         ^^^^^^^^^^^^^^^
+   |
+   = help: add #![feature(non_modrs_mods)] to the crate attributes to enable
+   = help: on stable builds, rename this file to foors_mod/mod.rs
+
+error[E0658]: mod statements in non-mod.rs files are unstable (see issue #44660)
+  --> $DIR/foors_mod/inner_foors_mod.rs:11:9
+   |
+LL | pub mod innest;
+   |         ^^^^^^
+   |
+   = help: add #![feature(non_modrs_mods)] to the crate attributes to enable
+   = help: on stable builds, rename this file to inner_foors_mod/mod.rs
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
index a2d3cf6779f1768f4bf620ddd76862cd89bdd934..e21f92bc9b885947d84bc603015edeb5c1175413 100644 (file)
@@ -8,43 +8,31 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-tidy-linelength
-
 // Various examples of structs whose fields are not well-formed.
 
 #![allow(dead_code)]
 
-trait Dummy<'a> {
-  type Out;
-}
-impl<'a, T> Dummy<'a> for T
-where T: 'a
-{
-  type Out = ();
-}
-type RequireOutlives<'a, T> = <T as Dummy<'a>>::Out;
-
 enum Ref1<'a, T> {
-    Ref1Variant1(RequireOutlives<'a, T>) //~ ERROR the parameter type `T` may not live long enough
+    Ref1Variant1(&'a T) //~ ERROR the parameter type `T` may not live long enough
 }
 
 enum Ref2<'a, T> {
     Ref2Variant1,
-    Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough
+    Ref2Variant2(isize, &'a T), //~ ERROR the parameter type `T` may not live long enough
 }
 
 enum RefOk<'a, T:'a> {
     RefOkVariant1(&'a T)
 }
 
-// This is now well formed. RFC 2093
 enum RefIndirect<'a, T> {
     RefIndirectVariant1(isize, RefOk<'a,T>)
+        //~^ ERROR the parameter type `T` may not live long enough
 }
 
-enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
-    RefDoubleVariant1(&'a RequireOutlives<'b, T>)
-        //~^ 46:23: 46:49: the parameter type `T` may not live long enough [E0309]
+enum RefDouble<'a, 'b, T> {
+    RefDoubleVariant1(&'a &'b T)
+        //~^ ERROR reference has a longer lifetime than the data
 }
 
 fn main() { }
index 923ea17622ac08e5b62457b8fde3cb2c7dd17886..381a8aada5a3f9fdda8a850604ca271f373d3da4 100644 (file)
@@ -1,67 +1,64 @@
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-enum-not-wf.rs:28:18
+  --> $DIR/regions-enum-not-wf.rs:16:18
    |
 LL | enum Ref1<'a, T> {
    |               - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     Ref1Variant1(RequireOutlives<'a, T>) //~ ERROR the parameter type `T` may not live long enough
-   |                  ^^^^^^^^^^^^^^^^^^^^^^
+LL |     Ref1Variant1(&'a T) //~ ERROR the parameter type `T` may not live long enough
+   |                  ^^^^^
    |
-note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/regions-enum-not-wf.rs:28:18
+note: ...so that the reference type `&'a T` does not outlive the data it points at
+  --> $DIR/regions-enum-not-wf.rs:16:18
    |
-LL |     Ref1Variant1(RequireOutlives<'a, T>) //~ ERROR the parameter type `T` may not live long enough
-   |                  ^^^^^^^^^^^^^^^^^^^^^^
+LL |     Ref1Variant1(&'a T) //~ ERROR the parameter type `T` may not live long enough
+   |                  ^^^^^
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-enum-not-wf.rs:33:25
+  --> $DIR/regions-enum-not-wf.rs:21:25
    |
 LL | enum Ref2<'a, T> {
    |               - help: consider adding an explicit lifetime bound `T: 'a`...
 LL |     Ref2Variant1,
-LL |     Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough
-   |                         ^^^^^^^^^^^^^^^^^^^^^^
+LL |     Ref2Variant2(isize, &'a T), //~ ERROR the parameter type `T` may not live long enough
+   |                         ^^^^^
    |
-note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/regions-enum-not-wf.rs:33:25
+note: ...so that the reference type `&'a T` does not outlive the data it points at
+  --> $DIR/regions-enum-not-wf.rs:21:25
    |
-LL |     Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough
-   |                         ^^^^^^^^^^^^^^^^^^^^^^
+LL |     Ref2Variant2(isize, &'a T), //~ ERROR the parameter type `T` may not live long enough
+   |                         ^^^^^
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-enum-not-wf.rs:45:1
+  --> $DIR/regions-enum-not-wf.rs:29:32
    |
-LL |   enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
-   |   ^                      - help: consider adding an explicit lifetime bound `T: 'b`...
-   |  _|
-   | |
-LL | |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
-LL | |         //~^ 46:23: 46:49: the parameter type `T` may not live long enough [E0309]
-LL | | }
-   | |_^
+LL | enum RefIndirect<'a, T> {
+   |                      - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     RefIndirectVariant1(isize, RefOk<'a,T>)
+   |                                ^^^^^^^^^^^
    |
 note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/regions-enum-not-wf.rs:45:1
+  --> $DIR/regions-enum-not-wf.rs:29:32
    |
-LL | / enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
-LL | |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
-LL | |         //~^ 46:23: 46:49: the parameter type `T` may not live long enough [E0309]
-LL | | }
-   | |_^
+LL |     RefIndirectVariant1(isize, RefOk<'a,T>)
+   |                                ^^^^^^^^^^^
 
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-enum-not-wf.rs:46:23
+error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-enum-not-wf.rs:34:23
    |
-LL | enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
-   |                        - help: consider adding an explicit lifetime bound `T: 'b`...
-LL |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     RefDoubleVariant1(&'a &'b T)
+   |                       ^^^^^^^^^
    |
-note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/regions-enum-not-wf.rs:46:23
+note: the pointer is valid for the lifetime 'a as defined on the enum at 33:16
+  --> $DIR/regions-enum-not-wf.rs:33:16
+   |
+LL | enum RefDouble<'a, 'b, T> {
+   |                ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 33:20
+  --> $DIR/regions-enum-not-wf.rs:33:20
    |
-LL |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | enum RefDouble<'a, 'b, T> {
+   |                    ^^
 
 error: aborting due to 4 previous errors
 
-For more information about this error, try `rustc --explain E0309`.
+Some errors occurred: E0309, E0491.
+For more information about an error, try `rustc --explain E0309`.
index 7a2be8c0d95bb2fb5f2b8256de2e6e1424bc8015..db25a0698fed4333e21c74f76b87a1407d06d431 100644 (file)
@@ -13,8 +13,6 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
-// compile-pass
-
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -23,8 +21,9 @@ mod rev_variant_struct_region {
         x: fn(&'a i32),
     }
     enum Bar<'a,'b> {
-        V(&'a Foo<'b>)
+        V(&'a Foo<'b>) //~ ERROR reference has a longer lifetime
     }
 }
 
+#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.stderr b/src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.stderr
new file mode 100644 (file)
index 0000000..5084097
--- /dev/null
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a rev_variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-outlives-nominal-type-enum-region-rev.rs:24:11
+   |
+LL |         V(&'a Foo<'b>) //~ ERROR reference has a longer lifetime
+   |           ^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the enum at 23:14
+  --> $DIR/regions-outlives-nominal-type-enum-region-rev.rs:23:14
+   |
+LL |     enum Bar<'a,'b> {
+   |              ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 23:17
+  --> $DIR/regions-outlives-nominal-type-enum-region-rev.rs:23:17
+   |
+LL |     enum Bar<'a,'b> {
+   |                 ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
index 07127263bf869814be1c7e140c7378c7fe4d09f7..403757042d2f3521783564870700ef2323abd7a9 100644 (file)
@@ -13,8 +13,6 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
-// compile-pass
-
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -23,8 +21,9 @@ mod variant_struct_region {
         x: &'a i32,
     }
     enum Bar<'a,'b> {
-        V(&'a Foo<'b>)
+        V(&'a Foo<'b>) //~ ERROR reference has a longer lifetime
     }
 }
 
+#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-region.stderr b/src/test/ui/regions/regions-outlives-nominal-type-enum-region.stderr
new file mode 100644 (file)
index 0000000..ce187ed
--- /dev/null
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-outlives-nominal-type-enum-region.rs:24:11
+   |
+LL |         V(&'a Foo<'b>) //~ ERROR reference has a longer lifetime
+   |           ^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the enum at 23:14
+  --> $DIR/regions-outlives-nominal-type-enum-region.rs:23:14
+   |
+LL |     enum Bar<'a,'b> {
+   |              ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 23:17
+  --> $DIR/regions-outlives-nominal-type-enum-region.rs:23:17
+   |
+LL |     enum Bar<'a,'b> {
+   |                 ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
index 4941b568fc6c97ef6a628b98d8a4f6b5ce5f8c54..cc294651db773cc91b5c44abfe268f89526f2a73 100644 (file)
 //
 // Rule OutlivesNominalType from RFC 1214.
 
-//compile-pass
-
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
-mod variant_struct_type {
+mod rev_variant_struct_type {
     struct Foo<T> {
         x: fn(T)
     }
     enum Bar<'a,'b> {
-        V(&'a Foo<&'b i32>)
+        V(&'a Foo<&'b i32>) //~ ERROR reference has a longer lifetime
     }
 }
 
+#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.stderr b/src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.stderr
new file mode 100644 (file)
index 0000000..8636b89
--- /dev/null
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a rev_variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-outlives-nominal-type-enum-type-rev.rs:24:11
+   |
+LL |         V(&'a Foo<&'b i32>) //~ ERROR reference has a longer lifetime
+   |           ^^^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the enum at 23:14
+  --> $DIR/regions-outlives-nominal-type-enum-type-rev.rs:23:14
+   |
+LL |     enum Bar<'a,'b> {
+   |              ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 23:17
+  --> $DIR/regions-outlives-nominal-type-enum-type-rev.rs:23:17
+   |
+LL |     enum Bar<'a,'b> {
+   |                 ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
index 38eb0c97a47dea6967a38579070ccd7af2d99e84..e269767cc1683a817feb16692387077aa5fcf532 100644 (file)
@@ -13,8 +13,6 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
-// compile-pass
-
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -23,8 +21,9 @@ mod variant_struct_type {
         x: T
     }
     enum Bar<'a,'b> {
-        V(&'a Foo<&'b i32>)
+        F(&'a Foo<&'b i32>) //~ ERROR reference has a longer lifetime
     }
 }
 
+#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-type.stderr b/src/test/ui/regions/regions-outlives-nominal-type-enum-type.stderr
new file mode 100644 (file)
index 0000000..c209547
--- /dev/null
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-outlives-nominal-type-enum-type.rs:24:11
+   |
+LL |         F(&'a Foo<&'b i32>) //~ ERROR reference has a longer lifetime
+   |           ^^^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the enum at 23:14
+  --> $DIR/regions-outlives-nominal-type-enum-type.rs:23:14
+   |
+LL |     enum Bar<'a,'b> {
+   |              ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 23:17
+  --> $DIR/regions-outlives-nominal-type-enum-type.rs:23:17
+   |
+LL |     enum Bar<'a,'b> {
+   |                 ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
index 50febdd45797ee8a27476237391f24f397a005a8..c7e6ace8b9224165050e505bbb6c603ebe2e02e4 100644 (file)
@@ -13,8 +13,6 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
-// compile-pass
-
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -23,8 +21,9 @@ mod rev_variant_struct_region {
         x: fn(&'a i32),
     }
     struct Bar<'a,'b> {
-        f: &'a Foo<'b>
+        f: &'a Foo<'b> //~ ERROR reference has a longer lifetime
     }
 }
 
+#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.stderr b/src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.stderr
new file mode 100644 (file)
index 0000000..48980bd
--- /dev/null
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a rev_variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-outlives-nominal-type-struct-region-rev.rs:24:9
+   |
+LL |         f: &'a Foo<'b> //~ ERROR reference has a longer lifetime
+   |         ^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the struct at 23:16
+  --> $DIR/regions-outlives-nominal-type-struct-region-rev.rs:23:16
+   |
+LL |     struct Bar<'a,'b> {
+   |                ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 23:19
+  --> $DIR/regions-outlives-nominal-type-struct-region-rev.rs:23:19
+   |
+LL |     struct Bar<'a,'b> {
+   |                   ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
index ea07fb4104be160cc6c49fc465e06cd7ffcd03d8..2fe6444c33aecd1d060c68c22b280fd99f63f54e 100644 (file)
@@ -13,8 +13,6 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
-// compile-pass
-
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -27,4 +25,5 @@ mod variant_struct_region {
     }
 }
 
+#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-region.stderr b/src/test/ui/regions/regions-outlives-nominal-type-struct-region.stderr
new file mode 100644 (file)
index 0000000..e2b3288
--- /dev/null
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-outlives-nominal-type-struct-region.rs:24:9
+   |
+LL |         f: &'a Foo<'b> //~ ERROR reference has a longer lifetime
+   |         ^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the struct at 23:16
+  --> $DIR/regions-outlives-nominal-type-struct-region.rs:23:16
+   |
+LL |     struct Bar<'a,'b> {
+   |                ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 23:19
+  --> $DIR/regions-outlives-nominal-type-struct-region.rs:23:19
+   |
+LL |     struct Bar<'a,'b> {
+   |                   ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
index 735037ac2f6d4a9b507e69d80169723d0729e31b..c4b631bce98740d191b6ec3411c516075cd910b3 100644 (file)
@@ -13,8 +13,6 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
-// compile-pass
-
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -27,4 +25,5 @@ mod rev_variant_struct_type {
     }
 }
 
+#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.stderr b/src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.stderr
new file mode 100644 (file)
index 0000000..2bf04ff
--- /dev/null
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a rev_variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-outlives-nominal-type-struct-type-rev.rs:24:9
+   |
+LL |         f: &'a Foo<&'b i32> //~ ERROR reference has a longer lifetime
+   |         ^^^^^^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the struct at 23:16
+  --> $DIR/regions-outlives-nominal-type-struct-type-rev.rs:23:16
+   |
+LL |     struct Bar<'a,'b> {
+   |                ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 23:19
+  --> $DIR/regions-outlives-nominal-type-struct-type-rev.rs:23:19
+   |
+LL |     struct Bar<'a,'b> {
+   |                   ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
index dfd3583ce6cab95016749f98650f596183024bef..1c9489444a6a3a70bdc8a78ed0d6f3dfaba702ee 100644 (file)
@@ -13,8 +13,6 @@
 //
 // Rule OutlivesNominalType from RFC 1214.
 
-// compile-pass
-
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
@@ -27,4 +25,5 @@ mod variant_struct_type {
     }
 }
 
+#[rustc_error]
 fn main() { }
diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-type.stderr b/src/test/ui/regions/regions-outlives-nominal-type-struct-type.stderr
new file mode 100644 (file)
index 0000000..af9f1d3
--- /dev/null
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-outlives-nominal-type-struct-type.rs:24:9
+   |
+LL |         f: &'a Foo<&'b i32> //~ ERROR reference has a longer lifetime
+   |         ^^^^^^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the struct at 23:16
+  --> $DIR/regions-outlives-nominal-type-struct-type.rs:23:16
+   |
+LL |     struct Bar<'a,'b> {
+   |                ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 23:19
+  --> $DIR/regions-outlives-nominal-type-struct-type.rs:23:19
+   |
+LL |     struct Bar<'a,'b> {
+   |                   ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/regions/regions-struct-not-wf.lexical.stderr b/src/test/ui/regions/regions-struct-not-wf.lexical.stderr
new file mode 100644 (file)
index 0000000..9433b8b
--- /dev/null
@@ -0,0 +1,49 @@
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/regions-struct-not-wf.rs:19:5
+   |
+LL | struct Ref<'a, T> {
+   |                - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     field: &'a T
+   |     ^^^^^^^^^^^^
+   |
+note: ...so that the reference type `&'a T` does not outlive the data it points at
+  --> $DIR/regions-struct-not-wf.rs:19:5
+   |
+LL |     field: &'a T
+   |     ^^^^^^^^^^^^
+
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/regions-struct-not-wf.rs:29:5
+   |
+LL | struct RefIndirect<'a, T> {
+   |                        - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     field: RefOk<'a, T>
+   |     ^^^^^^^^^^^^^^^^^^^
+   |
+note: ...so that the type `T` will meet its required lifetime bounds
+  --> $DIR/regions-struct-not-wf.rs:29:5
+   |
+LL |     field: RefOk<'a, T>
+   |     ^^^^^^^^^^^^^^^^^^^
+
+error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-struct-not-wf.rs:35:5
+   |
+LL |     field: &'a &'b T
+   |     ^^^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the struct at 34:18
+  --> $DIR/regions-struct-not-wf.rs:34:18
+   |
+LL | struct DoubleRef<'a, 'b, T> {
+   |                  ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 34:22
+  --> $DIR/regions-struct-not-wf.rs:34:22
+   |
+LL | struct DoubleRef<'a, 'b, T> {
+   |                      ^^
+
+error: aborting due to 3 previous errors
+
+Some errors occurred: E0309, E0491.
+For more information about an error, try `rustc --explain E0309`.
diff --git a/src/test/ui/regions/regions-struct-not-wf.nll.stderr b/src/test/ui/regions/regions-struct-not-wf.nll.stderr
new file mode 100644 (file)
index 0000000..9433b8b
--- /dev/null
@@ -0,0 +1,49 @@
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/regions-struct-not-wf.rs:19:5
+   |
+LL | struct Ref<'a, T> {
+   |                - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     field: &'a T
+   |     ^^^^^^^^^^^^
+   |
+note: ...so that the reference type `&'a T` does not outlive the data it points at
+  --> $DIR/regions-struct-not-wf.rs:19:5
+   |
+LL |     field: &'a T
+   |     ^^^^^^^^^^^^
+
+error[E0309]: the parameter type `T` may not live long enough
+  --> $DIR/regions-struct-not-wf.rs:29:5
+   |
+LL | struct RefIndirect<'a, T> {
+   |                        - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     field: RefOk<'a, T>
+   |     ^^^^^^^^^^^^^^^^^^^
+   |
+note: ...so that the type `T` will meet its required lifetime bounds
+  --> $DIR/regions-struct-not-wf.rs:29:5
+   |
+LL |     field: RefOk<'a, T>
+   |     ^^^^^^^^^^^^^^^^^^^
+
+error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
+  --> $DIR/regions-struct-not-wf.rs:35:5
+   |
+LL |     field: &'a &'b T
+   |     ^^^^^^^^^^^^^^^^
+   |
+note: the pointer is valid for the lifetime 'a as defined on the struct at 34:18
+  --> $DIR/regions-struct-not-wf.rs:34:18
+   |
+LL | struct DoubleRef<'a, 'b, T> {
+   |                  ^^
+note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 34:22
+  --> $DIR/regions-struct-not-wf.rs:34:22
+   |
+LL | struct DoubleRef<'a, 'b, T> {
+   |                      ^^
+
+error: aborting due to 3 previous errors
+
+Some errors occurred: E0309, E0491.
+For more information about an error, try `rustc --explain E0309`.
index bdd708197bc768a497ca5b939b5e34858fca96ef..9106f1f0ba69c87d45c1fa0df87b4ea15405a709 100644 (file)
 
 // Various examples of structs whose fields are not well-formed.
 
-#![allow(dead_code)]
+// revisions:lexical nll
 
-trait Trait<'a, T> {
-    type Out;
-}
-trait Trait1<'a, 'b, T> {
-    type Out;
-}
+#![allow(dead_code)]
+#![cfg_attr(nll, feature(nll))]
 
-impl<'a, T> Trait<'a, T> for usize {
-    type Out = &'a T;
+struct Ref<'a, T> {
+    field: &'a T
+        //[lexical]~^ ERROR the parameter type `T` may not live long enough
+        //[nll]~^^ ERROR the parameter type `T` may not live long enough
 }
 
 struct RefOk<'a, T:'a> {
     field: &'a T
 }
 
-impl<'a, T> Trait<'a, T> for u32 {
-    type Out = RefOk<'a, T>;
+struct RefIndirect<'a, T> {
+    field: RefOk<'a, T>
+        //[lexical]~^ ERROR the parameter type `T` may not live long enough
+        //[nll]~^^ ERROR the parameter type `T` may not live long enough
 }
 
-impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
-    type Out = &'a &'b T;
+struct DoubleRef<'a, 'b, T> {
+    field: &'a &'b T
+        //[lexical]~^ ERROR reference has a longer lifetime than the data it references
+        //[nll]~^^ ERROR reference has a longer lifetime than the data it references
 }
 
 fn main() { }
diff --git a/src/test/ui/regions/regions-struct-not-wf.stderr b/src/test/ui/regions/regions-struct-not-wf.stderr
deleted file mode 100644 (file)
index d8c8b6c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-struct-not-wf.rs:23:5
-   |
-LL | impl<'a, T> Trait<'a, T> for usize {
-   |          - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     type Out = &'a T;
-   |     ^^^^^^^^^^^^^^^^^
-   |
-note: ...so that the reference type `&'a T` does not outlive the data it points at
-  --> $DIR/regions-struct-not-wf.rs:23:5
-   |
-LL |     type Out = &'a T;
-   |     ^^^^^^^^^^^^^^^^^
-
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-struct-not-wf.rs:31:5
-   |
-LL | impl<'a, T> Trait<'a, T> for u32 {
-   |          - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     type Out = RefOk<'a, T>;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/regions-struct-not-wf.rs:31:5
-   |
-LL |     type Out = RefOk<'a, T>;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-struct-not-wf.rs:35:5
-   |
-LL |     type Out = &'a &'b T;
-   |     ^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the impl at 34:6
-  --> $DIR/regions-struct-not-wf.rs:34:6
-   |
-LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
-   |      ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 34:10
-  --> $DIR/regions-struct-not-wf.rs:34:10
-   |
-LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
-   |          ^^
-
-error: aborting due to 3 previous errors
-
-Some errors occurred: E0309, E0491.
-For more information about an error, try `rustc --explain E0309`.
index cc659cd14b1a1c5328a228ff3063d922e66cea76..016739978834b0c9558a94374073ba311f0c8aef 100644 (file)
@@ -9,9 +9,10 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
-struct Foo<'a, T> { //~ ERROR 14:1: 16:2: rustc_outlives
+struct Foo<'a, T> { //~ ERROR 15:1: 17:2: rustc_outlives
     bar: std::slice::IterMut<'a, T>
 }
 
index dd00c14ea16f2d3157b41ad29a3f8452f3303e12..a90643ae8916be2a7d27772495ef7555af2064aa 100644 (file)
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/cross-crate.rs:14:1
+  --> $DIR/cross-crate.rs:15:1
    |
-LL | / struct Foo<'a, T> { //~ ERROR 14:1: 16:2: rustc_outlives
+LL | / struct Foo<'a, T> { //~ ERROR 15:1: 17:2: rustc_outlives
 LL | |     bar: std::slice::IterMut<'a, T>
 LL | | }
    | |_^
index 47dc5dfdc96e6f0a8bd421ae90fdb2ff5b1b977b..72d5127c294dc704cbd32a984e3e8f88a257221c 100644 (file)
@@ -10,6 +10,8 @@
 
 // ignore-tidy-linelength
 
+#![feature(infer_outlives_requirements)]
+
 /*
  * We don't infer `T: 'static` outlives relationships by default.
  * Instead an additional feature gate `infer_static_outlives_requirements`
@@ -17,7 +19,7 @@
  */
 
 struct Foo<U> {
-    bar: Bar<U> //~ ERROR 20:5: 20:16: the parameter type `U` may not live long enough [E0310]
+    bar: Bar<U> //~ ERROR 22:5: 22:16: the parameter type `U` may not live long enough [E0310]
 }
 struct Bar<T: 'static> {
     x: T,
index 5d8cf0aa3245c262378a6210b0b7c814ba4a67a8..775ac215e190df8f8d547a0f4f581cac05ca506e 100644 (file)
@@ -1,15 +1,15 @@
 error[E0310]: the parameter type `U` may not live long enough
-  --> $DIR/dont-infer-static.rs:20:5
+  --> $DIR/dont-infer-static.rs:22:5
    |
 LL | struct Foo<U> {
    |            - help: consider adding an explicit lifetime bound `U: 'static`...
-LL |     bar: Bar<U> //~ ERROR 20:5: 20:16: the parameter type `U` may not live long enough [E0310]
+LL |     bar: Bar<U> //~ ERROR 22:5: 22:16: the parameter type `U` may not live long enough [E0310]
    |     ^^^^^^^^^^^
    |
 note: ...so that the type `U` will meet its required lifetime bounds
-  --> $DIR/dont-infer-static.rs:20:5
+  --> $DIR/dont-infer-static.rs:22:5
    |
-LL |     bar: Bar<U> //~ ERROR 20:5: 20:16: the parameter type `U` may not live long enough [E0310]
+LL |     bar: Bar<U> //~ ERROR 22:5: 22:16: the parameter type `U` may not live long enough [E0310]
    |     ^^^^^^^^^^^
 
 error: aborting due to previous error
index b2c18b274ce013331cb1c94da4cc68fadb730fa2..5071465b5f647569c5c5e754601658179bb411fe 100644 (file)
 
 // ignore-tidy-linelength
 
-#![feature(rustc_attrs)]
-
 // Needs an explicit where clause stating outlives condition. (RFC 2093)
 
 // Type T needs to outlive lifetime 'a.
-#[rustc_outlives]
-enum Foo<'a, T> { //~ ERROR rustc_outlives
+enum Foo<'a, T> {
+
     One(Bar<'a, T>)
 }
 
 // Type U needs to outlive lifetime 'b
-#[rustc_outlives]
-struct Bar<'b, U> { //~ ERROR rustc_outlives
-    field2: &'b U
+struct Bar<'b, U> {
+    field2: &'b U //~ ERROR the parameter type `U` may not live long enough [E0309]
 }
 
+
+
 // Type K needs to outlive lifetime 'c.
-#[rustc_outlives]
-enum Ying<'c, K> { //~ ERROR rustc_outlives
-    One(&'c Yang<K>)
+enum Ying<'c, K> {
+    One(&'c Yang<K>) //~ ERROR the parameter type `K` may not live long enough [E0309]
 }
 
 struct Yang<V> {
index e621c435eea35a5301aebf23c46330fbe9eb5e2b..604dd0b43c04a775346316858a92a415f0fbd987 100644 (file)
@@ -1,32 +1,31 @@
-error: rustc_outlives
-  --> $DIR/enum.rs:19:1
+error[E0309]: the parameter type `U` may not live long enough
+  --> $DIR/enum.rs:23:5
    |
-LL | / enum Foo<'a, T> { //~ ERROR rustc_outlives
-LL | |     One(Bar<'a, T>)
-LL | | }
-   | |_^
+LL | struct Bar<'b, U> {
+   |                - help: consider adding an explicit lifetime bound `U: 'b`...
+LL |     field2: &'b U //~ ERROR the parameter type `U` may not live long enough [E0309]
+   |     ^^^^^^^^^^^^^
    |
-   = note: T : 'a
-
-error: rustc_outlives
-  --> $DIR/enum.rs:25:1
-   |
-LL | / struct Bar<'b, U> { //~ ERROR rustc_outlives
-LL | |     field2: &'b U
-LL | | }
-   | |_^
+note: ...so that the reference type `&'b U` does not outlive the data it points at
+  --> $DIR/enum.rs:23:5
    |
-   = note: U : 'b
+LL |     field2: &'b U //~ ERROR the parameter type `U` may not live long enough [E0309]
+   |     ^^^^^^^^^^^^^
 
-error: rustc_outlives
-  --> $DIR/enum.rs:31:1
+error[E0309]: the parameter type `K` may not live long enough
+  --> $DIR/enum.rs:30:9
+   |
+LL | enum Ying<'c, K> {
+   |               - help: consider adding an explicit lifetime bound `K: 'c`...
+LL |     One(&'c Yang<K>) //~ ERROR the parameter type `K` may not live long enough [E0309]
+   |         ^^^^^^^^^^^
    |
-LL | / enum Ying<'c, K> { //~ ERROR rustc_outlives
-LL | |     One(&'c Yang<K>)
-LL | | }
-   | |_^
+note: ...so that the reference type `&'c Yang<K>` does not outlive the data it points at
+  --> $DIR/enum.rs:30:9
    |
-   = note: K : 'c
+LL |     One(&'c Yang<K>) //~ ERROR the parameter type `K` may not live long enough [E0309]
+   |         ^^^^^^^^^^^
 
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
+For more information about this error, try `rustc --explain E0309`.
index 9264259520952055409cded862356bc82416fe38..445c246a1206726243a59690964e163e40bf486c 100644 (file)
 
 #![feature(dyn_trait)]
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 
 trait Trait<'x, T> where T: 'x {
 }
 
 #[rustc_outlives]
-struct Foo<'a, A> //~ ERROR 18:1: 21:2: rustc_outlives
+struct Foo<'a, A> //~ ERROR 19:1: 22:2: rustc_outlives
 {
     foo: Box<dyn Trait<'a, A>>
 }
index 5d167493308fd431aeec1f5ad4c60efd9c922136..4bb5d90e9644ec30ff553243626d1e18a8930ad5 100644 (file)
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/explicit-dyn.rs:18:1
+  --> $DIR/explicit-dyn.rs:19:1
    |
-LL | / struct Foo<'a, A> //~ ERROR 18:1: 21:2: rustc_outlives
+LL | / struct Foo<'a, A> //~ ERROR 19:1: 22:2: rustc_outlives
 LL | | {
 LL | |     foo: Box<dyn Trait<'a, A>>
 LL | | }
index 0ac75fc255601287f07f65387a514fdddd8a1141..e85b49bb0bf2391caefc237a67aa53f2057cb018 100644 (file)
@@ -9,9 +9,10 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
-enum Foo<'a, U> { //~ ERROR 14:1: 16:2: rustc_outlives
+enum Foo<'a, U> { //~ ERROR 15:1: 17:2: rustc_outlives
     One(Bar<'a, U>)
 }
 
index 33ef4b7e6a1080d01f300cde271218da7fc12f00..d7438758d77af350e60a16b4ec954322aec6f747 100644 (file)
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/explicit-enum.rs:14:1
+  --> $DIR/explicit-enum.rs:15:1
    |
-LL | / enum Foo<'a, U> { //~ ERROR 14:1: 16:2: rustc_outlives
+LL | / enum Foo<'a, U> { //~ ERROR 15:1: 17:2: rustc_outlives
 LL | |     One(Bar<'a, U>)
 LL | | }
    | |_^
index 02c171627e6f03bf227b33fa8404346cd770b342..2662043c36d59c9e01a461a9d712fc78bd2e10f5 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 
 trait Trait<'x, T> where T: 'x {
     type Type;
index 5480130c2d3f17cc001d9612b12d27191679b354..43ab02d01ed57293862b3a099219bd22b60fe641 100644 (file)
@@ -1,5 +1,5 @@
 error: rustc_outlives
-  --> $DIR/explicit-projection.rs:18:1
+  --> $DIR/explicit-projection.rs:19:1
    |
 LL | / struct Foo<'a, A, B> where A: Trait<'a, B> //~ ERROR rustc_outlives
 LL | | {
index 4dc01a5221006e3e338d0594dead0b32de85507c..d42c9160e1e751c554906ab989f29ee66a7e5fc4 100644 (file)
@@ -9,9 +9,10 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
-struct Foo<'b, U> { //~ ERROR 14:1: 16:2: rustc_outlives
+struct Foo<'b, U> { //~ ERROR 15:1: 17:2: rustc_outlives
     bar: Bar<'b, U>
 }
 
index 7655dec5cb851ff739c9dd9dde9a8a8617806fb6..0223f707e8d9bc449059eba59ae23e177af0e67d 100644 (file)
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/explicit-struct.rs:14:1
+  --> $DIR/explicit-struct.rs:15:1
    |
-LL | / struct Foo<'b, U> { //~ ERROR 14:1: 16:2: rustc_outlives
+LL | / struct Foo<'b, U> { //~ ERROR 15:1: 17:2: rustc_outlives
 LL | |     bar: Bar<'b, U>
 LL | | }
    | |_^
index ae4b9b15f683bfae216149c81250a5ffa7d51e08..e548b24719383cb0697a5a50278922205408b845 100644 (file)
@@ -9,11 +9,13 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 #![feature(untagged_unions)]
 #![allow(unions_with_drop_fields)]
 
+
 #[rustc_outlives]
-union Foo<'b, U> { //~ ERROR 16:1: 18:2: rustc_outlives
+union Foo<'b, U> { //~ ERROR 18:1: 20:2: rustc_outlives
     bar: Bar<'b, U>
 }
 
index c01c7532c86247d4051de54b37c1ea4d59c8305d..8622ae12aa10cb95a63cfabb6f20276e964540fa 100644 (file)
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/explicit-union.rs:16:1
+  --> $DIR/explicit-union.rs:18:1
    |
-LL | / union Foo<'b, U> { //~ ERROR 16:1: 18:2: rustc_outlives
+LL | / union Foo<'b, U> { //~ ERROR 18:1: 20:2: rustc_outlives
 LL | |     bar: Bar<'b, U>
 LL | | }
    | |_^
index c4407b8b89f24a8eb953df006ab09af7aadc3461..aeca18c24b3db211e22aaff9ecdd446a6e515f56 100644 (file)
@@ -9,10 +9,11 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 #![feature(infer_static_outlives_requirements)]
 
 #[rustc_outlives]
-struct Foo<U> { //~ ERROR 15:1: 17:2: rustc_outlives
+struct Foo<U> { //~ ERROR 16:1: 18:2: rustc_outlives
     bar: Bar<U>
 }
 struct Bar<T: 'static> {
index 0cb4f3faa335264c3641c2f2af7f271628714139..f167e522df650a29f62c53395af769be864e6997 100644 (file)
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/infer-static.rs:15:1
+  --> $DIR/infer-static.rs:16:1
    |
-LL | / struct Foo<U> { //~ ERROR 15:1: 17:2: rustc_outlives
+LL | / struct Foo<U> { //~ ERROR 16:1: 18:2: rustc_outlives
 LL | |     bar: Bar<U>
 LL | | }
    | |_^
index 5cb365b7a7bbf703f5487c3c0feba6c04e040b91..85f381ea515c33e93b4a90274b04b34334aacd69 100644 (file)
@@ -9,9 +9,11 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
+
 
 #[rustc_outlives]
-enum Foo<'a, T> { //~ ERROR 14:1: 17:2: rustc_outlives
+enum Foo<'a, T> { //~ ERROR 16:1: 19:2: rustc_outlives
 
     One(Bar<'a, T>)
 }
index f0a6905d14bdda31fcf14c47947b3d1a2b3203e0..54a886a92fd409d3d47624bac3e1c5ac56fbb401 100644 (file)
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/nested-enum.rs:14:1
+  --> $DIR/nested-enum.rs:16:1
    |
-LL | / enum Foo<'a, T> { //~ ERROR 14:1: 17:2: rustc_outlives
+LL | / enum Foo<'a, T> { //~ ERROR 16:1: 19:2: rustc_outlives
 LL | |
 LL | |     One(Bar<'a, T>)
 LL | | }
index e56d7d7a053b17363fbdad46520b54ec439ccad7..792d2a02962dcc54e01f8e69a228a0c3e779b219 100644 (file)
@@ -9,9 +9,10 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
-struct Foo<'a, 'b, T> { //~ ERROR 14:1: 16:2: rustc_outlives
+struct Foo<'a, 'b, T> { //~ ERROR 15:1: 17:2: rustc_outlives
     x: &'a &'b T
 }
 
index 978fe352bc750b463dbb11c2cd6811a8c3cbcad2..04fe4814a0415fb800a682a2c1c490d0d6a8ec87 100644 (file)
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/nested-regions.rs:14:1
+  --> $DIR/nested-regions.rs:15:1
    |
-LL | / struct Foo<'a, 'b, T> { //~ ERROR 14:1: 16:2: rustc_outlives
+LL | / struct Foo<'a, 'b, T> { //~ ERROR 15:1: 17:2: rustc_outlives
 LL | |     x: &'a &'b T
 LL | | }
    | |_^
index 84d1b88188003c6296719d65524413e218445b2a..71a36dfb344233b048c8f985fb98e3f813891b97 100644 (file)
@@ -9,9 +9,10 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
-struct Foo<'a, T> { //~ ERROR 14:1: 16:2: rustc_outlives
+struct Foo<'a, T> { //~ ERROR 15:1: 17:2: rustc_outlives
     field1: Bar<'a, T>
 }
 
index db02232b9130ba02e0170e59ea89227ce77dbe0e..abea71f2d12fcf77dfc556b7af27f45c90f128dc 100644 (file)
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/nested-structs.rs:14:1
+  --> $DIR/nested-structs.rs:15:1
    |
-LL | / struct Foo<'a, T> { //~ ERROR 14:1: 16:2: rustc_outlives
+LL | / struct Foo<'a, T> { //~ ERROR 15:1: 17:2: rustc_outlives
 LL | |     field1: Bar<'a, T>
 LL | | }
    | |_^
index 974675f51c711191969a81f7f52f01ad4d2e1442..0720e581e2c5b8783df95b3e3f2ec0d642abec7e 100644 (file)
@@ -9,11 +9,13 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 #![feature(untagged_unions)]
 #![allow(unions_with_drop_fields)]
 
+
 #[rustc_outlives]
-union Foo<'a, T> { //~ ERROR 16:1: 18:2: rustc_outlives
+union Foo<'a, T> { //~ ERROR 18:1: 20:2: rustc_outlives
     field1: Bar<'a, T>
 }
 
index 2704a1d2def779c50e6b3fb626076d6ce5020b2e..b7b50c1506146a0e80401a886dd09a86b2af304f 100644 (file)
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/nested-union.rs:16:1
+  --> $DIR/nested-union.rs:18:1
    |
-LL | / union Foo<'a, T> { //~ ERROR 16:1: 18:2: rustc_outlives
+LL | / union Foo<'a, T> { //~ ERROR 18:1: 20:2: rustc_outlives
 LL | |     field1: Bar<'a, T>
 LL | | }
    | |_^
diff --git a/src/test/ui/rfc-2093-infer-outlives/privacy.rs b/src/test/ui/rfc-2093-infer-outlives/privacy.rs
deleted file mode 100644 (file)
index 180f5ac..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Test that we do not get a privacy error here.  Initially, we did,
-// because we inferred an outlives predciate of `<Foo<'a> as
-// Private>::Out: 'a`, but the private trait is -- well -- private,
-// and hence it was not something that a pub trait could refer to.
-//
-// run-pass
-
-#![allow(dead_code)]
-
-pub struct Foo<'a> {
-    field: Option<&'a <Foo<'a> as Private>::Out>
-}
-
-trait Private {
-    type Out: ?Sized;
-}
-
-impl<T: ?Sized> Private for T { type Out = Self; }
-
-fn main() { }
index 7693d0e9401d2594390565e2928c26a9052cb89a..3abce873b28f9967d2f05ce3ca77aaed734a44ad 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
 struct Foo<'a, T: Iterator> { //~ ERROR rustc_outlives
index fb4835ae2d8bf2cb408a088e7b7ebc0a7559a400..dfaf7793a51f26f23e684825739580d272eb285c 100644 (file)
@@ -1,5 +1,5 @@
 error: rustc_outlives
-  --> $DIR/projection.rs:14:1
+  --> $DIR/projection.rs:15:1
    |
 LL | / struct Foo<'a, T: Iterator> { //~ ERROR rustc_outlives
 LL | |     bar: &'a T::Item
index 760d9889bbe76989285c9bc8623028c01c50fbcc..56b1bc3c7d11ee0999247b209389cf33246db5c3 100644 (file)
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
 struct Foo<'a, T> { //~ ERROR rustc_outlives
index fdd312f9b89c5f8bc34177fd8def3e2e6238ca9f..785d76e8f22756c49da849289424f6fa281a7a0c 100644 (file)
@@ -1,5 +1,5 @@
 error: rustc_outlives
-  --> $DIR/reference.rs:14:1
+  --> $DIR/reference.rs:15:1
    |
 LL | / struct Foo<'a, T> { //~ ERROR rustc_outlives
 LL | |     bar: &'a T,
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs
deleted file mode 100644 (file)
index a2d3cf6..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2014 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.
-
-// ignore-tidy-linelength
-
-// Various examples of structs whose fields are not well-formed.
-
-#![allow(dead_code)]
-
-trait Dummy<'a> {
-  type Out;
-}
-impl<'a, T> Dummy<'a> for T
-where T: 'a
-{
-  type Out = ();
-}
-type RequireOutlives<'a, T> = <T as Dummy<'a>>::Out;
-
-enum Ref1<'a, T> {
-    Ref1Variant1(RequireOutlives<'a, T>) //~ ERROR the parameter type `T` may not live long enough
-}
-
-enum Ref2<'a, T> {
-    Ref2Variant1,
-    Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough
-}
-
-enum RefOk<'a, T:'a> {
-    RefOkVariant1(&'a T)
-}
-
-// This is now well formed. RFC 2093
-enum RefIndirect<'a, T> {
-    RefIndirectVariant1(isize, RefOk<'a,T>)
-}
-
-enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
-    RefDoubleVariant1(&'a RequireOutlives<'b, T>)
-        //~^ 46:23: 46:49: the parameter type `T` may not live long enough [E0309]
-}
-
-fn main() { }
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr
deleted file mode 100644 (file)
index 923ea17..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-enum-not-wf.rs:28:18
-   |
-LL | enum Ref1<'a, T> {
-   |               - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     Ref1Variant1(RequireOutlives<'a, T>) //~ ERROR the parameter type `T` may not live long enough
-   |                  ^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/regions-enum-not-wf.rs:28:18
-   |
-LL |     Ref1Variant1(RequireOutlives<'a, T>) //~ ERROR the parameter type `T` may not live long enough
-   |                  ^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-enum-not-wf.rs:33:25
-   |
-LL | enum Ref2<'a, T> {
-   |               - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     Ref2Variant1,
-LL |     Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough
-   |                         ^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/regions-enum-not-wf.rs:33:25
-   |
-LL |     Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough
-   |                         ^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-enum-not-wf.rs:45:1
-   |
-LL |   enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
-   |   ^                      - help: consider adding an explicit lifetime bound `T: 'b`...
-   |  _|
-   | |
-LL | |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
-LL | |         //~^ 46:23: 46:49: the parameter type `T` may not live long enough [E0309]
-LL | | }
-   | |_^
-   |
-note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/regions-enum-not-wf.rs:45:1
-   |
-LL | / enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
-LL | |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
-LL | |         //~^ 46:23: 46:49: the parameter type `T` may not live long enough [E0309]
-LL | | }
-   | |_^
-
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-enum-not-wf.rs:46:23
-   |
-LL | enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
-   |                        - help: consider adding an explicit lifetime bound `T: 'b`...
-LL |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/regions-enum-not-wf.rs:46:23
-   |
-LL |     RefDoubleVariant1(&'a RequireOutlives<'b, T>)
-   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs
deleted file mode 100644 (file)
index 44af621..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2014 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.
-
-// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
-// arguments (like `'a`) outlive `'b`.
-//
-// Rule OutlivesNominalType from RFC 1214.
-
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-
-mod rev_variant_struct_region {
-    struct Foo<'a> {
-        x: fn(&'a i32),
-    }
-    trait Trait<'a, 'b> {
-        type Out;
-    }
-    impl<'a, 'b> Trait<'a, 'b> for usize {
-        type Out = &'a Foo<'b>; //~ ERROR reference has a longer lifetime
-    }
-}
-
-#[rustc_error]
-fn main() { }
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr
deleted file mode 100644 (file)
index bd4682f..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a rev_variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-nominal-type-region-rev.rs:27:9
-   |
-LL |         type Out = &'a Foo<'b>; //~ ERROR reference has a longer lifetime
-   |         ^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the impl at 26:10
-  --> $DIR/regions-outlives-nominal-type-region-rev.rs:26:10
-   |
-LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
-   |          ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 26:14
-  --> $DIR/regions-outlives-nominal-type-region-rev.rs:26:14
-   |
-LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
-   |              ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs
deleted file mode 100644 (file)
index 93f1635..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2014 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.
-
-// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
-// arguments (like `'a`) outlive `'b`.
-//
-// Rule OutlivesNominalType from RFC 1214.
-
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-
-mod variant_struct_region {
-    struct Foo<'a> {
-        x: &'a i32,
-    }
-    trait Trait<'a, 'b> {
-        type Out;
-    }
-    impl<'a, 'b> Trait<'a, 'b> for usize {
-        type Out = &'a Foo<'b>; //~ ERROR reference has a longer lifetime
-    }
-}
-
-#[rustc_error]
-fn main() { }
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr
deleted file mode 100644 (file)
index 3fdfb67..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-nominal-type-region.rs:27:9
-   |
-LL |         type Out = &'a Foo<'b>; //~ ERROR reference has a longer lifetime
-   |         ^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the impl at 26:10
-  --> $DIR/regions-outlives-nominal-type-region.rs:26:10
-   |
-LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
-   |          ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 26:14
-  --> $DIR/regions-outlives-nominal-type-region.rs:26:14
-   |
-LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
-   |              ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs
deleted file mode 100644 (file)
index e44e049..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2014 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.
-
-// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
-// arguments (like `'a`) outlive `'b`.
-//
-// Rule OutlivesNominalType from RFC 1214.
-
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-
-mod variant_struct_type {
-    struct Foo<T> {
-        x: fn(T)
-    }
-    trait Trait<'a, 'b> {
-        type Out;
-    }
-    impl<'a, 'b> Trait<'a, 'b> for usize {
-        type Out = &'a Foo<&'b i32>; //~ ERROR reference has a longer lifetime
-    }
-}
-
-#[rustc_error]
-fn main() { }
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr
deleted file mode 100644 (file)
index 166e95c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-nominal-type-type-rev.rs:27:9
-   |
-LL |         type Out = &'a Foo<&'b i32>; //~ ERROR reference has a longer lifetime
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the impl at 26:10
-  --> $DIR/regions-outlives-nominal-type-type-rev.rs:26:10
-   |
-LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
-   |          ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 26:14
-  --> $DIR/regions-outlives-nominal-type-type-rev.rs:26:14
-   |
-LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
-   |              ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs
deleted file mode 100644 (file)
index 1293e6c..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2014 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.
-
-// Test that a nominal type (like `Foo<'a>`) outlives `'b` if its
-// arguments (like `'a`) outlive `'b`.
-//
-// Rule OutlivesNominalType from RFC 1214.
-
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-
-mod variant_struct_type {
-    struct Foo<T> {
-        x: T
-    }
-    trait Trait<'a, 'b> {
-        type Out;
-    }
-    impl<'a, 'b> Trait<'a, 'b> for usize {
-        type Out = &'a Foo<&'b i32>; //~ ERROR reference has a longer lifetime
-    }
-}
-
-#[rustc_error]
-fn main() { }
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr
deleted file mode 100644 (file)
index 54952ec..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0491]: in type `&'a variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-outlives-nominal-type-type.rs:27:9
-   |
-LL |         type Out = &'a Foo<&'b i32>; //~ ERROR reference has a longer lifetime
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the impl at 26:10
-  --> $DIR/regions-outlives-nominal-type-type.rs:26:10
-   |
-LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
-   |          ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 26:14
-  --> $DIR/regions-outlives-nominal-type-type.rs:26:14
-   |
-LL |     impl<'a, 'b> Trait<'a, 'b> for usize {
-   |              ^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs b/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs
deleted file mode 100644 (file)
index bdd7081..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2014 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.
-
-// Various examples of structs whose fields are not well-formed.
-
-#![allow(dead_code)]
-
-trait Trait<'a, T> {
-    type Out;
-}
-trait Trait1<'a, 'b, T> {
-    type Out;
-}
-
-impl<'a, T> Trait<'a, T> for usize {
-    type Out = &'a T;
-}
-
-struct RefOk<'a, T:'a> {
-    field: &'a T
-}
-
-impl<'a, T> Trait<'a, T> for u32 {
-    type Out = RefOk<'a, T>;
-}
-
-impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
-    type Out = &'a &'b T;
-}
-
-fn main() { }
diff --git a/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr b/src/test/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr
deleted file mode 100644 (file)
index d8c8b6c..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-struct-not-wf.rs:23:5
-   |
-LL | impl<'a, T> Trait<'a, T> for usize {
-   |          - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     type Out = &'a T;
-   |     ^^^^^^^^^^^^^^^^^
-   |
-note: ...so that the reference type `&'a T` does not outlive the data it points at
-  --> $DIR/regions-struct-not-wf.rs:23:5
-   |
-LL |     type Out = &'a T;
-   |     ^^^^^^^^^^^^^^^^^
-
-error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/regions-struct-not-wf.rs:31:5
-   |
-LL | impl<'a, T> Trait<'a, T> for u32 {
-   |          - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     type Out = RefOk<'a, T>;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: ...so that the type `T` will meet its required lifetime bounds
-  --> $DIR/regions-struct-not-wf.rs:31:5
-   |
-LL |     type Out = RefOk<'a, T>;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
-  --> $DIR/regions-struct-not-wf.rs:35:5
-   |
-LL |     type Out = &'a &'b T;
-   |     ^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the pointer is valid for the lifetime 'a as defined on the impl at 34:6
-  --> $DIR/regions-struct-not-wf.rs:34:6
-   |
-LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
-   |      ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the impl at 34:10
-  --> $DIR/regions-struct-not-wf.rs:34:10
-   |
-LL | impl<'a, 'b, T> Trait1<'a, 'b, T> for u32 {
-   |          ^^
-
-error: aborting due to 3 previous errors
-
-Some errors occurred: E0309, E0491.
-For more information about an error, try `rustc --explain E0309`.
index 37c468f2f83101c4f660cd15d5c2fb9b2b48ba00..a19bcf8afff9a8d35fad799e6ad81745c0ac505c 100644 (file)
 
 #![feature(dyn_trait)]
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 
 trait Trait<'x, 's, T> where T: 'x,
       's: {
 }
 
 #[rustc_outlives]
-struct Foo<'a, 'b, A> //~ ERROR 19:1: 22:2: rustc_outlives
+struct Foo<'a, 'b, A> //~ ERROR 20:1: 23:2: rustc_outlives
 {
     foo: Box<dyn Trait<'a, 'b, A>>
 }
index 8c69307ddfb72da571caeb7bfcce80b326f7f2ff..546ba9db6446007a211b060726807b6c898b18d0 100644 (file)
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/self-dyn.rs:19:1
+  --> $DIR/self-dyn.rs:20:1
    |
-LL | / struct Foo<'a, 'b, A> //~ ERROR 19:1: 22:2: rustc_outlives
+LL | / struct Foo<'a, 'b, A> //~ ERROR 20:1: 23:2: rustc_outlives
 LL | | {
 LL | |     foo: Box<dyn Trait<'a, 'b, A>>
 LL | | }
index 82d13d9179a1b7b376d567571292dbe3c8b93233..c4f8f83bdcefd0d77d547d477d568b22c373e267 100644 (file)
@@ -9,9 +9,10 @@
 // except according to those terms.
 
 #![feature(rustc_attrs)]
+#![feature(infer_outlives_requirements)]
 
 #[rustc_outlives]
-struct Foo<'a, 'b, T> { //~ ERROR 14:1: 16:2: rustc_outlives
+struct Foo<'a, 'b, T> { //~ ERROR 15:1: 17:2: rustc_outlives
     field1: Bar<'a, 'b, T>
 }
 
index 541e282f23874f3a4f6b245d456e87c603043f0a..04284577a07467c25052be427031df1afece9ba2 100644 (file)
@@ -1,7 +1,7 @@
 error: rustc_outlives
-  --> $DIR/self-structs.rs:14:1
+  --> $DIR/self-structs.rs:15:1
    |
-LL | / struct Foo<'a, 'b, T> { //~ ERROR 14:1: 16:2: rustc_outlives
+LL | / struct Foo<'a, 'b, T> { //~ ERROR 15:1: 17:2: rustc_outlives
 LL | |     field1: Bar<'a, 'b, T>
 LL | | }
    | |_^
index 8d4219ccf44e4337986a02934afd45d39372b406..8667f0c68762a846e9eadf751e8b4155c7bd0193 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 // run-pass
-// compile-flags: --extern LooksLikeExternCrate=/path/to/nowhere
+// compile-flags: --extern LooksLikeExternCrate
 
 mod m {
     pub struct LooksLikeExternCrate;
diff --git a/src/test/ui/run-pass/non_modrs_mods/non_modrs_mods.rs b/src/test/ui/run-pass/non_modrs_mods/non_modrs_mods.rs
new file mode 100644 (file)
index 0000000..a9b240b
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright 2017 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.
+
+// run-pass
+//
+// ignore-pretty issue #37195
+#![feature(non_modrs_mods)]
+
+pub mod modrs_mod;
+pub mod foors_mod;
+
+#[path = "some_crazy_attr_mod_dir/arbitrary_name.rs"]
+pub mod attr_mod;
+
+pub fn main() {
+    modrs_mod::inner_modrs_mod::innest::foo();
+    modrs_mod::inner_foors_mod::innest::foo();
+    foors_mod::inner_modrs_mod::innest::foo();
+    foors_mod::inner_foors_mod::innest::foo();
+    attr_mod::inner_modrs_mod::innest::foo();
+}
index 9b893f9f15cf5de1036e2ec92c6f010d24c446bf..5d8e84bb82a7770a377a6bc48abb471f0eb4e3b1 100644 (file)
@@ -10,7 +10,7 @@ note: lint level defined here
 LL | #![deny(absolute_paths_not_starting_with_crate)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
   --> $DIR/edition-lint-fully-qualified-paths.rs:34:13
@@ -19,7 +19,7 @@ LL |     let _: <::foo::Baz as foo::Foo>::Bar = ();
    |             ^^^^^^^^^^ help: use `crate`: `crate::foo::Baz`
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: aborting due to 2 previous errors
 
index 439db84045eb984249baad41d22d26dfc377ff2c..5503a0a8f414392a407a9361d394219c046e49d1 100644 (file)
@@ -10,7 +10,7 @@ note: lint level defined here
 LL | #![deny(absolute_paths_not_starting_with_crate)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
   --> $DIR/edition-lint-nested-empty-paths.rs:31:5
@@ -19,7 +19,7 @@ LL | use foo::{bar::{XX, baz::{}}};
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{XX, baz::{}}}`
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
   --> $DIR/edition-lint-nested-empty-paths.rs:35:5
@@ -28,7 +28,7 @@ LL | use foo::{bar::{baz::{}, baz1::{}}};
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{baz::{}, baz1::{}}}`
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: aborting due to 3 previous errors
 
index 333d27c3819278e4dc1064834ad319fa8ab66402..0f8c77aef169be22ec2e3d296298131b152e75b5 100644 (file)
@@ -10,7 +10,7 @@ note: lint level defined here
 LL | #![deny(absolute_paths_not_starting_with_crate)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
   --> $DIR/edition-lint-nested-paths.rs:31:13
@@ -19,7 +19,7 @@ LL |         use foo::{self as x, c};
    |             ^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{self as x, c}`
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: aborting due to 2 previous errors
 
index 37c9041b724c766413bc2617beda883b81967207..9429c946baa09e5dc1af12d475bfe5a7988abc3d 100644 (file)
@@ -10,7 +10,7 @@ note: lint level defined here
 LL | #![deny(absolute_paths_not_starting_with_crate)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
   --> $DIR/edition-lint-paths.rs:28:9
@@ -19,7 +19,7 @@ LL |     use bar;
    |         ^^^ help: use `crate`: `crate::bar`
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
   --> $DIR/edition-lint-paths.rs:33:9
@@ -28,7 +28,7 @@ LL |     use {Bar as SomethingElse, main};
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::{Bar as SomethingElse, main}`
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
   --> $DIR/edition-lint-paths.rs:45:5
@@ -37,7 +37,7 @@ LL | use bar::Bar;
    |     ^^^^^^^^ help: use `crate`: `crate::bar::Bar`
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
   --> $DIR/edition-lint-paths.rs:57:9
@@ -46,7 +46,7 @@ LL |     use *;
    |         ^ help: use `crate`: `crate::*`
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
   --> $DIR/edition-lint-paths.rs:62:6
@@ -55,7 +55,7 @@ LL | impl ::foo::SomeTrait for u32 { }
    |      ^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::SomeTrait`
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
   --> $DIR/edition-lint-paths.rs:67:13
@@ -64,7 +64,7 @@ LL |     let x = ::bar::Bar;
    |             ^^^^^^^^^^ help: use `crate`: `crate::bar::Bar`
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: aborting due to 7 previous errors
 
index d739ad360ed7b399c1618c538dd3c192071cb8a9..0004880e7606487043016a7097edfb28415b2d1b 100644 (file)
@@ -10,7 +10,7 @@ note: lint level defined here
 LL | #![deny(absolute_paths_not_starting_with_crate)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: aborting due to previous error
 
index 17da9feaeab7beae183e8367fa9016e9d30fbe29..4a4652c907e668030b8214a71720b85aceccc571 100644 (file)
@@ -10,7 +10,7 @@ note: lint level defined here
 LL | #![deny(absolute_paths_not_starting_with_crate)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition!
-   = note: for more information, see issue TBD
+   = note: for more information, see issue #53130 <https://github.com/rust-lang/rust/issues/53130>
 
 error: aborting due to previous error
 
index cdae815b200d5d19ea266391697aa446f0a2a7c5..34c7266b637cbcb611dbe99be66e319a36f5e49f 100644 (file)
@@ -14,6 +14,7 @@
 // aux-build:remove-extern-crate.rs
 // compile-flags:--extern remove_extern_crate
 
+#![feature(alloc)]
 #![warn(rust_2018_idioms)]
 
 
@@ -22,11 +23,16 @@ use remove_extern_crate;
 #[macro_use]
 extern crate remove_extern_crate as something_else;
 
+// Shouldn't suggest changing to `use`, as the `alloc`
+// crate is not in the extern prelude - see #54381.
+extern crate alloc;
+
 fn main() {
     another_name::mem::drop(3);
     another::foo();
     remove_extern_crate::foo!();
     bar!();
+    alloc::vec![5];
 }
 
 mod another {
index 4984da802c05bc98dd047a7e5b5a4aa5ae89b573..570bbb02f7218a75fe1220f1861d793e2506125c 100644 (file)
@@ -14,6 +14,7 @@
 // aux-build:remove-extern-crate.rs
 // compile-flags:--extern remove_extern_crate
 
+#![feature(alloc)]
 #![warn(rust_2018_idioms)]
 
 extern crate core;
@@ -22,11 +23,16 @@ use remove_extern_crate;
 #[macro_use]
 extern crate remove_extern_crate as something_else;
 
+// Shouldn't suggest changing to `use`, as the `alloc`
+// crate is not in the extern prelude - see #54381.
+extern crate alloc;
+
 fn main() {
     another_name::mem::drop(3);
     another::foo();
     remove_extern_crate::foo!();
     bar!();
+    alloc::vec![5];
 }
 
 mod another {
index 064a853625f743e7a95d5d9e3fca049fc05e7b23..847ba5f3544b273edb52af7feec5ea9ee34e1b17 100644 (file)
@@ -1,24 +1,24 @@
 warning: unused extern crate
-  --> $DIR/remove-extern-crate.rs:19:1
+  --> $DIR/remove-extern-crate.rs:20:1
    |
 LL | extern crate core;
    | ^^^^^^^^^^^^^^^^^^ help: remove it
    |
 note: lint level defined here
-  --> $DIR/remove-extern-crate.rs:17:9
+  --> $DIR/remove-extern-crate.rs:18:9
    |
 LL | #![warn(rust_2018_idioms)]
    |         ^^^^^^^^^^^^^^^^
    = note: #[warn(unused_extern_crates)] implied by #[warn(rust_2018_idioms)]
 
 warning: `extern crate` is not idiomatic in the new edition
-  --> $DIR/remove-extern-crate.rs:20:1
+  --> $DIR/remove-extern-crate.rs:21:1
    |
 LL | extern crate core as another_name;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert it to a `use`
 
 warning: `extern crate` is not idiomatic in the new edition
-  --> $DIR/remove-extern-crate.rs:33:5
+  --> $DIR/remove-extern-crate.rs:39:5
    |
 LL |     extern crate core;
    |     ^^^^^^^^^^^^^^^^^^ help: convert it to a `use`
index 598f18bf8d8d2b62f1cde515a11e6d4f682452b9..3f814085955f75ada1e2a61ee16675f326a49c0e 100644 (file)
@@ -76,24 +76,6 @@ error[E0121]: the type placeholder `_` is not allowed within types on item signa
 LL |     b: (_, _),
    |            ^ not allowed in type signatures
 
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures
-  --> $DIR/typeck_type_placeholder_item.rs:112:12
-   |
-LL |         a: _,
-   |            ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures
-  --> $DIR/typeck_type_placeholder_item.rs:114:13
-   |
-LL |         b: (_, _),
-   |             ^ not allowed in type signatures
-
-error[E0121]: the type placeholder `_` is not allowed within types on item signatures
-  --> $DIR/typeck_type_placeholder_item.rs:114:16
-   |
-LL |         b: (_, _),
-   |                ^ not allowed in type signatures
-
 error[E0121]: the type placeholder `_` is not allowed within types on item signatures
   --> $DIR/typeck_type_placeholder_item.rs:67:21
    |
@@ -154,6 +136,24 @@ error[E0121]: the type placeholder `_` is not allowed within types on item signa
 LL |     fn fn_test8(_f: fn() -> _) { }
    |                             ^ not allowed in type signatures
 
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> $DIR/typeck_type_placeholder_item.rs:112:12
+   |
+LL |         a: _,
+   |            ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> $DIR/typeck_type_placeholder_item.rs:114:13
+   |
+LL |         b: (_, _),
+   |             ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures
+  --> $DIR/typeck_type_placeholder_item.rs:114:16
+   |
+LL |         b: (_, _),
+   |                ^ not allowed in type signatures
+
 error[E0121]: the type placeholder `_` is not allowed within types on item signatures
   --> $DIR/typeck_type_placeholder_item.rs:43:24
    |
index afdf59d1e5bc55d22cba7292b944b7207bdee11f..c11b2e4c544e1fd524f25affa77fe82a637c2fed 100644 (file)
@@ -8,26 +8,25 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// Test that an appearance of `T` in fn args or in a trait object must
+// still meet the outlives bounds. Since this is a new requirement,
+// this is currently only a warning, not a hard error.
+
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
-trait Trait<'a, T> {
-    type Out;
-}
-
-impl<'a, T> Trait<'a, T> for usize {
-    type Out = &'a fn(T);
-}
+trait Trait<T> { }
 
 struct Foo<'a,T> {
     f: &'a fn(T),
+    //~^ ERROR E0309
 }
 
-trait Baz<T> { }
-
-impl<'a, T> Trait<'a, T> for u32 {
-    type Out = &'a Baz<T>;
+struct Bar<'a,T> {
+    f: &'a Trait<T>,
+    //~^ ERROR E0309
 }
 
+#[rustc_error]
 fn main() { }
 
index 26a2138c9f83c2afa689c4027f19731f577d2cfa..9a8c63126f28ec0a64e563f27f8b870e77fcddee 100644 (file)
@@ -1,30 +1,30 @@
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:5
+  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:21:5
    |
-LL | impl<'a, T> Trait<'a, T> for usize {
-   |          - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     type Out = &'a fn(T);
-   |     ^^^^^^^^^^^^^^^^^^^^^
+LL | struct Foo<'a,T> {
+   |               - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     f: &'a fn(T),
+   |     ^^^^^^^^^^^^
    |
 note: ...so that the reference type `&'a fn(T)` does not outlive the data it points at
-  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:5
+  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:21:5
    |
-LL |     type Out = &'a fn(T);
-   |     ^^^^^^^^^^^^^^^^^^^^^
+LL |     f: &'a fn(T),
+   |     ^^^^^^^^^^^^
 
 error[E0309]: the parameter type `T` may not live long enough
-  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:29:5
+  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:26:5
    |
-LL | impl<'a, T> Trait<'a, T> for u32 {
-   |          - help: consider adding an explicit lifetime bound `T: 'a`...
-LL |     type Out = &'a Baz<T>;
-   |     ^^^^^^^^^^^^^^^^^^^^^^
+LL | struct Bar<'a,T> {
+   |               - help: consider adding an explicit lifetime bound `T: 'a`...
+LL |     f: &'a Trait<T>,
+   |     ^^^^^^^^^^^^^^^
    |
-note: ...so that the reference type `&'a (dyn Baz<T> + 'a)` does not outlive the data it points at
-  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:29:5
+note: ...so that the reference type `&'a (dyn Trait<T> + 'a)` does not outlive the data it points at
+  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:26:5
    |
-LL |     type Out = &'a Baz<T>;
-   |     ^^^^^^^^^^^^^^^^^^^^^^
+LL |     f: &'a Trait<T>,
+   |     ^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
diff --git a/version b/version
index 18cb564a4d16b16c91d2e03ed30135515ed13fab..f6b262bdda41d3419a54039ee83389c9c08d6da4 100644 (file)
--- a/version
+++ b/version
@@ -1 +1 @@
-1.30.0-beta.7 (0ebb25088 2018-09-22)
\ No newline at end of file
+1.30.0 (da5f414c2 2018-10-24)
\ No newline at end of file