File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,6 @@ use profile::Count;
2121use rustc_hash:: FxHashMap ;
2222use syntax:: { ast, AstNode , AstPtr } ;
2323
24- pub use lower:: LowerCtx ;
25-
2624use crate :: {
2725 attr:: { Attrs , RawAttrs } ,
2826 db:: DefDatabase ,
@@ -35,6 +33,8 @@ use crate::{
3533 UnresolvedMacro ,
3634} ;
3735
36+ pub use lower:: LowerCtx ;
37+
3838/// A subset of Expander that only deals with cfg attributes. We only need it to
3939/// avoid cyclic queries in crate def map during enum processing.
4040#[ derive( Debug ) ]
Original file line number Diff line number Diff line change @@ -6,14 +6,13 @@ mod text_token_source;
66mod text_tree_sink;
77mod reparsing;
88
9- use crate :: { syntax_node :: GreenNode , AstNode , SyntaxError , SyntaxNode } ;
9+ use parser :: SyntaxKind ;
1010use text_token_source:: TextTokenSource ;
1111use text_tree_sink:: TextTreeSink ;
1212
13- pub ( crate ) use lexer :: * ;
13+ use crate :: { syntax_node :: GreenNode , AstNode , SyntaxError , SyntaxNode } ;
1414
15- pub ( crate ) use self :: reparsing:: incremental_reparse;
16- use parser:: SyntaxKind ;
15+ pub ( crate ) use crate :: parsing:: { lexer:: * , reparsing:: incremental_reparse} ;
1716
1817pub ( crate ) fn parse_text ( text : & str ) -> ( GreenNode , Vec < SyntaxError > ) {
1918 let ( tokens, lexer_errors) = tokenize ( & text) ;
Original file line number Diff line number Diff line change @@ -636,6 +636,10 @@ use crate::{}
636636
637637// Finally, parent and child modules, but prefer `use crate::`.
638638use super :: {}
639+
640+ // Re-exports are treated as item definitions rather than imports, so they go
641+ // after imports and modules. Use them sparingly.
642+ pub use crate :: x :: Z ;
639643```
640644
641645** Rationale:** consistency.
@@ -694,6 +698,9 @@ Avoid local `use MyEnum::*` imports.
694698Prefer ` use crate::foo::bar ` to ` use super::bar ` or ` use self::bar::baz ` .
695699** Rationale:** consistency, this is the style which works in all cases.
696700
701+ By default, avoid re-exports.
702+ ** Rationale:** for non-library code, re-exports introduce two ways to use something and allow for inconsistency.
703+
697704## Order of Items
698705
699706Optimize for the reader who sees the file for the first time, and wants to get a general idea about what's going on.
You can’t perform that action at this time.
0 commit comments