Skip to content

Commit c54dfee

Browse files
committed
Auto merge of #93308 - matthiaskrgr:rollup-9tc73ft, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #93250 (Remove deduplication of early lints) - #93286 (Add white-space: nowrap to links in the sidebar) - #93291 (minor fix for #93231) - #93300 (make Windows abort_internal Miri-compatible) - #93303 (Fix ICE when parsing bad turbofish with lifetime argument) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 8cdb3cd + 086be2b commit c54dfee

31 files changed

+428
-46
lines changed

compiler/rustc_lint_defs/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ pub enum ExternDepSpec {
282282

283283
// This could be a closure, but then implementing derive trait
284284
// becomes hacky (and it gets allocated).
285-
#[derive(PartialEq, Debug)]
285+
#[derive(Debug)]
286286
pub enum BuiltinLintDiagnostics {
287287
Normal,
288288
AbsPathWithModule(Span),
@@ -309,7 +309,6 @@ pub enum BuiltinLintDiagnostics {
309309

310310
/// Lints that are buffered up early on in the `Session` before the
311311
/// `LintLevels` is calculated.
312-
#[derive(PartialEq)]
313312
pub struct BufferedEarlyLint {
314313
/// The span of code that we are linting on.
315314
pub span: MultiSpan,
@@ -336,9 +335,7 @@ pub struct LintBuffer {
336335
impl LintBuffer {
337336
pub fn add_early_lint(&mut self, early_lint: BufferedEarlyLint) {
338337
let arr = self.map.entry(early_lint.node_id).or_default();
339-
if !arr.contains(&early_lint) {
340-
arr.push(early_lint);
341-
}
338+
arr.push(early_lint);
342339
}
343340

344341
pub fn add_lint(

compiler/rustc_parse/src/parser/diagnostics.rs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -731,28 +731,22 @@ impl<'a> Parser<'a> {
731731
match x {
732732
Ok((_, _, false)) => {
733733
if self.eat(&token::Gt) {
734-
let turbo_err = e.span_suggestion_verbose(
734+
e.span_suggestion_verbose(
735735
binop.span.shrink_to_lo(),
736736
TURBOFISH_SUGGESTION_STR,
737737
"::".to_string(),
738738
Applicability::MaybeIncorrect,
739-
);
740-
if self.check(&TokenKind::Semi) {
741-
turbo_err.emit();
742-
*expr = self.mk_expr_err(expr.span);
743-
return Ok(());
744-
} else {
745-
match self.parse_expr() {
746-
Ok(_) => {
747-
turbo_err.emit();
748-
*expr = self
749-
.mk_expr_err(expr.span.to(self.prev_token.span));
750-
return Ok(());
751-
}
752-
Err(mut err) => {
753-
turbo_err.cancel();
754-
err.cancel();
755-
}
739+
)
740+
.emit();
741+
match self.parse_expr() {
742+
Ok(_) => {
743+
*expr =
744+
self.mk_expr_err(expr.span.to(self.prev_token.span));
745+
return Ok(());
746+
}
747+
Err(mut err) => {
748+
*expr = self.mk_expr_err(expr.span);
749+
err.cancel();
756750
}
757751
}
758752
}

compiler/rustc_parse/src/parser/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,7 @@ impl<'a> Parser<'a> {
14581458
self.parse_block_expr(label, lo, BlockCheckMode::Default, attrs)
14591459
} else if !ate_colon && (self.check(&TokenKind::Comma) || self.check(&TokenKind::Gt)) {
14601460
// We're probably inside of a `Path<'a>` that needs a turbofish, so suppress the
1461-
// "must be followed by a colon" error.
1461+
// "must be followed by a colon" error, and the "expected one of" error.
14621462
self.diagnostic().delay_span_bug(lo, "this label wasn't parsed correctly");
14631463
consume_colon = false;
14641464
Ok(self.mk_expr_err(lo))

library/std/src/sys/windows/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ pub fn dur2timeout(dur: Duration) -> c::DWORD {
285285
#[allow(unreachable_code)]
286286
pub fn abort_internal() -> ! {
287287
const FAST_FAIL_FATAL_APP_EXIT: usize = 7;
288+
#[cfg(not(miri))] // inline assembly does not work in Miri
288289
unsafe {
289290
cfg_if::cfg_if! {
290291
if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {

src/librustdoc/html/static/css/rustdoc.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,10 @@ nav.sub {
484484
overflow: hidden;
485485
}
486486

487+
.sidebar-links a {
488+
white-space: nowrap;
489+
}
490+
487491
.sidebar h2 {
488492
border-bottom: none;
489493
font-weight: 500;

src/librustdoc/html/static/css/themes/light.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ a.result-keyword:focus { background-color: #afc6e4; }
167167
.sidebar a.current.traitalias { color: #4b349e; }
168168
.sidebar a.current.fn,
169169
.sidebar a.current.method,
170-
.sidebar a.current.tymethod { color: #32d479; }
170+
.sidebar a.current.tymethod { color: #a67736; }
171171
.sidebar a.current.keyword { color: #356da4; }
172172

173173
nav.main .current {

src/test/rustdoc-gui/sidebar.goml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,7 @@ assert-text: (".sidebar > .location", "Module sub_sub_module")
7474
assert-false: ".sidebar-elems .crate"
7575
assert-text: (".sidebar-elems .items > ul > li:nth-child(1)", "Functions")
7676
assert-text: ("#functions + .item-table .item-left > a", "foo")
77+
78+
// Links to trait implementations in the sidebar should not wrap even if they are long.
79+
goto: file://|DOC_PATH|/lib2/struct.HasALongTraitWithParams.html
80+
assert-property: (".sidebar-links a", {"offsetHeight": 29})

src/test/rustdoc-gui/src/lib2/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,9 @@ pub mod too_long {
114114
pub fn foo(&self) {}
115115
}
116116
}
117+
118+
pub struct HasALongTraitWithParams {}
119+
120+
pub trait LongTraitWithParamsBananaBananaBanana<T> {}
121+
122+
impl LongTraitWithParamsBananaBananaBanana<usize> for HasALongTraitWithParams {}

src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
#![cfg_attr(foo, crate_type="bin")]
66
//~^ERROR `crate_type` within
77
//~| WARN this was previously accepted
8+
//~|ERROR `crate_type` within
9+
//~| WARN this was previously accepted
810
#![cfg_attr(foo, crate_name="bar")]
911
//~^ERROR `crate_name` within
1012
//~| WARN this was previously accepted
13+
//~|ERROR `crate_name` within
14+
//~| WARN this was previously accepted
1115

1216
fn main() {}

src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,31 @@ LL | #![deny(warnings)]
1414
= note: for more information, see issue #91632 <https://github.com/rust-lang/rust/issues/91632>
1515

1616
error: `crate_name` within an `#![cfg_attr] attribute is deprecated`
17-
--> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:8:18
17+
--> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:10:18
1818
|
1919
LL | #![cfg_attr(foo, crate_name="bar")]
2020
| ^^^^^^^^^^^^^^^^
2121
|
2222
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
2323
= note: for more information, see issue #91632 <https://github.com/rust-lang/rust/issues/91632>
2424

25-
error: aborting due to 2 previous errors
25+
error: `crate_type` within an `#![cfg_attr] attribute is deprecated`
26+
--> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:5:18
27+
|
28+
LL | #![cfg_attr(foo, crate_type="bin")]
29+
| ^^^^^^^^^^^^^^^^
30+
|
31+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
32+
= note: for more information, see issue #91632 <https://github.com/rust-lang/rust/issues/91632>
33+
34+
error: `crate_name` within an `#![cfg_attr] attribute is deprecated`
35+
--> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:10:18
36+
|
37+
LL | #![cfg_attr(foo, crate_name="bar")]
38+
| ^^^^^^^^^^^^^^^^
39+
|
40+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
41+
= note: for more information, see issue #91632 <https://github.com/rust-lang/rust/issues/91632>
42+
43+
error: aborting due to 4 previous errors
2644

0 commit comments

Comments
 (0)