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 @@ -217,7 +217,14 @@ impl<S: Stage> OnDuplicate<S> {
217217// them will be merged in another PR
218218#[ allow( unused) ]
219219pub ( crate ) enum AttributeOrder {
220- /// Duplicates after the first attribute will be an error.
220+ /// Duplicates after the first attribute will be an error. I.e. only keep the lowest attribute.
221+ ///
222+ /// Attributes are processed from bottom to top, so this raises an error on all the attributes
223+ /// further above the lowest one:
224+ /// ```
225+ /// #[stable(since="1.0")] //~ WARNING duplicated attribute
226+ /// #[stable(since="2.0")]
227+ /// ```
221228 ///
222229 /// This should be used where duplicates would be ignored, but carry extra
223230 /// meaning that could cause confusion. For example, `#[stable(since="1.0")]
@@ -227,6 +234,13 @@ pub(crate) enum AttributeOrder {
227234 /// Duplicates preceding the last instance of the attribute will be a
228235 /// warning, with a note that this will be an error in the future.
229236 ///
237+ /// Attributes are processed from bottom to top, so this raises a warning on all the attributes
238+ /// below the higher one:
239+ /// ```
240+ /// #[path="foo.rs"]
241+ /// #[path="bar.rs"] //~ WARNING duplicated attribute
242+ /// ```
243+ ///
230244 /// This is the same as `FutureWarnFollowing`, except the last attribute is
231245 /// the one that is "used". Ideally these can eventually migrate to
232246 /// `ErrorPreceding`.
You can’t perform that action at this time.
0 commit comments