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
19 commits
Select commit Hold shift + click to select a range
58f107a
Use TraitEngine in more places that don't specifically need Fulfillme…
compiler-errors Jul 26, 2022
254b89d
Recover from c++ style `enum struct`
obeis Jul 26, 2022
0ad06f1
Add ui test for #99625
obeis Jul 26, 2022
e98b0e8
Prevent ICE for doc_alias on match arm, statement, expression
hdelc Jul 30, 2022
f74d06c
NLL: relate closure to parent fn
aliemjay Jul 3, 2022
28f24eb
fix rustdoc regression
aliemjay Jul 3, 2022
6b37a79
Refactor `Display` impl for `Target` to `Target::name` method
hdelc Aug 2, 2022
c643007
Add exhaustive location checking for `doc_alias` attribute
hdelc Aug 2, 2022
1e8abe7
Make `Target::name` method pass by copy
hdelc Aug 2, 2022
16a3601
Delay a bug when failed to normalize trait ref during specialization
compiler-errors Jul 27, 2022
2be0094
Add items to `DocAliasBadLocation` check error match arm
hdelc Aug 3, 2022
78adc01
cosmetic changes
aliemjay Aug 3, 2022
78bbe57
Add support for link-flavor rust-lld for iOS, tvOS and watchOS
marysaka Jul 1, 2022
7b0360e
Rollup merge of #98771 - Thog:rust-lld-apple-target, r=petrochenkov
matthiaskrgr Aug 3, 2022
88e9417
Rollup merge of #98835 - aliemjay:relate_closure_substs, r=nikomatsakis
matthiaskrgr Aug 3, 2022
0de7f75
Rollup merge of #99746 - compiler-errors:more-trait-engine, r=jackh726
matthiaskrgr Aug 3, 2022
9c18fdc
Rollup merge of #99786 - obeis:issue-99625, r=compiler-errors
matthiaskrgr Aug 3, 2022
02fcec2
Rollup merge of #99795 - compiler-errors:delay-specialization-normali…
matthiaskrgr Aug 3, 2022
f8e6617
Rollup merge of #100029 - hdelc:master, r=cjgillot
matthiaskrgr Aug 3, 2022
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
Add items to DocAliasBadLocation check error match arm
- Added `Impl`, `Closure`, ForeignMod` targets
- `Target::name` changed for `Target::Impl`
- Error output for `Target::ForeignMod` changed to "foreign module"
  • Loading branch information
hdelc committed Aug 3, 2022
commit 2be00947bfbb7e31cd6a5b6cf1e9e2f0bc1c4da6
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl Target {
Target::Union => "union",
Target::Trait => "trait",
Target::TraitAlias => "trait alias",
Target::Impl => "item",
Target::Impl => "implementation block",
Target::Expression => "expression",
Target::Statement => "statement",
Target::Arm => "match arm",
Expand Down
10 changes: 6 additions & 4 deletions compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,6 @@ impl CheckAttrVisitor<'_> {

let span = meta.span();
if let Some(location) = match target {
Target::Impl => Some("implementation block"),
Target::ForeignMod => Some("extern block"),
Target::AssocTy => {
let parent_hir_id = self.tcx.hir().get_parent_item(hir_id);
let containing_item = self.tcx.hir().expect_item(parent_hir_id);
Expand All @@ -619,13 +617,17 @@ impl CheckAttrVisitor<'_> {
}
// we check the validity of params elsewhere
Target::Param => return false,
Target::Expression | Target::Statement | Target::Arm => Some(target.name()),
Target::Expression
| Target::Statement
| Target::Arm
| Target::ForeignMod
| Target::Closure
| Target::Impl => Some(target.name()),
Target::ExternCrate
| Target::Use
| Target::Static
| Target::Const
| Target::Fn
| Target::Closure
| Target::Mod
| Target::GlobalAsm
| Target::TyAlias
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/check-doc-alias-attr-location.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: `#[doc(alias = "...")]` isn't allowed on extern block
error: `#[doc(alias = "...")]` isn't allowed on foreign module
--> $DIR/check-doc-alias-attr-location.rs:7:7
|
LL | #[doc(alias = "foo")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ note: the lint level is defined here
LL | #![warn(unused_attributes, unknown_lints)]
| ^^^^^^^^^^^^^^^^^

warning: `#[automatically_derived]` only has an effect on items
warning: `#[automatically_derived]` only has an effect on implementation blocks
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:266:1
|
LL | #[automatically_derived]
Expand Down Expand Up @@ -515,25 +515,25 @@ warning: `#[path]` only has an effect on modules
LL | #[path = "3800"] impl S { }
| ^^^^^^^^^^^^^^^^

warning: `#[automatically_derived]` only has an effect on items
warning: `#[automatically_derived]` only has an effect on implementation blocks
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:269:17
|
LL | mod inner { #![automatically_derived] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^

warning: `#[automatically_derived]` only has an effect on items
warning: `#[automatically_derived]` only has an effect on implementation blocks
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:272:5
|
LL | #[automatically_derived] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^

warning: `#[automatically_derived]` only has an effect on items
warning: `#[automatically_derived]` only has an effect on implementation blocks
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:275:5
|
LL | #[automatically_derived] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^

warning: `#[automatically_derived]` only has an effect on items
warning: `#[automatically_derived]` only has an effect on implementation blocks
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:278:5
|
LL | #[automatically_derived] type T = S;
Expand Down Expand Up @@ -923,7 +923,7 @@ warning: `#[must_use]` has no effect when applied to a type alias
LL | #[must_use] type T = S;
| ^^^^^^^^^^^

warning: `#[must_use]` has no effect when applied to an item
warning: `#[must_use]` has no effect when applied to an implementation block
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:614:5
|
LL | #[must_use] impl S { }
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/lint/unused/unused_attributes-must_use.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ error: `#[must_use]` has no effect when applied to a static item
LL | #[must_use]
| ^^^^^^^^^^^

error: `#[must_use]` has no effect when applied to an item
error: `#[must_use]` has no effect when applied to an implementation block
--> $DIR/unused_attributes-must_use.rs:33:1
|
LL | #[must_use]
Expand All @@ -69,7 +69,7 @@ error: `#[must_use]` has no effect when applied to a type parameter
LL | fn qux<#[must_use] T>(_: T) {}
| ^^^^^^^^^^^

error: `#[must_use]` has no effect when applied to an item
error: `#[must_use]` has no effect when applied to an implementation block
--> $DIR/unused_attributes-must_use.rs:79:1
|
LL | #[must_use]
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rustdoc/check-doc-alias-attr-location.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed
LL | fn foo(#[doc(alias = "qux")] _x: u32) -> Self::X {
| ^^^^^^^^^^^^^^^^^^^^^

error: `#[doc(alias = "...")]` isn't allowed on extern block
error: `#[doc(alias = "...")]` isn't allowed on foreign module
--> $DIR/check-doc-alias-attr-location.rs:9:7
|
LL | #[doc(alias = "foo")]
Expand Down