Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #100120

Merged
merged 19 commits into from
Aug 4, 2022
Merged
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
Prevent ICE for doc_alias on match arm, statement, expression
hdelc committed Aug 1, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit e98b0e8ee7d3ab6273625049e3e23118a0f15813
3 changes: 3 additions & 0 deletions compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
@@ -619,6 +619,9 @@ impl CheckAttrVisitor<'_> {
}
// we check the validity of params elsewhere
Target::Param => return false,
Target::Expression => Some("expression"),
Target::Statement => Some("statement"),
Target::Arm => Some("match arm"),
_ => None,
} {
tcx.sess.emit_err(errors::DocAliasBadLocation { span, attr_str, location });
8 changes: 7 additions & 1 deletion src/test/ui/rustdoc/check-doc-alias-attr-location.rs
Original file line number Diff line number Diff line change
@@ -21,6 +21,12 @@ impl Foo for Bar {
type X = i32;
fn foo(#[doc(alias = "qux")] _x: u32) -> Self::X {
//~^ ERROR
0
#[doc(alias = "stmt")] //~ ERROR
let x = 0;
#[doc(alias = "expr")] //~ ERROR
match x {
#[doc(alias = "arm")] //~ ERROR
_ => 0
}
}
}
20 changes: 19 additions & 1 deletion src/test/ui/rustdoc/check-doc-alias-attr-location.stderr
Original file line number Diff line number Diff line change
@@ -28,5 +28,23 @@ error: `#[doc(alias = "...")]` isn't allowed on type alias in implementation blo
LL | #[doc(alias = "assoc")]
| ^^^^^^^^^^^^^^^

error: aborting due to 5 previous errors
error: `#[doc(alias = "...")]` isn't allowed on statement
--> $DIR/check-doc-alias-attr-location.rs:24:15
|
LL | #[doc(alias = "stmt")]
| ^^^^^^^^^^^^^^

error: `#[doc(alias = "...")]` isn't allowed on expression
--> $DIR/check-doc-alias-attr-location.rs:26:15
|
LL | #[doc(alias = "expr")]
| ^^^^^^^^^^^^^^

error: `#[doc(alias = "...")]` isn't allowed on match arm
--> $DIR/check-doc-alias-attr-location.rs:28:19
|
LL | #[doc(alias = "arm")]
| ^^^^^^^^^^^^^

error: aborting due to 8 previous errors