rustc_resolve::DIAGNOSTICS
[−]
[src]
pub const DIAGNOSTICS: [(&'static str, &'static str); 39usize]=
[("E0401", "\nInner items do not inherit type parameters from the functions they are embedded\nin. For example, this will not compile:\n\n```compile_fail\nfn foo<T>(x: T) {\n fn bar(y: T) { // T is defined in the \"outer\" function\n // ..\n }\n bar(x);\n}\n```\n\nNor will this:\n\n```compile_fail\nfn foo<T>(x: T) {\n type MaybeT = Option<T>;\n // ...\n}\n```\n\nOr this:\n\n```compile_fail\nfn foo<T>(x: T) {\n struct Foo {\n x: T,\n }\n // ...\n}\n```\n\nItems inside functions are basically just like top-level items, except\nthat they can only be used from the function they are in.\n\nThere are a couple of solutions for this.\n\nIf the item is a function, you may use a closure:\n\n```\nfn foo<T>(x: T) {\n let bar = |y: T| { // explicit type annotation may not be necessary\n // ..\n };\n bar(x);\n}\n```\n\nFor a generic item, you can copy over the parameters:\n\n```\nfn foo<T>(x: T) {\n fn bar<T>(y: T) {\n // ..\n }\n bar(x);\n}\n```\n\n```\nfn foo<T>(x: T) {\n type MaybeT<T> = Option<T>;\n}\n```\n\nBe sure to copy over any bounds as well:\n\n```\nfn foo<T: Copy>(x: T) {\n fn bar<T: Copy>(y: T) {\n // ..\n }\n bar(x);\n}\n```\n\n```\nfn foo<T: Copy>(x: T) {\n struct Foo<T: Copy> {\n x: T,\n }\n}\n```\n\nThis may require additional type hints in the function body.\n\nIn case the item is a function inside an `impl`, defining a private helper\nfunction might be easier:\n\n```ignore\nimpl<T> Foo<T> {\n pub fn foo(&self, x: T) {\n self.bar(x);\n }\n\n fn bar(&self, y: T) {\n // ..\n }\n}\n```\n\nFor default impls in traits, the private helper solution won\'t work, however\nclosures or copying the parameters should still work.\n"), ("E0403", "\nSome type parameters have the same name. Example of erroneous code:\n\n```compile_fail\nfn foo<T, T>(s: T, u: T) {} // error: the name `T` is already used for a type\n // parameter in this type parameter list\n```\n\nPlease verify that none of the type parameterss are misspelled, and rename any\nclashing parameters. Example:\n\n```\nfn foo<T, Y>(s: T, u: Y) {} // ok!\n```\n"), ("E0404", "\nYou tried to implement something which was not a trait on an object. Example of\nerroneous code:\n\n```compile_fail\nstruct Foo;\nstruct Bar;\n\nimpl Foo for Bar {} // error: `Foo` is not a trait\n```\n\nPlease verify that you didn\'t misspell the trait\'s name or otherwise use the\nwrong identifier. Example:\n\n```\ntrait Foo {\n // some functions\n}\nstruct Bar;\n\nimpl Foo for Bar { // ok!\n // functions implementation\n}\n```\n"), ("E0405", "\nThe code refers to a trait that is not in scope. Example of erroneous code:\n\n```compile_fail\nstruct Foo;\n\nimpl SomeTrait for Foo {} // error: trait `SomeTrait` is not in scope\n```\n\nPlease verify that the name of the trait wasn\'t misspelled and ensure that it\nwas imported. Example:\n\n```ignore\n// solution 1:\nuse some_file::SomeTrait;\n\n// solution 2:\ntrait SomeTrait {\n // some functions\n}\n\nstruct Foo;\n\nimpl SomeTrait for Foo { // ok!\n // implements functions\n}\n```\n"), ("E0407", "\nA definition of a method not in the implemented trait was given in a trait\nimplementation. Example of erroneous code:\n\n```compile_fail\ntrait Foo {\n fn a();\n}\n\nstruct Bar;\n\nimpl Foo for Bar {\n fn a() {}\n fn b() {} // error: method `b` is not a member of trait `Foo`\n}\n```\n\nPlease verify you didn\'t misspell the method name and you used the correct\ntrait. First example:\n\n```\ntrait Foo {\n fn a();\n fn b();\n}\n\nstruct Bar;\n\nimpl Foo for Bar {\n fn a() {}\n fn b() {} // ok!\n}\n```\n\nSecond example:\n\n```\ntrait Foo {\n fn a();\n}\n\nstruct Bar;\n\nimpl Foo for Bar {\n fn a() {}\n}\n\nimpl Bar {\n fn b() {}\n}\n```\n"), ("E0437", "\nTrait implementations can only implement associated types that are members of\nthe trait in question. This error indicates that you attempted to implement\nan associated type whose name does not match the name of any associated type\nin the trait.\n\nHere is an example that demonstrates the error:\n\n```compile_fail\ntrait Foo {}\n\nimpl Foo for i32 {\n type Bar = bool;\n}\n```\n\nThe solution to this problem is to remove the extraneous associated type:\n\n```\ntrait Foo {}\n\nimpl Foo for i32 {}\n```\n"), ("E0438", "\nTrait implementations can only implement associated constants that are\nmembers of the trait in question. This error indicates that you\nattempted to implement an associated constant whose name does not\nmatch the name of any associated constant in the trait.\n\nHere is an example that demonstrates the error:\n\n```compile_fail\n#![feature(associated_consts)]\n\ntrait Foo {}\n\nimpl Foo for i32 {\n const BAR: bool = true;\n}\n```\n\nThe solution to this problem is to remove the extraneous associated constant:\n\n```\ntrait Foo {}\n\nimpl Foo for i32 {}\n```\n"), ("E0408", "\nAn \"or\" pattern was used where the variable bindings are not consistently bound\nacross patterns.\n\nExample of erroneous code:\n\n```compile_fail\nmatch x {\n Some(y) | None => { /* use y */ } // error: variable `y` from pattern #1 is\n // not bound in pattern #2\n _ => ()\n}\n```\n\nHere, `y` is bound to the contents of the `Some` and can be used within the\nblock corresponding to the match arm. However, in case `x` is `None`, we have\nnot specified what `y` is, and the block will use a nonexistent variable.\n\nTo fix this error, either split into multiple match arms:\n\n```\nlet x = Some(1);\nmatch x {\n Some(y) => { /* use y */ }\n None => { /* ... */ }\n}\n```\n\nor, bind the variable to a field of the same type in all sub-patterns of the\nor pattern:\n\n```\nlet x = (0, 2);\nmatch x {\n (0, y) | (y, 0) => { /* use y */}\n _ => {}\n}\n```\n\nIn this example, if `x` matches the pattern `(0, _)`, the second field is set\nto `y`. If it matches `(_, 0)`, the first field is set to `y`; so in all\ncases `y` is set to some value.\n"), ("E0409", "\nAn \"or\" pattern was used where the variable bindings are not consistently bound\nacross patterns.\n\nExample of erroneous code:\n\n```compile_fail\nlet x = (0, 2);\nmatch x {\n (0, ref y) | (y, 0) => { /* use y */} // error: variable `y` is bound with\n // different mode in pattern #2\n // than in pattern #1\n _ => ()\n}\n```\n\nHere, `y` is bound by-value in one case and by-reference in the other.\n\nTo fix this error, just use the same mode in both cases.\nGenerally using `ref` or `ref mut` where not already used will fix this:\n\n```ignore\nlet x = (0, 2);\nmatch x {\n (0, ref y) | (ref y, 0) => { /* use y */}\n _ => ()\n}\n```\n\nAlternatively, split the pattern:\n\n```\nlet x = (0, 2);\nmatch x {\n (y, 0) => { /* use y */ }\n (0, ref y) => { /* use y */}\n _ => ()\n}\n```\n"), ("E0411", "\nThe `Self` keyword was used outside an impl or a trait. Erroneous code example:\n\n```compile_fail\n<Self>::foo; // error: use of `Self` outside of an impl or trait\n```\n\nThe `Self` keyword represents the current type, which explains why it can only\nbe used inside an impl or a trait. It gives access to the associated items of a\ntype:\n\n```\ntrait Foo {\n type Bar;\n}\n\ntrait Baz : Foo {\n fn bar() -> Self::Bar; // like this\n}\n```\n\nHowever, be careful when two types have a common associated type:\n\n```compile_fail\ntrait Foo {\n type Bar;\n}\n\ntrait Foo2 {\n type Bar;\n}\n\ntrait Baz : Foo + Foo2 {\n fn bar() -> Self::Bar;\n // error: ambiguous associated type `Bar` in bounds of `Self`\n}\n```\n\nThis problem can be solved by specifying from which trait we want to use the\n`Bar` type:\n\n```\ntrait Foo {\n type Bar;\n}\n\ntrait Foo2 {\n type Bar;\n}\n\ntrait Baz : Foo + Foo2 {\n fn bar() -> <Self as Foo>::Bar; // ok!\n}\n```\n"), ("E0412", "\nThe type name used is not in scope. Example of erroneous codes:\n\n```compile_fail\nimpl Something {} // error: type name `Something` is not in scope\n\n// or:\n\ntrait Foo {\n fn bar(N); // error: type name `N` is not in scope\n}\n\n// or:\n\nfn foo(x: T) {} // type name `T` is not in scope\n```\n\nTo fix this error, please verify you didn\'t misspell the type name, you did\ndeclare it or imported it into the scope. Examples:\n\n```\nstruct Something;\n\nimpl Something {} // ok!\n\n// or:\n\ntrait Foo {\n type N;\n\n fn bar(Self::N); // ok!\n}\n\n// or:\n\nfn foo<T>(x: T) {} // ok!\n```\n"), ("E0413", "\nA declaration shadows an enum variant or unit-like struct in scope. Example of\nerroneous code:\n\n```compile_fail\nstruct Foo;\n\nlet Foo = 12i32; // error: declaration of `Foo` shadows an enum variant or\n // unit-like struct in scope\n```\n\nTo fix this error, rename the variable such that it doesn\'t shadow any enum\nvariable or structure in scope. Example:\n\n```\nstruct Foo;\n\nlet foo = 12i32; // ok!\n```\n\nOr:\n\n```\nstruct FooStruct;\n\nlet Foo = 12i32; // ok!\n```\n\nThe goal here is to avoid a conflict of names.\n"), ("E0414", "\nA variable binding in an irrefutable pattern is shadowing the name of a\nconstant. Example of erroneous code:\n\n```compile_fail\nconst FOO: u8 = 7;\n\nlet FOO = 5; // error: variable bindings cannot shadow constants\n\n// or\n\nfn bar(FOO: u8) { // error: variable bindings cannot shadow constants\n\n}\n\n// or\n\nfor FOO in bar {\n\n}\n```\n\nIntroducing a new variable in Rust is done through a pattern. Thus you can have\n`let` bindings like `let (a, b) = ...`. However, patterns also allow constants\nin them, e.g. if you want to match over a constant:\n\n```ignore\nconst FOO: u8 = 1;\n\nmatch (x,y) {\n (3, 4) => { .. }, // it is (3,4)\n (FOO, 1) => { .. }, // it is (1,1)\n (foo, 1) => { .. }, // it is (anything, 1)\n // call the value in the first slot \"foo\"\n _ => { .. } // it is anything\n}\n```\n\nHere, the second arm matches the value of `x` against the constant `FOO`,\nwhereas the third arm will accept any value of `x` and call it `foo`.\n\nThis works for `match`, however in cases where an irrefutable pattern is\nrequired, constants can\'t be used. An irrefutable pattern is one which always\nmatches, whose purpose is only to bind variable names to values. These are\nrequired by let, for, and function argument patterns.\n\nRefutable patterns in such a situation do not make sense, for example:\n\n```ignore\nlet Some(x) = foo; // what if foo is None, instead?\n\nlet (1, x) = foo; // what if foo.0 is not 1?\n\nlet (SOME_CONST, x) = foo; // what if foo.0 is not SOME_CONST?\n\nlet SOME_CONST = foo; // what if foo is not SOME_CONST?\n```\n\nThus, an irrefutable variable binding can\'t contain a constant.\n\nTo fix this error, just give the marked variable a different name.\n"), ("E0415", "\nMore than one function parameter have the same name. Example of erroneous code:\n\n```compile_fail\nfn foo(f: i32, f: i32) {} // error: identifier `f` is bound more than\n // once in this parameter list\n```\n\nPlease verify you didn\'t misspell parameters\' name. Example:\n\n```\nfn foo(f: i32, g: i32) {} // ok!\n```\n"), ("E0416", "\nAn identifier is bound more than once in a pattern. Example of erroneous code:\n\n```compile_fail\nmatch (1, 2) {\n (x, x) => {} // error: identifier `x` is bound more than once in the\n // same pattern\n}\n```\n\nPlease verify you didn\'t misspell identifiers\' name. Example:\n\n```\nmatch (1, 2) {\n (x, y) => {} // ok!\n}\n```\n\nOr maybe did you mean to unify? Consider using a guard:\n\n```ignore\nmatch (A, B, C) {\n (x, x2, see) if x == x2 => { /* A and B are equal, do one thing */ }\n (y, z, see) => { /* A and B unequal; do another thing */ }\n}\n```\n"), ("E0417", "\nA static variable was referenced in a pattern. Example of erroneous code:\n\n```compile_fail\nstatic FOO : i32 = 0;\n\nmatch 0 {\n FOO => {} // error: static variables cannot be referenced in a\n // pattern, use a `const` instead\n _ => {}\n}\n```\n\nThe compiler needs to know the value of the pattern at compile time;\ncompile-time patterns can defined via const or enum items. Please verify\nthat the identifier is spelled correctly, and if so, use a const instead\nof static to define it. Example:\n\n```\nconst FOO : i32 = 0;\n\nmatch 0 {\n FOO => {} // ok!\n _ => {}\n}\n```\n"), ("E0419", "\nAn unknown enum variant, struct or const was used. Example of erroneous code:\n\n```compile_fail\nmatch 0 {\n Something::Foo => {} // error: unresolved enum variant, struct\n // or const `Foo`\n}\n```\n\nPlease verify you didn\'t misspell it and the enum variant, struct or const has\nbeen declared and imported into scope. Example:\n\n```\nenum Something {\n Foo,\n NotFoo,\n}\n\nmatch Something::NotFoo {\n Something::Foo => {} // ok!\n _ => {}\n}\n```\n"), ("E0422", "\nYou are trying to use an identifier that is either undefined or not a struct.\nFor instance:\n\n``` compile_fail\nfn main () {\n let x = Foo { x: 1, y: 2 };\n}\n```\n\nIn this case, `Foo` is undefined, so it inherently isn\'t anything, and\ndefinitely not a struct.\n\n```compile_fail\nfn main () {\n let foo = 1;\n let x = foo { x: 1, y: 2 };\n}\n```\n\nIn this case, `foo` is defined, but is not a struct, so Rust can\'t use it as\none.\n"), ("E0423", "\nA `struct` variant name was used like a function name. Example of erroneous\ncode:\n\n```compile_fail\nstruct Foo { a: bool};\n\nlet f = Foo();\n// error: `Foo` is a struct variant name, but this expression uses\n// it like a function name\n```\n\nPlease verify you didn\'t misspell the name of what you actually wanted to use\nhere. Example:\n\n```\nfn Foo() -> u32 { 0 }\n\nlet f = Foo(); // ok!\n```\n"), ("E0424", "\nThe `self` keyword was used in a static method. Example of erroneous code:\n\n```compile_fail\nstruct Foo;\n\nimpl Foo {\n fn bar(self) {}\n\n fn foo() {\n self.bar(); // error: `self` is not available in a static method.\n }\n}\n```\n\nPlease check if the method\'s argument list should have contained `self`,\n`&self`, or `&mut self` (in case you didn\'t want to create a static\nmethod), and add it if so. Example:\n\n```\nstruct Foo;\n\nimpl Foo {\n fn bar(self) {}\n\n fn foo(self) {\n self.bar(); // ok!\n }\n}\n```\n"), ("E0425", "\nAn unresolved name was used. Example of erroneous codes:\n\n```compile_fail\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n fn bar() {\n Self; // error: unresolved name `Self`\n }\n}\n\n// or:\n\nlet x = unknown_variable; // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn\'t misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n"), ("E0426", "\nAn undeclared label was used. Example of erroneous code:\n\n```compile_fail\nloop {\n break \'a; // error: use of undeclared label `\'a`\n}\n```\n\nPlease verify you spelt or declare the label correctly. Example:\n\n```\n\'a: loop {\n break \'a; // ok!\n}\n```\n"), ("E0430", "\nThe `self` import appears more than once in the list. Erroneous code example:\n\n```compile_fail\nuse something::{self, self}; // error: `self` import can only appear once in\n // the list\n```\n\nPlease verify you didn\'t misspell the import name or remove the duplicated\n`self` import. Example:\n\n```ignore\nuse something::self; // ok!\n```\n"), ("E0431", "\nAn invalid `self` import was made. Erroneous code example:\n\n```compile_fail\nuse {self}; // error: `self` import can only appear in an import list with a\n // non-empty prefix\n```\n\nYou cannot import the current module into itself, please remove this import\nor verify you didn\'t misspell it.\n"), ("E0432", "\nAn import was unresolved. Erroneous code example:\n\n```compile_fail\nuse something::Foo; // error: unresolved import `something::Foo`.\n```\n\nPaths in `use` statements are relative to the crate root. To import items\nrelative to the current and parent modules, use the `self::` and `super::`\nprefixes, respectively. Also verify that you didn\'t misspell the import\nname and that the import exists in the module from where you tried to\nimport it. Example:\n\n```ignore\nuse self::something::Foo; // ok!\n\nmod something {\n pub struct Foo;\n}\n```\n\nOr, if you tried to use a module from an external crate, you may have missed\nthe `extern crate` declaration (which is usually placed in the crate root):\n\n```ignore\nextern crate homura; // Required to use the `homura` crate\n\nuse homura::Madoka;\n```\n"), ("E0433", "\nInvalid import. Example of erroneous code:\n\n```compile_fail\nuse something_which_doesnt_exist;\n// error: unresolved import `something_which_doesnt_exist`\n```\n\nPlease verify you didn\'t misspell the import\'s name.\n"), ("E0434", "\nThis error indicates that a variable usage inside an inner function is invalid\nbecause the variable comes from a dynamic environment. Inner functions do not\nhave access to their containing environment.\n\nExample of erroneous code:\n\n```compile_fail\nfn foo() {\n let y = 5;\n fn bar() -> u32 {\n y // error: can\'t capture dynamic environment in a fn item; use the\n // || { ... } closure form instead.\n }\n}\n```\n\nFunctions do not capture local variables. To fix this error, you can replace the\nfunction with a closure:\n\n```\nfn foo() {\n let y = 5;\n let bar = || {\n y\n };\n}\n```\n\nor replace the captured variable with a constant or a static item:\n\n```\nfn foo() {\n static mut X: u32 = 4;\n const Y: u32 = 5;\n fn bar() -> u32 {\n unsafe {\n X = 3;\n }\n Y\n }\n}\n```\n"), ("E0435", "\nA non-constant value was used to initialise a constant. Example of erroneous\ncode:\n\n```compile_fail\nlet foo = 42u32;\nconst FOO : u32 = foo; // error: attempt to use a non-constant value in a\n // constant\n```\n\nTo fix this error, please replace the value with a constant. Example:\n\n```\nconst FOO : u32 = 42u32; // ok!\n```\n\nOr:\n\n```\nconst OTHER_FOO : u32 = 42u32;\nconst FOO : u32 = OTHER_FOO; // ok!\n```\n"), ("E0259", "\nThe name chosen for an external crate conflicts with another external crate\nthat has been imported into the current module.\n\nErroneous code example:\n\n```compile_fail\nextern crate a;\nextern crate crate_a as a;\n```\n\nThe solution is to choose a different name that doesn\'t conflict with any\nexternal crate imported into the current module.\n\nCorrect example:\n\n```ignore\nextern crate a;\nextern crate crate_a as other_name;\n```\n"), ("E0260", "\nThe name for an item declaration conflicts with an external crate\'s name.\n\nFor instance:\n\n```ignore\nextern crate abc;\n\nstruct abc;\n```\n\nThere are two possible solutions:\n\nSolution #1: Rename the item.\n\n```ignore\nextern crate abc;\n\nstruct xyz;\n```\n\nSolution #2: Import the crate with a different name.\n\n```ignore\nextern crate abc as xyz;\n\nstruct abc;\n```\n\nSee the Declaration Statements section of the reference for more information\nabout what constitutes an Item declaration and what does not:\n\nhttps://doc.rust-lang.org/reference.html#statements\n"), ("E0428", "\nA type or module has been defined more than once. Example of erroneous\ncode:\n\n```compile_fail\nstruct Bar;\nstruct Bar; // error: duplicate definition of value `Bar`\n```\n\nPlease verify you didn\'t misspell the type/module\'s name or remove/rename the\nduplicated one. Example:\n\n```\nstruct Bar;\nstruct Bar2; // ok!\n```\n"), ("E0252", "\nTwo items of the same name cannot be imported without rebinding one of the\nitems under a new local name.\n\nAn example of this error:\n\n```compile_fail\nuse foo::baz;\nuse bar::baz; // error, do `use bar::baz as quux` instead\n\nfn main() {}\n\nmod foo {\n pub struct baz;\n}\n\nmod bar {\n pub mod baz {}\n}\n```\n"), ("E0255", "\nYou can\'t import a value whose name is the same as another value defined in the\nmodule.\n\nAn example of this error:\n\n```compile_fail\nuse bar::foo; // error, do `use bar::foo as baz` instead\n\nfn foo() {}\n\nmod bar {\n pub fn foo() {}\n}\n\nfn main() {}\n```\n"), ("E0154", "\nImports (`use` statements) are not allowed after non-item statements, such as\nvariable declarations and expression statements.\n\nHere is an example that demonstrates the error:\n\n```compile_fail\nfn f() {\n // Variable declaration before import\n let x = 0;\n use std::io::Read;\n // ...\n}\n```\n\nThe solution is to declare the imports at the top of the block, function, or\nfile.\n\nHere is the previous example again, with the correct order:\n\n```\nfn f() {\n use std::io::Read;\n let x = 0;\n // ...\n}\n```\n\nSee the Declaration Statements section of the reference for more information\nabout what constitutes an Item declaration and what does not:\n\nhttps://doc.rust-lang.org/reference.html#statements\n"), ("E0251", "\nTwo items of the same name cannot be imported without rebinding one of the\nitems under a new local name.\n\nAn example of this error:\n\n```compile_fail\nuse foo::baz;\nuse bar::*; // error, do `use foo::baz as quux` instead on the previous line\n\nfn main() {}\n\nmod foo {\n pub struct baz;\n}\n\nmod bar {\n pub mod baz {}\n}\n```\n"), ("E0253", "\nAttempt was made to import an unimportable value. This can happen when trying\nto import a method from a trait. An example of this error:\n\n```compile_fail\nmod foo {\n pub trait MyTrait {\n fn do_something();\n }\n}\n\nuse foo::MyTrait::do_something;\n```\n\nIt\'s invalid to directly import methods belonging to a trait or concrete type.\n"), ("E0256", "\nYou can\'t import a type or module when the name of the item being imported is\nthe same as another type or submodule defined in the module.\n\nAn example of this error:\n\n```compile_fail\nuse foo::Bar; // error\n\ntype Bar = u32;\n\nmod foo {\n pub mod Bar { }\n}\n\nfn main() {}\n```\n"), ("E0364", "\nPrivate items cannot be publicly re-exported. This error indicates that you\nattempted to `pub use` a type or value that was not itself public.\n\nHere is an example that demonstrates the error:\n\n```compile_fail\nmod foo {\n const X: u32 = 1;\n}\n\npub use foo::X;\n```\n\nThe solution to this problem is to ensure that the items that you are\nre-exporting are themselves marked with `pub`:\n\n```ignore\nmod foo {\n pub const X: u32 = 1;\n}\n\npub use foo::X;\n```\n\nSee the \'Use Declarations\' section of the reference for more information on\nthis topic:\n\nhttps://doc.rust-lang.org/reference.html#use-declarations\n"), ("E0365", "\nPrivate modules cannot be publicly re-exported. This error indicates that you\nattempted to `pub use` a module that was not itself public.\n\nHere is an example that demonstrates the error:\n\n```compile_fail\nmod foo {\n pub const X: u32 = 1;\n}\n\npub use foo as foo2;\n```\n\nThe solution to this problem is to ensure that the module that you are\nre-exporting is itself marked with `pub`:\n\n```ignore\npub mod foo {\n pub const X: u32 = 1;\n}\n\npub use foo as foo2;\n```\n\nSee the \'Use Declarations\' section of the reference for more information\non this topic:\n\nhttps://doc.rust-lang.org/reference.html#use-declarations\n")]
Unstable (
rustc_private
)