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 9 pull requests #120412

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
853504d
Remove feature not required by `Ipv6Addr::to_cononical` doctest
eopb Jan 5, 2024
f1b508c
fix: correct suggestion arg for impl trait
Young-Flash Jan 14, 2024
c0a5a85
test: add test case for impl trait arg suggestion
Young-Flash Jan 14, 2024
f9259d1
Boost intersperse(_with) performance
nyurik May 9, 2023
b8d245e
Postpone .next() call until iteration
nyurik May 9, 2023
f1dbc7b
fmt
nyurik May 9, 2023
8cbff0b
Update library/core/src/iter/adapters/intersperse.rs
nyurik Jan 26, 2024
77f31ef
use checked_add for upper bound
nyurik Jan 26, 2024
bdf7404
Update codegen test for LLVM 18
nikic Jan 26, 2024
90254cd
ScopeTree: remove destruction_scopes as unused
klensy Jan 26, 2024
304361a
Improve handling of numbers in IntoDiagnosticArg
Urgau Jan 26, 2024
93ff4a4
Fix typo
Urgau Jan 26, 2024
169c728
Remove myself from review rotation
thomcc Jan 26, 2024
a5d9def
Properly recover from trailing attr in body
estebank Nov 22, 2023
3022c76
Avoid ICE in trait without `dyn` lint
estebank Jan 23, 2024
8b3a681
minor: pick a suitable var name
Young-Flash Jan 27, 2024
4eb7ced
Rollup merge of #111379 - nyurik:intersperse-speed-up, r=cuviper
Nadrieril Jan 27, 2024
a542c31
Rollup merge of #118182 - estebank:issue-118164, r=davidtwco
Nadrieril Jan 27, 2024
dfb0be0
Rollup merge of #119641 - eopb:std-unused-ip-feature, r=ChrisDenton
Nadrieril Jan 27, 2024
5803376
Rollup merge of #119957 - Young-Flash:fix, r=fmease
Nadrieril Jan 27, 2024
60a72b6
Rollup merge of #120275 - estebank:issue-120241, r=fmease
Nadrieril Jan 27, 2024
1ef085f
Rollup merge of #120376 - nikic:update-codegen-test, r=cuviper
Nadrieril Jan 27, 2024
23fc765
Rollup merge of #120386 - klensy:destruction_scopes, r=compiler-errors
Nadrieril Jan 27, 2024
b581edf
Rollup merge of #120398 - Urgau:into_diag_arg-numbers, r=compiler-errors
Nadrieril Jan 27, 2024
cb55493
Rollup merge of #120399 - thomcc:thomcc-no-rotation, r=Nilstrieb
Nadrieril Jan 27, 2024
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
19 changes: 17 additions & 2 deletions compiler/rustc_parse/src/parser/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,13 +791,28 @@ impl<'a> Parser<'a> {
&& let [segment] = &attr_kind.item.path.segments[..]
&& segment.ident.name == sym::cfg
&& let Some(args_span) = attr_kind.item.args.span()
&& let Ok(next_attr) = snapshot.parse_attribute(InnerAttrPolicy::Forbidden(None))
&& let next_attr = match snapshot.parse_attribute(InnerAttrPolicy::Forbidden(None))
{
Ok(next_attr) => next_attr,
Err(inner_err) => {
err.cancel();
inner_err.cancel();
return;
}
}
&& let ast::AttrKind::Normal(next_attr_kind) = next_attr.kind
&& let Some(next_attr_args_span) = next_attr_kind.item.args.span()
&& let [next_segment] = &next_attr_kind.item.path.segments[..]
&& segment.ident.name == sym::cfg
&& let Ok(next_expr) = snapshot.parse_expr()
{
let next_expr = match snapshot.parse_expr() {
Ok(next_expr) => next_expr,
Err(inner_err) => {
err.cancel();
inner_err.cancel();
return;
}
};
// We have for sure
// #[cfg(..)]
// expr
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Issue #118164: recovery path leaving unemitted error behind
fn bar() -> String {
#[cfg(feature = )]
[1, 2, 3].iter().map().collect::<String>() //~ ERROR expected `;`, found `#`
#[attr] //~ ERROR expected statement after outer attribute
}
fn main() {
let _ = bar();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
error: expected `;`, found `#`
--> $DIR/properly-recover-from-trailing-outer-attribute-in-body.rs:4:47
|
LL | #[cfg(feature = )]
| ------------------ only `;` terminated statements or tail expressions are allowed after this attribute
LL | [1, 2, 3].iter().map().collect::<String>()
| ^ expected `;` here
LL | #[attr]
| - unexpected token
|
help: add `;` here
|
LL | [1, 2, 3].iter().map().collect::<String>();
| +
help: alternatively, consider surrounding the expression with a block
|
LL | { [1, 2, 3].iter().map().collect::<String>() }
| + +

error: expected statement after outer attribute
--> $DIR/properly-recover-from-trailing-outer-attribute-in-body.rs:5:5
|
LL | #[attr]
| ^^^^^^^

error: aborting due to 2 previous errors