File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
compiler/rustc_attr_parsing/src/attributes Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -218,7 +218,14 @@ impl<S: Stage> OnDuplicate<S> {
218
218
// them will be merged in another PR
219
219
#[ allow( unused) ]
220
220
pub ( crate ) enum AttributeOrder {
221
- /// Duplicates after the first attribute will be an error.
221
+ /// Duplicates after the first attribute will be an error. I.e. only keep the lowest attribute.
222
+ ///
223
+ /// Attributes are processed from bottom to top, so this raises an error on all the attributes
224
+ /// further above the lowest one:
225
+ /// ```
226
+ /// #[stable(since="1.0")] //~ WARNING duplicated attribute
227
+ /// #[stable(since="2.0")]
228
+ /// ```
222
229
///
223
230
/// This should be used where duplicates would be ignored, but carry extra
224
231
/// meaning that could cause confusion. For example, `#[stable(since="1.0")]
@@ -228,6 +235,13 @@ pub(crate) enum AttributeOrder {
228
235
/// Duplicates preceding the last instance of the attribute will be a
229
236
/// warning, with a note that this will be an error in the future.
230
237
///
238
+ /// Attributes are processed from bottom to top, so this raises a warning on all the attributes
239
+ /// below the higher one:
240
+ /// ```
241
+ /// #[path="foo.rs"]
242
+ /// #[path="bar.rs"] //~ WARNING duplicated attribute
243
+ /// ```
244
+ ///
231
245
/// This is the same as `FutureWarnFollowing`, except the last attribute is
232
246
/// the one that is "used". Ideally these can eventually migrate to
233
247
/// `ErrorPreceding`.
You can’t perform that action at this time.
0 commit comments