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 14 pull requests #101544

Merged
merged 30 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
dd89792
Add -api-level to pm command
diminishedprime Sep 2, 2022
46130a1
Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTH
JakobDegen Sep 5, 2022
056d633
Update src/doc/rustc/src/platform-support/fuchsia.md
diminishedprime Sep 6, 2022
2166a36
Pass ImplTraitContext as &mut to avoid the need of ImplTraitContext::…
spastorino Sep 2, 2022
7ac1248
do not suggest a semicolon for a macro without `!`
TaKO8Ki Sep 6, 2022
71b40b9
rustdoc: remove unused CSS `#main-content > .since`
notriddle Sep 6, 2022
1c8de17
Rustdoc-Json: More accurate struct type.
aDotInTheVoid Sep 7, 2022
9cef1ee
Fix typo in pass_manager.rs
eltociear Sep 7, 2022
dfbc1f7
stdio: Document no support for writing to non-blocking stdio/stderr
uarif1 Sep 4, 2022
88fa621
Add documentation for Attr::is_doc_comment
GuillaumeGomez Sep 7, 2022
210c851
rustdoc: remove unused mobile CSS `.rustdoc { flex-direction }`
notriddle Sep 7, 2022
e3a738a
Add instrument and debug calls
spastorino Sep 6, 2022
d42afd2
Format hir_id_validator error using pretty print
spastorino Sep 6, 2022
dc2af5f
Fix error printing mistake in tidy
est31 Sep 7, 2022
10fc2ff
rustdoc: remove unused CSS `.content .methods > div`
notriddle Sep 7, 2022
43681db
rustdoc: remove unused CSS `#main-content > table td`
notriddle Sep 6, 2022
870a46d
Rollup merge of #101343 - diminishedprime:patch-3, r=tmandry
matthiaskrgr Sep 7, 2022
d1ebba4
Rollup merge of #101416 - uarif1:doc_non_blocking_stdio, r=joshtriplett
matthiaskrgr Sep 7, 2022
1d65e96
Rollup merge of #101435 - JakobDegen:bitwidth-tests, r=wesleywiser
matthiaskrgr Sep 7, 2022
9361297
Rollup merge of #101493 - spastorino:borrow-mut-impl-trait-context, r…
matthiaskrgr Sep 7, 2022
c365ce3
Rollup merge of #101502 - TaKO8Ki:do-not-suggest-semicolon-for-macro-…
matthiaskrgr Sep 7, 2022
0a1c816
Rollup merge of #101503 - spastorino:add-debug-calls, r=compiler-errors
matthiaskrgr Sep 7, 2022
46fe72b
Rollup merge of #101506 - notriddle:notriddle/rustdoc-main-since-2, r…
matthiaskrgr Sep 7, 2022
fbae06e
Rollup merge of #101507 - notriddle:notriddle/main-content-table-td, …
matthiaskrgr Sep 7, 2022
8d21e97
Rollup merge of #101521 - aDotInTheVoid:rdj-structkind, r=GuillaumeGomez
matthiaskrgr Sep 7, 2022
acb3d11
Rollup merge of #101525 - eltociear:patch-16, r=cjgillot
matthiaskrgr Sep 7, 2022
09e7bb4
Rollup merge of #101534 - rust-lang:notriddle/rustdoc-flex-direction,…
matthiaskrgr Sep 7, 2022
497e170
Rollup merge of #101535 - est31:tidy_error_fix, r=Mark-Simulacrum
matthiaskrgr Sep 7, 2022
41e1830
Rollup merge of #101536 - GuillaumeGomez:is_doc_comment-doc, r=lqd
matthiaskrgr Sep 7, 2022
eae48c3
Rollup merge of #101538 - notriddle:notriddle/content-methods-div, r=…
matthiaskrgr Sep 7, 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
2 changes: 2 additions & 0 deletions compiler/rustc_ast/src/attr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ impl AttrItem {
}

impl Attribute {
/// Returns `true` if it is a sugared doc comment (`///` or `//!` for example).
/// So `#[doc = "doc"]` will return `false`.
pub fn is_doc_comment(&self) -> bool {
match self.kind {
AttrKind::Normal(..) => false,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_lowering/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
&sym.qself,
&sym.path,
ParamMode::Optional,
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
&mut ImplTraitContext::Disallowed(ImplTraitPosition::Path),
);
hir::InlineAsmOperand::SymStatic { path, def_id }
} else {
Expand Down
7 changes: 3 additions & 4 deletions compiler/rustc_ast_lowering/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
}

fn lower_local(&mut self, l: &Local) -> &'hir hir::Local<'hir> {
let ty = l
.ty
.as_ref()
.map(|t| self.lower_ty(t, ImplTraitContext::Disallowed(ImplTraitPosition::Variable)));
let ty = l.ty.as_ref().map(|t| {
self.lower_ty(t, &mut ImplTraitContext::Disallowed(ImplTraitPosition::Variable))
});
let init = l.kind.init().map(|init| self.lower_expr(init));
let hir_id = self.lower_node_id(l.id);
let pat = self.lower_pat(&l.pat);
Expand Down
34 changes: 18 additions & 16 deletions compiler/rustc_ast_lowering/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
seg,
ParamMode::Optional,
ParenthesizedGenericArgs::Err,
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
&mut ImplTraitContext::Disallowed(ImplTraitPosition::Path),
));
let receiver = self.lower_expr(receiver);
let args =
Expand All @@ -89,14 +89,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
}
ExprKind::Cast(ref expr, ref ty) => {
let expr = self.lower_expr(expr);
let ty =
self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Type));
let ty = self
.lower_ty(ty, &mut ImplTraitContext::Disallowed(ImplTraitPosition::Type));
hir::ExprKind::Cast(expr, ty)
}
ExprKind::Type(ref expr, ref ty) => {
let expr = self.lower_expr(expr);
let ty =
self.lower_ty(ty, ImplTraitContext::Disallowed(ImplTraitPosition::Type));
let ty = self
.lower_ty(ty, &mut ImplTraitContext::Disallowed(ImplTraitPosition::Type));
hir::ExprKind::Type(expr, ty)
}
ExprKind::AddrOf(k, m, ref ohs) => {
Expand Down Expand Up @@ -219,7 +219,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
qself,
path,
ParamMode::Optional,
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
&mut ImplTraitContext::Disallowed(ImplTraitPosition::Path),
);
hir::ExprKind::Path(qpath)
}
Expand Down Expand Up @@ -253,7 +253,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
&se.qself,
&se.path,
ParamMode::Optional,
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
&mut ImplTraitContext::Disallowed(ImplTraitPosition::Path),
)),
self.arena
.alloc_from_iter(se.fields.iter().map(|x| self.lower_expr_field(x))),
Expand Down Expand Up @@ -550,12 +550,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
async_gen_kind: hir::AsyncGeneratorKind,
body: impl FnOnce(&mut Self) -> hir::Expr<'hir>,
) -> hir::ExprKind<'hir> {
let output = match ret_ty {
Some(ty) => hir::FnRetTy::Return(
self.lower_ty(&ty, ImplTraitContext::Disallowed(ImplTraitPosition::AsyncBlock)),
),
None => hir::FnRetTy::DefaultReturn(self.lower_span(span)),
};
let output =
match ret_ty {
Some(ty) => hir::FnRetTy::Return(self.lower_ty(
&ty,
&mut ImplTraitContext::Disallowed(ImplTraitPosition::AsyncBlock),
)),
None => hir::FnRetTy::DefaultReturn(self.lower_span(span)),
};

// Resume argument type. We let the compiler infer this to simplify the lowering. It is
// fully constrained by `future::from_generator`.
Expand Down Expand Up @@ -1123,7 +1125,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
qself,
path,
ParamMode::Optional,
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
&mut ImplTraitContext::Disallowed(ImplTraitPosition::Path),
);
// Destructure like a tuple struct.
let tuple_struct_pat =
Expand All @@ -1139,7 +1141,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
qself,
path,
ParamMode::Optional,
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
&mut ImplTraitContext::Disallowed(ImplTraitPosition::Path),
);
// Destructure like a unit struct.
let unit_struct_pat = hir::PatKind::Path(qpath);
Expand All @@ -1163,7 +1165,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
&se.qself,
&se.path,
ParamMode::Optional,
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
&mut ImplTraitContext::Disallowed(ImplTraitPosition::Path),
);
let fields_omitted = match &se.rest {
StructRest::Base(e) => {
Expand Down
Loading