Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e836b1b
Prevent help popup to disappear when clicking on it
GuillaumeGomez Oct 23, 2019
863796b
Improve help popup detection
GuillaumeGomez Oct 25, 2019
62c3443
Re-enable Emscripten's exception handling support
tlively Oct 18, 2019
29d6aaa
Temporarily enable asmjs and wasm32 CI on PRs
tlively Oct 25, 2019
f8ed985
Formatting
tlively Oct 25, 2019
23b3827
ci: add support for MIPS64 musl targets
xen0n Jul 28, 2019
de9413b
changing non-empty glob must import something to a lint
traxys Oct 27, 2019
652b1bd
fix tidy
traxys Oct 28, 2019
7cecfab
add basic HermitCore support within libtest
stlankes Oct 28, 2019
b3f6494
proc_macro: remove now-unnecessary ICE workarounds from bridge::client.
eddyb Oct 28, 2019
cf65200
removing trailing whitespaces
stlankes Oct 28, 2019
da5965f
proc_macro: consolidate bridge::client::run_expand{1,2} into one helper.
eddyb Oct 28, 2019
b586344
proc_macro: don't use Rust ABI fn pointers in a C ABI fn signature.
eddyb Oct 28, 2019
92c049b
Revert "Temporarily enable asmjs and wasm32 CI on PRs"
tlively Oct 28, 2019
3bd16c2
Update mdbook to 0.3.3
carols10cents Oct 28, 2019
ed8585f
forgot to add the changed stderr
traxys Oct 28, 2019
c648ad5
Use rustc-workspace-hack for rustbook
smaeul Oct 6, 2019
53be272
ci: enable "run when submodule changes" with environment variables
pietroalbini Oct 23, 2019
4fb8a9a
ci: extract job skipping logic into a script
pietroalbini Oct 23, 2019
95ad6c3
Apply suggestions from lzutao
pietroalbini Oct 29, 2019
c8420db
Create new error code E0740 for visibility restrictions to ancestor m…
GuillaumeGomez Oct 14, 2019
208af20
Add long error explanation for E0740
GuillaumeGomez Oct 14, 2019
6c7fe5a
Update ui tests
GuillaumeGomez Oct 14, 2019
9869e5b
Change E0741 into E0742
GuillaumeGomez Oct 29, 2019
bc98c86
doc: use new feature gate for c_void type
tesuji Oct 29, 2019
e755963
save-analysis: Account for async desugaring in async fn return types
Xanewok Oct 29, 2019
3f50a0d
Rollup merge of #65405 - GuillaumeGomez:long-err-explanation-E0740, r…
tmandry Oct 29, 2019
0d755ff
Rollup merge of #65539 - traxys:fix_62334, r=petrochenkov
tmandry Oct 29, 2019
5e84805
Rollup merge of #65724 - pietroalbini:ci-remove-template-parameter, r…
tmandry Oct 29, 2019
c4960c2
Rollup merge of #65741 - GuillaumeGomez:help-popup, r=Dylan-DPC
tmandry Oct 29, 2019
8aa2312
Rollup merge of #65832 - tlively:emscripten-exception-handling, r=ale…
tmandry Oct 29, 2019
e15f1be
Rollup merge of #65843 - xen0n:mips64-musl-targets-with-ci, r=alexcri…
tmandry Oct 29, 2019
4bb91c7
Rollup merge of #65898 - hermitcore:rusty-hermit, r=kennytm
tmandry Oct 29, 2019
dfac64b
Rollup merge of #65900 - eddyb:proc-macro-cleanup, r=alexcrichton
tmandry Oct 29, 2019
67558a8
Rollup merge of #65906 - integer32llc:update-mdbook, r=alexcrichton
tmandry Oct 29, 2019
4359666
Rollup merge of #65920 - smaeul:patch/workspace-hack, r=alexcrichton
tmandry Oct 29, 2019
73dcb96
Rollup merge of #65930 - lzutao:new-feature-gate-c_void, r=dtolnay
tmandry Oct 29, 2019
db49686
Rollup merge of #65936 - Xanewok:save-analysis-async, r=nikomatsakis
tmandry Oct 29, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
changing non-empty glob must import something to a lint
  • Loading branch information
traxys committed Oct 27, 2019
commit de9413bd3403f1b95c717a839b7612e3cfe83b03
5 changes: 3 additions & 2 deletions src/librustc_resolve/resolve_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -972,8 +972,9 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
if !is_prelude &&
max_vis.get() != ty::Visibility::Invisible && // Allow empty globs.
!max_vis.get().is_at_least(directive.vis.get(), &*self) {
let msg = "A non-empty glob must import something with the glob's visibility";
self.r.session.span_err(directive.span, msg);
let msg =
"glob import doesn't reexport anything because no candidate is public enough";
self.r.session.buffer_lint(UNUSED_IMPORTS, directive.id, directive.span, msg);
}
return None;
}
Expand Down
9 changes: 7 additions & 2 deletions src/test/ui/imports/reexports.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
#![warn(unused_imports)]

mod a {
fn foo() {}
mod foo {}

mod a {
pub use super::foo; //~ ERROR cannot be re-exported
pub use super::*; //~ ERROR must import something with the glob's visibility
pub use super::*;
//~^ WARNING glob import doesn't reexport anything because no candidate is public enough
}
}

mod b {
pub fn foo() {}
mod foo { pub struct S; }
mod foo {
pub struct S;
}

pub mod a {
pub use super::foo; // This is OK since the value `foo` is visible enough.
Expand Down
28 changes: 17 additions & 11 deletions src/test/ui/imports/reexports.stderr
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
error[E0364]: `foo` is private, and cannot be re-exported
--> $DIR/reexports.rs:6:17
--> $DIR/reexports.rs:10:17
|
LL | pub use super::foo;
| ^^^^^^^^^^
|
note: consider marking `foo` as `pub` in the imported module
--> $DIR/reexports.rs:6:17
--> $DIR/reexports.rs:10:17
|
LL | pub use super::foo;
| ^^^^^^^^^^

error: A non-empty glob must import something with the glob's visibility
--> $DIR/reexports.rs:7:17
|
LL | pub use super::*;
| ^^^^^^^^

error[E0603]: module `foo` is private
--> $DIR/reexports.rs:28:15
--> $DIR/reexports.rs:35:15
|
LL | use b::a::foo::S;
| ^^^

error[E0603]: module `foo` is private
--> $DIR/reexports.rs:29:15
--> $DIR/reexports.rs:36:15
|
LL | use b::b::foo::S as T;
| ^^^

error: aborting due to 4 previous errors
warning: this glob doesn't reexport anything because no canditate is public enough
--> $DIR/reexports.rs:11:17
|
LL | pub use super::*;
| ^^^^^^^^
|
note: lint level defined here
--> $DIR/reexports.rs:1:9
|
LL | #![warn(unused_imports)]
| ^^^^^^^^^^^^^^

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0364, E0603.
For more information about an error, try `rustc --explain E0364`.