@@ -8,9 +8,6 @@ Make name and behavior of the `#![no_std]` and `#![no_implicit_prelude]` attribu
88consistent by renaming the latter to ` #![no_prelude] `  and having it only apply to the current
99module.
1010
11- Optionally add a ` #[deep(...)] `  attribute for deeply applying an attribute to each module as
12- composable replacement for the old behavior.
13- 
1411# Motivation  
1512
1613Currently, Rust automatically inserts an implicit ` extern crate std; `  in the crate root that can be
@@ -52,12 +49,9 @@ mod my_iter {
5249While such use cases might be resolved by just requiring an explicit ` use std::prelude::*; ` 
5350in the submodules, it seems like just making the attribute behave as expected is the better outcome.
5451
55- However, for the cases where you want the prelude disabled for a whole sub tree of modules, it would
56- become necessary to add a ` #[no_prelude] `  attribute for each module in it.
57- 
58- And if the use case of deeply removing the prelude imports is still important enough to support,
59- it could be better resolved by providing a general ` #[deep(...)] `  attribute, that just replicates an
60- given attribute recursively, making the old behavior recoverable as ` #[deep(no_prelude)] ` .
52+ Of course, for the cases where you want the prelude disabled for a whole sub tree of modules, it
53+ would now become necessary to add a ` #[no_prelude] `  attribute in each of them - but that
54+ is consistent with imports in general.
6155
6256# Detailed design  
6357
@@ -71,11 +65,6 @@ changed to `#[no_prelude]` in both the main code base, and user code.
7165
7266Finally, the old attribute name should emit a deprecated warning, and be removed in time.
7367
74- If ` #[deep(...)] `  ends up being implemented, it would be added to syntax as an item modifier
75- for module items that first expands the module it is applied too, and then recursively inserts the
76- passed ` #[...] `  attribute into each module AST node it contains. (This could probably live on
77- crates.io, though)
78- 
7968# Drawbacks  
8069
8170-  The attribute is a rare use case to begin with, so any effort put into this would
@@ -85,8 +74,5 @@ crates.io, though)
8574
8675 -  Keep the current behavior
8776 -  Remove the ` #[no_implicit_prelude] `  attribute all together, instead forcing users to use
88-    ` #[no_std] `  in combination with ` extern crate std; `  and ` use std::prelude::* ` 
89- 
90- # Unresolved questions  
91- 
92- Should the ` #[deep(...)] `  be included or not?
77+    ` #[no_std] `  in combination with ` extern crate std; `  and ` use std::prelude::* ` .
78+  -  Generalize preludes more to allow custom ones, which might superseed the attributes from this RFC.
0 commit comments