From a4a2fcd38cb64b313b4808681736ebd40dc36f64 Mon Sep 17 00:00:00 2001 From: dylan_DPC Date: Tue, 21 Aug 2018 16:29:08 +0530 Subject: [PATCH 1/8] add macro check for lint --- src/librustc_lint/builtin.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 561f5fbf5c41e..95da9ffe3a540 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -284,7 +284,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnsafeCode { declare_lint! { pub MISSING_DOCS, Allow, - "detects missing documentation for public members" + "detects missing documentation for public members", + report_in_external_macro: true } pub struct MissingDoc { From 73ea867b4c8c90885e5f8c34b879c426d3146b2a Mon Sep 17 00:00:00 2001 From: dylan_DPC Date: Wed, 22 Aug 2018 01:13:24 +0530 Subject: [PATCH 2/8] add testcase to existing macro testcase --- src/test/ui/lint/lints-in-foreign-macros.rs | 1 + .../ui/lint/lints-in-foreign-macros.stderr | 24 ++++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/test/ui/lint/lints-in-foreign-macros.rs b/src/test/ui/lint/lints-in-foreign-macros.rs index 0f9003877cc06..34c15b15378de 100644 --- a/src/test/ui/lint/lints-in-foreign-macros.rs +++ b/src/test/ui/lint/lints-in-foreign-macros.rs @@ -12,6 +12,7 @@ // compile-pass #![warn(unused_imports)] +#![warn(missing_docs)] //~ WARN: missing documentation for crate [missing_docs] #[macro_use] extern crate lints_in_foreign_macros; diff --git a/src/test/ui/lint/lints-in-foreign-macros.stderr b/src/test/ui/lint/lints-in-foreign-macros.stderr index e9f6d3d381541..e2df883cd4a73 100644 --- a/src/test/ui/lint/lints-in-foreign-macros.stderr +++ b/src/test/ui/lint/lints-in-foreign-macros.stderr @@ -1,5 +1,5 @@ warning: unused import: `std::string::ToString` - --> $DIR/lints-in-foreign-macros.rs:20:16 + --> $DIR/lints-in-foreign-macros.rs:21:16 | LL | () => {use std::string::ToString;} //~ WARN: unused import | ^^^^^^^^^^^^^^^^^^^^^ @@ -14,14 +14,32 @@ LL | #![warn(unused_imports)] | ^^^^^^^^^^^^^^ warning: unused import: `std::string::ToString` - --> $DIR/lints-in-foreign-macros.rs:25:18 + --> $DIR/lints-in-foreign-macros.rs:26:18 | LL | mod c { baz!(use std::string::ToString;); } //~ WARN: unused import | ^^^^^^^^^^^^^^^^^^^^^ warning: unused import: `std::string::ToString` - --> $DIR/lints-in-foreign-macros.rs:26:19 + --> $DIR/lints-in-foreign-macros.rs:27:19 | LL | mod d { baz2!(use std::string::ToString;); } //~ WARN: unused import | ^^^^^^^^^^^^^^^^^^^^^ +warning: missing documentation for crate + --> $DIR/lints-in-foreign-macros.rs:14:1 + | +LL | / #![warn(unused_imports)] +LL | | #![warn(missing_docs)] //~ WARN: missing documentation for crate [missing_docs] +LL | | +LL | | #[macro_use] +... | +LL | | +LL | | fn main() {} + | |____________^ + | +note: lint level defined here + --> $DIR/lints-in-foreign-macros.rs:15:9 + | +LL | #![warn(missing_docs)] //~ WARN: missing documentation for crate [missing_docs] + | ^^^^^^^^^^^^ + From 073513102378d425c6e2fd3f32cc8d28d2eb367c Mon Sep 17 00:00:00 2001 From: dylan_DPC Date: Thu, 23 Aug 2018 01:56:39 +0530 Subject: [PATCH 3/8] add warning for missing docs --- src/test/ui/lint/lints-in-foreign-macros.rs | 3 ++- src/test/ui/lint/lints-in-foreign-macros.stderr | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/test/ui/lint/lints-in-foreign-macros.rs b/src/test/ui/lint/lints-in-foreign-macros.rs index 34c15b15378de..2ad1cfe71682c 100644 --- a/src/test/ui/lint/lints-in-foreign-macros.rs +++ b/src/test/ui/lint/lints-in-foreign-macros.rs @@ -12,7 +12,7 @@ // compile-pass #![warn(unused_imports)] -#![warn(missing_docs)] //~ WARN: missing documentation for crate [missing_docs] +#![warn(missing_docs)] #[macro_use] extern crate lints_in_foreign_macros; @@ -25,5 +25,6 @@ mod a { foo!(); } mod b { bar!(); } mod c { baz!(use std::string::ToString;); } //~ WARN: unused import mod d { baz2!(use std::string::ToString;); } //~ WARN: unused import +mod e { baz!(pub fn undocumented() {}); }//~ WARN: missing documentation for a function fn main() {} diff --git a/src/test/ui/lint/lints-in-foreign-macros.stderr b/src/test/ui/lint/lints-in-foreign-macros.stderr index e2df883cd4a73..4a75e1d907dc8 100644 --- a/src/test/ui/lint/lints-in-foreign-macros.stderr +++ b/src/test/ui/lint/lints-in-foreign-macros.stderr @@ -29,17 +29,17 @@ warning: missing documentation for crate --> $DIR/lints-in-foreign-macros.rs:14:1 | LL | / #![warn(unused_imports)] -LL | | #![warn(missing_docs)] //~ WARN: missing documentation for crate [missing_docs] +LL | | #![warn(missing_docs)] LL | | LL | | #[macro_use] ... | LL | | -LL | | fn main() {} +LL | | fn main() {} //~ WARN: missing documentation for crate [missing_docs] | |____________^ | note: lint level defined here --> $DIR/lints-in-foreign-macros.rs:15:9 | -LL | #![warn(missing_docs)] //~ WARN: missing documentation for crate [missing_docs] +LL | #![warn(missing_docs)] | ^^^^^^^^^^^^ From d0026ee6c0e78b425dea5bc768dab7c5bc829c3e Mon Sep 17 00:00:00 2001 From: dylan_DPC Date: Thu, 23 Aug 2018 23:21:54 +0530 Subject: [PATCH 4/8] fix testcase --- src/test/ui/lint/lints-in-foreign-macros.rs | 5 +++-- .../ui/lint/lints-in-foreign-macros.stderr | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/test/ui/lint/lints-in-foreign-macros.rs b/src/test/ui/lint/lints-in-foreign-macros.rs index 2ad1cfe71682c..3785968df871a 100644 --- a/src/test/ui/lint/lints-in-foreign-macros.rs +++ b/src/test/ui/lint/lints-in-foreign-macros.rs @@ -11,7 +11,7 @@ // aux-build:lints-in-foreign-macros.rs // compile-pass -#![warn(unused_imports)] +#![warn(unused_imports)] //~ missing documentation for crate [missing_docs] #![warn(missing_docs)] #[macro_use] @@ -25,6 +25,7 @@ mod a { foo!(); } mod b { bar!(); } mod c { baz!(use std::string::ToString;); } //~ WARN: unused import mod d { baz2!(use std::string::ToString;); } //~ WARN: unused import -mod e { baz!(pub fn undocumented() {}); }//~ WARN: missing documentation for a function +baz!(pub fn undocumented() {}); //~ WARN: missing documentation for a function +baz2!(pub fn undocumented2() {}); //~ WARN: missing documentation for a function fn main() {} diff --git a/src/test/ui/lint/lints-in-foreign-macros.stderr b/src/test/ui/lint/lints-in-foreign-macros.stderr index 4a75e1d907dc8..2ddca7781231f 100644 --- a/src/test/ui/lint/lints-in-foreign-macros.stderr +++ b/src/test/ui/lint/lints-in-foreign-macros.stderr @@ -10,7 +10,7 @@ LL | mod a { foo!(); } note: lint level defined here --> $DIR/lints-in-foreign-macros.rs:14:9 | -LL | #![warn(unused_imports)] +LL | #![warn(unused_imports)] //~ missing documentation for crate [missing_docs] | ^^^^^^^^^^^^^^ warning: unused import: `std::string::ToString` @@ -28,13 +28,13 @@ LL | mod d { baz2!(use std::string::ToString;); } //~ WARN: unused import warning: missing documentation for crate --> $DIR/lints-in-foreign-macros.rs:14:1 | -LL | / #![warn(unused_imports)] +LL | / #![warn(unused_imports)] //~ missing documentation for crate [missing_docs] LL | | #![warn(missing_docs)] LL | | LL | | #[macro_use] ... | LL | | -LL | | fn main() {} //~ WARN: missing documentation for crate [missing_docs] +LL | | fn main() {} | |____________^ | note: lint level defined here @@ -43,3 +43,15 @@ note: lint level defined here LL | #![warn(missing_docs)] | ^^^^^^^^^^^^ +warning: missing documentation for a function + --> $DIR/lints-in-foreign-macros.rs:28:6 + | +LL | baz!(pub fn undocumented() {}); //~ WARN: missing documentation for a function + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: missing documentation for a function + --> $DIR/lints-in-foreign-macros.rs:29:7 + | +LL | baz2!(pub fn undocumented2() {}); //~ WARN: missing documentation for a function + | ^^^^^^^^^^^^^^^^^^^^^^ + From 78326431fc9f832d1251ff855f74e0192a4a9324 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Mon, 20 Aug 2018 00:03:40 +0300 Subject: [PATCH 5/8] resolve: Reject some inaccessible candidates sooner during import resolution This allows import resolution to progress in cases like #53140 --- src/librustc_resolve/resolve_imports.rs | 5 +++++ src/test/ui/imports/issue-53140.rs | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/test/ui/imports/issue-53140.rs diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs index acdb7c4d4edfc..afeb8c122bb7b 100644 --- a/src/librustc_resolve/resolve_imports.rs +++ b/src/librustc_resolve/resolve_imports.rs @@ -203,6 +203,8 @@ impl<'a> Resolver<'a> { }; match self.resolve_ident_in_module(module, ident, ns, false, path_span) { Err(Determined) => continue, + Ok(binding) + if !self.is_accessible_from(binding.vis, single_import.parent) => continue, Ok(_) | Err(Undetermined) => return Err(Undetermined), } } @@ -255,8 +257,11 @@ impl<'a> Resolver<'a> { module, ident, ns, false, false, path_span, ); self.current_module = orig_current_module; + match result { Err(Determined) => continue, + Ok(binding) + if !self.is_accessible_from(binding.vis, glob_import.parent) => continue, Ok(_) | Err(Undetermined) => return Err(Undetermined), } } diff --git a/src/test/ui/imports/issue-53140.rs b/src/test/ui/imports/issue-53140.rs new file mode 100644 index 0000000000000..dcfa054f2513f --- /dev/null +++ b/src/test/ui/imports/issue-53140.rs @@ -0,0 +1,21 @@ +// 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-pass + +mod m { + pub struct S(u8); + + use S as Z; +} + +use m::*; + +fn main() {} From a7b3af8ff6ae936a0082de39820b8322e474a58a Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 9 Aug 2018 16:35:25 -0700 Subject: [PATCH 6/8] rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5. This hack was removed in #50949, but without it I found that building `std` with full debuginfo would print many LLVM `DW_OP_LLVM_fragment` errors, then die `LLVM ERROR: Failed to strip malformed debug info`. It doesn't seem to be a problem for LLVM 6, so we can re-enable the hack just for older LLVM. This reverts commit da579ef75e4a8ca11fb98b24a0a3ea0c7ccffeeb. Fixes #53204. r? @eddyb --- src/librustc_codegen_llvm/mir/mod.rs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/librustc_codegen_llvm/mir/mod.rs b/src/librustc_codegen_llvm/mir/mod.rs index 312939408c62c..aaae7b3cf897e 100644 --- a/src/librustc_codegen_llvm/mir/mod.rs +++ b/src/librustc_codegen_llvm/mir/mod.rs @@ -572,6 +572,25 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>, }; let upvar_tys = upvar_substs.upvar_tys(def_id, tcx); + // Store the pointer to closure data in an alloca for debuginfo + // because that's what the llvm.dbg.declare intrinsic expects. + + // FIXME(eddyb) this shouldn't be necessary but SROA seems to + // mishandle DW_OP_plus not preceded by DW_OP_deref, i.e. it + // doesn't actually strip the offset when splitting the closure + // environment into its components so it ends up out of bounds. + // (cuviper) It seems to be fine without the alloca on LLVM 6 and later. + let env_alloca = !env_ref && unsafe { llvm::LLVMRustVersionMajor() < 6 }; + let env_ptr = if env_alloca { + let scratch = PlaceRef::alloca(bx, + bx.cx.layout_of(tcx.mk_mut_ptr(arg.layout.ty)), + "__debuginfo_env_ptr"); + bx.store(place.llval, scratch.llval, scratch.align); + scratch.llval + } else { + place.llval + }; + for (i, (decl, ty)) in mir.upvar_decls.iter().zip(upvar_tys).enumerate() { let byte_offset_of_var_in_env = closure_layout.fields.offset(i).bytes(); @@ -583,7 +602,10 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>, }; // The environment and the capture can each be indirect. - let mut ops = if env_ref { &ops[..] } else { &ops[1..] }; + + // FIXME(eddyb) see above why we sometimes have to keep + // a pointer in an alloca for debuginfo atm. + let mut ops = if env_ref || env_alloca { &ops[..] } else { &ops[1..] }; let ty = if let (true, &ty::TyRef(_, ty, _)) = (decl.by_ref, &ty.sty) { ty @@ -593,7 +615,7 @@ fn arg_local_refs<'a, 'tcx>(bx: &Builder<'a, 'tcx>, }; let variable_access = VariableAccess::IndirectVariable { - alloca: place.llval, + alloca: env_ptr, address_operations: &ops }; declare_local( From 21ef15223fb45cf19013eb5cddee0049e225cf43 Mon Sep 17 00:00:00 2001 From: varkor Date: Thu, 9 Aug 2018 20:58:43 +0100 Subject: [PATCH 7/8] Feature gate where clauses on associated type impls --- src/libsyntax/feature_gate.rs | 13 +++++++++---- .../ui/feature-gate-generic_associated_types.rs | 5 +++++ .../feature-gate-generic_associated_types.stderr | 16 ++++++++++++---- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 40fb2c69e57cb..a961ec5a9edd1 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -1861,10 +1861,15 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { "existential types are unstable" ); } - - ast::ImplItemKind::Type(_) if !ii.generics.params.is_empty() => { - gate_feature_post!(&self, generic_associated_types, ii.span, - "generic associated types are unstable"); + ast::ImplItemKind::Type(_) => { + if !ii.generics.params.is_empty() { + gate_feature_post!(&self, generic_associated_types, ii.span, + "generic associated types are unstable"); + } + if !ii.generics.where_clause.predicates.is_empty() { + gate_feature_post!(&self, generic_associated_types, ii.span, + "where clauses on associated types are unstable"); + } } _ => {} } diff --git a/src/test/ui/feature-gate-generic_associated_types.rs b/src/test/ui/feature-gate-generic_associated_types.rs index 3470662686643..bbaae1ef449fc 100644 --- a/src/test/ui/feature-gate-generic_associated_types.rs +++ b/src/test/ui/feature-gate-generic_associated_types.rs @@ -19,6 +19,7 @@ trait PointerFamily { } struct Foo; + impl PointerFamily for Foo { type Pointer = Box; //~^ ERROR generic associated types are unstable @@ -31,5 +32,9 @@ trait Bar { //~^ ERROR where clauses on associated types are unstable } +impl Bar for Foo { + type Assoc where Self: Sized = Foo; + //~^ ERROR where clauses on associated types are unstable +} fn main() {} diff --git a/src/test/ui/feature-gate-generic_associated_types.stderr b/src/test/ui/feature-gate-generic_associated_types.stderr index d7891f13c6b4d..f12cbe727fbed 100644 --- a/src/test/ui/feature-gate-generic_associated_types.stderr +++ b/src/test/ui/feature-gate-generic_associated_types.stderr @@ -23,7 +23,7 @@ LL | type Pointer2: Deref where T: Clone, U: Clone; = help: add #![feature(generic_associated_types)] to the crate attributes to enable error[E0658]: generic associated types are unstable (see issue #44265) - --> $DIR/feature-gate-generic_associated_types.rs:23:5 + --> $DIR/feature-gate-generic_associated_types.rs:24:5 | LL | type Pointer = Box; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -31,7 +31,7 @@ LL | type Pointer = Box; = help: add #![feature(generic_associated_types)] to the crate attributes to enable error[E0658]: generic associated types are unstable (see issue #44265) - --> $DIR/feature-gate-generic_associated_types.rs:25:5 + --> $DIR/feature-gate-generic_associated_types.rs:26:5 | LL | type Pointer2 = Box; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -39,13 +39,21 @@ LL | type Pointer2 = Box; = help: add #![feature(generic_associated_types)] to the crate attributes to enable error[E0658]: where clauses on associated types are unstable (see issue #44265) - --> $DIR/feature-gate-generic_associated_types.rs:30:5 + --> $DIR/feature-gate-generic_associated_types.rs:31:5 | LL | type Assoc where Self: Sized; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: add #![feature(generic_associated_types)] to the crate attributes to enable -error: aborting due to 6 previous errors +error[E0658]: where clauses on associated types are unstable (see issue #44265) + --> $DIR/feature-gate-generic_associated_types.rs:36:5 + | +LL | type Assoc where Self: Sized = Foo; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(generic_associated_types)] to the crate attributes to enable + +error: aborting due to 7 previous errors For more information about this error, try `rustc --explain E0658`. From ef2b1f16865319ce8b6affbf34fee4d3039c8540 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Mon, 20 Aug 2018 03:35:52 +0300 Subject: [PATCH 8/8] resolve: Continue search in outer scopes after applying derive resolution fallback --- src/librustc_resolve/lib.rs | 28 ++++++++++--------- .../ui-fulldeps/proc-macro/generate-mod.rs | 8 ++++++ .../proc-macro/generate-mod.stderr | 18 ++++++++++++ 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 9714679949ff4..d41f3ec1d9bd9 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -1889,12 +1889,13 @@ impl<'a> Resolver<'a> { } ident.span = ident.span.modern(); + let mut poisoned = None; loop { - let (opt_module, poisoned) = if let Some(node_id) = record_used_id { + let opt_module = if let Some(node_id) = record_used_id { self.hygienic_lexical_parent_with_compatibility_fallback(module, &mut ident.span, - node_id) + node_id, &mut poisoned) } else { - (self.hygienic_lexical_parent(module, &mut ident.span), None) + self.hygienic_lexical_parent(module, &mut ident.span) }; module = unwrap_or!(opt_module, break); let orig_current_module = self.current_module; @@ -1917,9 +1918,9 @@ impl<'a> Resolver<'a> { } return Some(LexicalScopeBinding::Item(binding)) } - _ if poisoned.is_some() => break, - Err(Undetermined) => return None, - Err(Determined) => {} + Err(Determined) => continue, + Err(Undetermined) => + span_bug!(ident.span, "undetermined resolution during main resolution pass"), } } @@ -1965,12 +1966,12 @@ impl<'a> Resolver<'a> { None } - fn hygienic_lexical_parent_with_compatibility_fallback( - &mut self, module: Module<'a>, span: &mut Span, node_id: NodeId - ) -> (Option>, /* poisoned */ Option) - { + fn hygienic_lexical_parent_with_compatibility_fallback(&mut self, module: Module<'a>, + span: &mut Span, node_id: NodeId, + poisoned: &mut Option) + -> Option> { if let module @ Some(..) = self.hygienic_lexical_parent(module, span) { - return (module, None); + return module; } // We need to support the next case under a deprecation warning @@ -1991,13 +1992,14 @@ impl<'a> Resolver<'a> { // The macro is a proc macro derive if module.expansion.looks_like_proc_macro_derive() { if parent.expansion.is_descendant_of(span.ctxt().outer()) { - return (module.parent, Some(node_id)); + *poisoned = Some(node_id); + return module.parent; } } } } - (None, None) + None } fn resolve_ident_in_module(&mut self, diff --git a/src/test/ui-fulldeps/proc-macro/generate-mod.rs b/src/test/ui-fulldeps/proc-macro/generate-mod.rs index ee0077c3ed3ff..ac59984658d45 100644 --- a/src/test/ui-fulldeps/proc-macro/generate-mod.rs +++ b/src/test/ui-fulldeps/proc-macro/generate-mod.rs @@ -31,6 +31,14 @@ struct S; //~| WARN this was previously accepted struct Z; +fn inner_block() { + #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope + //~| WARN cannot find type `OuterDerive` in this scope + //~| WARN this was previously accepted + //~| WARN this was previously accepted + struct InnerZ; +} + #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed struct W; diff --git a/src/test/ui-fulldeps/proc-macro/generate-mod.stderr b/src/test/ui-fulldeps/proc-macro/generate-mod.stderr index c024aeffbb086..87e5fe2554264 100644 --- a/src/test/ui-fulldeps/proc-macro/generate-mod.stderr +++ b/src/test/ui-fulldeps/proc-macro/generate-mod.stderr @@ -41,6 +41,24 @@ LL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #50504 +warning: cannot find type `FromOutside` in this scope + --> $DIR/generate-mod.rs:35:14 + | +LL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope + | ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #50504 + +warning: cannot find type `OuterDerive` in this scope + --> $DIR/generate-mod.rs:35:14 + | +LL | #[derive(generate_mod::CheckDerive)] //~ WARN cannot find type `FromOutside` in this scope + | ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #50504 + error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0412`.