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

+2-5
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

+12-18
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

+1-1
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

+1
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

+4
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

+1-1
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

+4
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

+6
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

+4
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

+20-2
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

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
f<'a,>
3+
//~^ ERROR expected
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error: expected one of `.`, `:`, `;`, `?`, `for`, `loop`, `while`, `{`, `}`, or an operator, found `,`
2+
--> $DIR/issue-93282.rs:2:9
3+
|
4+
LL | f<'a,>
5+
| ^ expected one of 10 possible tokens
6+
|
7+
help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
8+
|
9+
LL | f::<'a,>
10+
| ++
11+
12+
error: aborting due to previous error
13+

src/test/ui/proc-macro/issue-73933-procedural-masquerade.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44
extern crate test_macros;
55

66
#[derive(Print)]
7-
enum ProceduralMasqueradeDummyType { //~ ERROR using
7+
enum ProceduralMasqueradeDummyType {
8+
//~^ ERROR using
9+
//~| WARN this was previously
10+
//~| ERROR using
11+
//~| WARN this was previously
12+
//~| ERROR using
13+
//~| WARN this was previously
14+
//~| ERROR using
815
//~| WARN this was previously
916
Input
1017
}

src/test/ui/proc-macro/issue-73933-procedural-masquerade.stderr

+64-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,37 @@ LL | enum ProceduralMasqueradeDummyType {
99
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
1010
= note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
1111

12-
error: aborting due to previous error
12+
error: using `procedural-masquerade` crate
13+
--> $DIR/issue-73933-procedural-masquerade.rs:7:6
14+
|
15+
LL | enum ProceduralMasqueradeDummyType {
16+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17+
|
18+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
19+
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
20+
= note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
21+
22+
error: using `procedural-masquerade` crate
23+
--> $DIR/issue-73933-procedural-masquerade.rs:7:6
24+
|
25+
LL | enum ProceduralMasqueradeDummyType {
26+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27+
|
28+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
29+
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
30+
= note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
31+
32+
error: using `procedural-masquerade` crate
33+
--> $DIR/issue-73933-procedural-masquerade.rs:7:6
34+
|
35+
LL | enum ProceduralMasqueradeDummyType {
36+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37+
|
38+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
39+
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
40+
= note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
41+
42+
error: aborting due to 4 previous errors
1343

1444
Future incompatibility report: Future breakage diagnostic:
1545
error: using `procedural-masquerade` crate
@@ -23,3 +53,36 @@ LL | enum ProceduralMasqueradeDummyType {
2353
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
2454
= note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
2555

56+
Future breakage diagnostic:
57+
error: using `procedural-masquerade` crate
58+
--> $DIR/issue-73933-procedural-masquerade.rs:7:6
59+
|
60+
LL | enum ProceduralMasqueradeDummyType {
61+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62+
|
63+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
64+
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
65+
= note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
66+
67+
Future breakage diagnostic:
68+
error: using `procedural-masquerade` crate
69+
--> $DIR/issue-73933-procedural-masquerade.rs:7:6
70+
|
71+
LL | enum ProceduralMasqueradeDummyType {
72+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
73+
|
74+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
75+
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
76+
= note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
77+
78+
Future breakage diagnostic:
79+
error: using `procedural-masquerade` crate
80+
--> $DIR/issue-73933-procedural-masquerade.rs:7:6
81+
|
82+
LL | enum ProceduralMasqueradeDummyType {
83+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84+
|
85+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
86+
= note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
87+
= note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
88+

src/test/ui/proc-macro/issue-73933-procedural-masquerade.stdout

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
1414
stream: TokenStream [
1515
Ident {
1616
ident: "Input",
17-
span: #0 bytes(173..178),
17+
span: #0 bytes(315..320),
1818
},
1919
],
20-
span: #0 bytes(121..180),
20+
span: #0 bytes(121..322),
2121
},
2222
]

src/test/ui/proc-macro/issue-75930-derive-cfg.stderr

+13-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,17 @@ LL | #[derive(Print)]
1111
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
1212
= note: for more information, see issue #79202 <https://github.com/rust-lang/rust/issues/79202>
1313

14-
warning: 1 warning emitted
14+
warning: derive helper attribute is used before it is introduced
15+
--> $DIR/issue-75930-derive-cfg.rs:19:3
16+
|
17+
LL | #[print_helper(a)]
18+
| ^^^^^^^^^^^^
19+
...
20+
LL | #[derive(Print)]
21+
| ----- the attribute is introduced here
22+
|
23+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
24+
= note: for more information, see issue #79202 <https://github.com/rust-lang/rust/issues/79202>
25+
26+
warning: 2 warnings emitted
1527

src/test/ui/rust-2018/edition-lint-nested-empty-paths.fixed

+14
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,28 @@ crate mod foo {
1717
use crate::foo::{bar::{baz::{}}};
1818
//~^ ERROR absolute paths must start with
1919
//~| WARN this is accepted in the current edition
20+
//~| ERROR absolute paths must start with
21+
//~| WARN this is accepted in the current edition
2022

2123
use crate::foo::{bar::{XX, baz::{}}};
2224
//~^ ERROR absolute paths must start with
2325
//~| WARN this is accepted in the current edition
26+
//~| ERROR absolute paths must start with
27+
//~| WARN this is accepted in the current edition
28+
//~| ERROR absolute paths must start with
29+
//~| WARN this is accepted in the current edition
30+
//~| ERROR absolute paths must start with
31+
//~| WARN this is accepted in the current edition
2432

2533
use crate::foo::{bar::{baz::{}, baz1::{}}};
2634
//~^ ERROR absolute paths must start with
2735
//~| WARN this is accepted in the current edition
36+
//~| ERROR absolute paths must start with
37+
//~| WARN this is accepted in the current edition
38+
//~| ERROR absolute paths must start with
39+
//~| WARN this is accepted in the current edition
40+
//~| ERROR absolute paths must start with
41+
//~| WARN this is accepted in the current edition
2842

2943
fn main() {
3044
}

src/test/ui/rust-2018/edition-lint-nested-empty-paths.rs

+14
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,28 @@ crate mod foo {
1717
use foo::{bar::{baz::{}}};
1818
//~^ ERROR absolute paths must start with
1919
//~| WARN this is accepted in the current edition
20+
//~| ERROR absolute paths must start with
21+
//~| WARN this is accepted in the current edition
2022

2123
use foo::{bar::{XX, baz::{}}};
2224
//~^ ERROR absolute paths must start with
2325
//~| WARN this is accepted in the current edition
26+
//~| ERROR absolute paths must start with
27+
//~| WARN this is accepted in the current edition
28+
//~| ERROR absolute paths must start with
29+
//~| WARN this is accepted in the current edition
30+
//~| ERROR absolute paths must start with
31+
//~| WARN this is accepted in the current edition
2432

2533
use foo::{bar::{baz::{}, baz1::{}}};
2634
//~^ ERROR absolute paths must start with
2735
//~| WARN this is accepted in the current edition
36+
//~| ERROR absolute paths must start with
37+
//~| WARN this is accepted in the current edition
38+
//~| ERROR absolute paths must start with
39+
//~| WARN this is accepted in the current edition
40+
//~| ERROR absolute paths must start with
41+
//~| WARN this is accepted in the current edition
2842

2943
fn main() {
3044
}

0 commit comments

Comments
 (0)