Skip to content

Commit e7efdf1

Browse files
committed
Auto merge of #62542 - Centril:rollup-5mpb8tu, r=Centril
Rollup of 9 pull requests Successful merges: - #62417 (Fix ICEs when `Self` is used in type aliases) - #62450 (Raise the default recursion limit to 128) - #62470 (Prevent shrinking of "crate select" element on Firefox) - #62515 (cli: make help output for -l and -L consistent) - #62520 (Regression test for issue 42574.) - #62526 (normalize use of backticks in compiler messages for libsyntax/feature_gate.rs) - #62527 (clarify that debug_assert does not completely omits the code) - #62535 (ci: Configure $CI_JOB_NAME correctly) - #62541 (Add spastorino for rustc-guide toolstate) Failed merges: r? @ghost
2 parents 0b680cf + e8cf614 commit e7efdf1

File tree

254 files changed

+1195
-757
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+1195
-757
lines changed

.azure-pipelines/steps/run.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ steps:
100100

101101
# Configure our CI_JOB_NAME variable which log analyzers can use for the main
102102
# step to see what's going on.
103-
- bash: echo "##vso[task.setvariable variable=CI_JOB_NAME]$SYSTEM_JOBNAME"
103+
- bash: |
104+
builder=$(echo $AGENT_JOBNAME | cut -d ' ' -f 2)
105+
echo "##vso[task.setvariable variable=CI_JOB_NAME]$builder"
104106
displayName: Configure Job Name
105107

106108
# As a quick smoke check on the otherwise very fast mingw-check linux builder

src/bootstrap/lib.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@ pub struct Compiler {
197197

198198
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
199199
pub enum DocTests {
200-
// Default, run normal tests and doc tests.
200+
/// Run normal tests and doc tests (default).
201201
Yes,
202-
// Do not run any doc tests.
202+
/// Do not run any doc tests.
203203
No,
204-
// Only run doc tests.
204+
/// Only run doc tests.
205205
Only,
206206
}
207207

@@ -221,10 +221,10 @@ pub enum GitRepo {
221221
/// methods specifically on this structure itself (to make it easier to
222222
/// organize).
223223
pub struct Build {
224-
// User-specified configuration via config.toml
224+
/// User-specified configuration from `config.toml`.
225225
config: Config,
226226

227-
// Derived properties from the above two configurations
227+
// Properties derived from the above configuration
228228
src: PathBuf,
229229
out: PathBuf,
230230
rust_info: channel::GitInfo,
@@ -240,12 +240,12 @@ pub struct Build {
240240
doc_tests: DocTests,
241241
verbosity: usize,
242242

243-
// Targets for which to build.
243+
// Targets for which to build
244244
build: Interned<String>,
245245
hosts: Vec<Interned<String>>,
246246
targets: Vec<Interned<String>>,
247247

248-
// Stage 0 (downloaded) compiler and cargo or their local rust equivalents.
248+
// Stage 0 (downloaded) compiler and cargo or their local rust equivalents
249249
initial_rustc: PathBuf,
250250
initial_cargo: PathBuf,
251251

@@ -255,7 +255,7 @@ pub struct Build {
255255
cxx: HashMap<Interned<String>, cc::Tool>,
256256
ar: HashMap<Interned<String>, PathBuf>,
257257
ranlib: HashMap<Interned<String>, PathBuf>,
258-
// Misc
258+
// Miscellaneous
259259
crates: HashMap<Interned<String>, Crate>,
260260
is_sudo: bool,
261261
ci_env: CiEnv,

src/libcore/macros.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ macro_rules! assert_ne {
145145
/// # Uses
146146
///
147147
/// Unlike [`assert!`], `debug_assert!` statements are only enabled in non
148-
/// optimized builds by default. An optimized build will omit all
148+
/// optimized builds by default. An optimized build will not execute
149149
/// `debug_assert!` statements unless `-C debug-assertions` is passed to the
150150
/// compiler. This makes `debug_assert!` useful for checks that are too
151151
/// expensive to be present in a release build but may be helpful during
152-
/// development.
152+
/// development. The result of expanding `debug_assert!` is always type checked.
153153
///
154154
/// An unchecked assertion allows a program in an inconsistent state to keep
155155
/// running, which might have unexpected consequences but does not introduce
@@ -190,11 +190,11 @@ macro_rules! debug_assert {
190190
/// debug representations.
191191
///
192192
/// Unlike [`assert_eq!`], `debug_assert_eq!` statements are only enabled in non
193-
/// optimized builds by default. An optimized build will omit all
193+
/// optimized builds by default. An optimized build will not execute
194194
/// `debug_assert_eq!` statements unless `-C debug-assertions` is passed to the
195195
/// compiler. This makes `debug_assert_eq!` useful for checks that are too
196196
/// expensive to be present in a release build but may be helpful during
197-
/// development.
197+
/// development. The result of expanding `debug_assert_eq!` is always type checked.
198198
///
199199
/// [`assert_eq!`]: ../std/macro.assert_eq.html
200200
///
@@ -217,11 +217,11 @@ macro_rules! debug_assert_eq {
217217
/// debug representations.
218218
///
219219
/// Unlike [`assert_ne!`], `debug_assert_ne!` statements are only enabled in non
220-
/// optimized builds by default. An optimized build will omit all
220+
/// optimized builds by default. An optimized build will not execute
221221
/// `debug_assert_ne!` statements unless `-C debug-assertions` is passed to the
222222
/// compiler. This makes `debug_assert_ne!` useful for checks that are too
223223
/// expensive to be present in a release build but may be helpful during
224-
/// development.
224+
/// development. The result of expanding `debug_assert_ne!` is always type checked.
225225
///
226226
/// [`assert_ne!`]: ../std/macro.assert_ne.html
227227
///

src/librustc/middle/recursion_limit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use syntax::symbol::{Symbol, sym};
1212
use rustc_data_structures::sync::Once;
1313

1414
pub fn update_limits(sess: &Session, krate: &ast::Crate) {
15-
update_limit(krate, &sess.recursion_limit, sym::recursion_limit, 64);
15+
update_limit(krate, &sess.recursion_limit, sym::recursion_limit, 128);
1616
update_limit(krate, &sess.type_length_limit, sym::type_length_limit, 1048576);
1717
}
1818

src/librustc/session/config.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1707,16 +1707,15 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
17071707
"",
17081708
"Add a directory to the library search path. The
17091709
optional KIND can be one of dependency, crate, native,
1710-
framework or all (the default).",
1710+
framework, or all (the default).",
17111711
"[KIND=]PATH",
17121712
),
17131713
opt::multi_s(
17141714
"l",
17151715
"",
17161716
"Link the generated crate(s) to the specified native
17171717
library NAME. The optional KIND can be one of
1718-
static, dylib, or framework. If omitted, dylib is
1719-
assumed.",
1718+
static, framework, or dylib (the default).",
17201719
"[KIND=]NAME",
17211720
),
17221721
opt::multi_s(

src/librustc_resolve/lib.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -2523,17 +2523,7 @@ impl<'a> Resolver<'a> {
25232523
debug!("(resolving item) resolving {} ({:?})", name, item.node);
25242524

25252525
match item.node {
2526-
ItemKind::Ty(_, ref generics) => {
2527-
self.with_current_self_item(item, |this| {
2528-
this.with_generic_param_rib(HasGenericParams(generics, ItemRibKind), |this| {
2529-
let item_def_id = this.definitions.local_def_id(item.id);
2530-
this.with_self_rib(Res::SelfTy(Some(item_def_id), None), |this| {
2531-
visit::walk_item(this, item)
2532-
})
2533-
})
2534-
});
2535-
}
2536-
2526+
ItemKind::Ty(_, ref generics) |
25372527
ItemKind::Existential(_, ref generics) |
25382528
ItemKind::Fn(_, _, ref generics, _) => {
25392529
self.with_generic_param_rib(

src/librustc_typeck/check/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4458,7 +4458,7 @@ pub fn check_bounds_are_used<'tcx>(tcx: TyCtxt<'tcx>, generics: &ty::Generics, t
44584458
return;
44594459
}
44604460

4461-
// Make a vector of booleans initially false, set to true when used.
4461+
// Make a vector of booleans initially `false`; set to `true` when used.
44624462
let mut types_used = vec![false; own_counts.types];
44634463

44644464
for leaf_ty in ty.walk() {
@@ -4467,7 +4467,7 @@ pub fn check_bounds_are_used<'tcx>(tcx: TyCtxt<'tcx>, generics: &ty::Generics, t
44674467
types_used[index as usize - own_counts.lifetimes] = true;
44684468
} else if let ty::Error = leaf_ty.sty {
44694469
// If there is already another error, do not emit
4470-
// an error for not using a type Parameter.
4470+
// an error for not using a type parameter.
44714471
assert!(tcx.sess.has_errors());
44724472
return;
44734473
}

src/librustdoc/html/static/rustdoc.css

+1
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ a {
639639
margin-top: 5px;
640640
padding: 6px;
641641
padding-right: 19px;
642+
flex: none;
642643
border: 0;
643644
border-right: 0;
644645
border-radius: 4px 0 0 4px;

src/libsyntax/feature_gate.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
14651465
cfg_fn!(dropck_eyepatch))),
14661466
(sym::unwind, Whitelisted, template!(List: "allowed|aborts"), Gated(Stability::Unstable,
14671467
sym::unwind_attributes,
1468-
"#[unwind] is experimental",
1468+
"`#[unwind]` is experimental",
14691469
cfg_fn!(unwind_attributes))),
14701470
(sym::used, Whitelisted, template!(Word), Ungated),
14711471

@@ -1551,13 +1551,13 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
15511551

15521552
(sym::alloc_error_handler, Normal, template!(Word), Gated(Stability::Unstable,
15531553
sym::alloc_error_handler,
1554-
"#[alloc_error_handler] is an unstable feature",
1554+
"`#[alloc_error_handler]` is an unstable feature",
15551555
cfg_fn!(alloc_error_handler))),
15561556

15571557
// RFC 2412
15581558
(sym::optimize, Whitelisted, template!(List: "size|speed"), Gated(Stability::Unstable,
15591559
sym::optimize_attribute,
1560-
"#[optimize] attribute is an unstable feature",
1560+
"`#[optimize]` attribute is an unstable feature",
15611561
cfg_fn!(optimize_attribute))),
15621562

15631563
// Crate level attributes
@@ -1674,7 +1674,7 @@ impl<'a> Context<'a> {
16741674
if let Some(content) = attr.meta_item_list() {
16751675
if content.iter().any(|c| c.check_name(sym::include)) {
16761676
gate_feature!(self, external_doc, attr.span,
1677-
"#[doc(include = \"...\")] is experimental"
1677+
"`#[doc(include = \"...\")]` is experimental"
16781678
);
16791679
}
16801680
}
@@ -1803,7 +1803,7 @@ fn leveled_feature_err<'a, S: Into<MultiSpan>>(
18031803

18041804
// #23973: do not suggest `#![feature(...)]` if we are in beta/stable
18051805
if sess.unstable_features.is_nightly_build() {
1806-
err.help(&format!("add #![feature({})] to the crate attributes to enable", feature));
1806+
err.help(&format!("add `#![feature({})]` to the crate attributes to enable", feature));
18071807
}
18081808

18091809
// If we're on stable and only emitting a "soft" warning, add a note to
@@ -1985,23 +1985,23 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
19851985
if let Some(content) = attr.meta_item_list() {
19861986
if content.len() == 1 && content[0].check_name(sym::cfg) {
19871987
gate_feature_post!(&self, doc_cfg, attr.span,
1988-
"#[doc(cfg(...))] is experimental"
1988+
"`#[doc(cfg(...))]` is experimental"
19891989
);
19901990
} else if content.iter().any(|c| c.check_name(sym::masked)) {
19911991
gate_feature_post!(&self, doc_masked, attr.span,
1992-
"#[doc(masked)] is experimental"
1992+
"`#[doc(masked)]` is experimental"
19931993
);
19941994
} else if content.iter().any(|c| c.check_name(sym::spotlight)) {
19951995
gate_feature_post!(&self, doc_spotlight, attr.span,
1996-
"#[doc(spotlight)] is experimental"
1996+
"`#[doc(spotlight)]` is experimental"
19971997
);
19981998
} else if content.iter().any(|c| c.check_name(sym::alias)) {
19991999
gate_feature_post!(&self, doc_alias, attr.span,
2000-
"#[doc(alias = \"...\")] is experimental"
2000+
"`#[doc(alias = \"...\")]` is experimental"
20012001
);
20022002
} else if content.iter().any(|c| c.check_name(sym::keyword)) {
20032003
gate_feature_post!(&self, doc_keyword, attr.span,
2004-
"#[doc(keyword = \"...\")] is experimental"
2004+
"`#[doc(keyword = \"...\")]` is experimental"
20052005
);
20062006
}
20072007
}
@@ -2044,13 +2044,13 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
20442044
}
20452045
if attr::contains_name(&i.attrs[..], sym::start) {
20462046
gate_feature_post!(&self, start, i.span,
2047-
"a #[start] function is an experimental \
2047+
"a `#[start]` function is an experimental \
20482048
feature whose signature may change \
20492049
over time");
20502050
}
20512051
if attr::contains_name(&i.attrs[..], sym::main) {
20522052
gate_feature_post!(&self, main, i.span,
2053-
"declaration of a nonstandard #[main] \
2053+
"declaration of a non-standard `#[main]` \
20542054
function may change over time, for now \
20552055
a top-level `fn main()` is required");
20562056
}
@@ -2638,7 +2638,7 @@ fn maybe_stage_features(span_handler: &Handler, krate: &ast::Crate,
26382638
if attr.check_name(sym::feature) {
26392639
let release_channel = option_env!("CFG_RELEASE_CHANNEL").unwrap_or("(unknown)");
26402640
span_err!(span_handler, attr.span, E0554,
2641-
"#![feature] may not be used on the {} release channel",
2641+
"`#![feature]` may not be used on the {} release channel",
26422642
release_channel);
26432643
}
26442644
}

src/test/rustdoc/deep-structures.rs

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
// This test verifies that we do not hit recursion limit trying to prove auto-trait bounds for
2+
// reasonably deep structures.
3+
4+
#![crate_type="rlib"]
5+
6+
pub struct A01(A02);
7+
pub struct A02(A03);
8+
pub struct A03(A04);
9+
pub struct A04(A05);
10+
pub struct A05(A06);
11+
pub struct A06(A07);
12+
pub struct A07(A08);
13+
pub struct A08(A09);
14+
pub struct A09(A10);
15+
pub struct A10(A11);
16+
pub struct A11(A12);
17+
pub struct A12(A13);
18+
pub struct A13(A14);
19+
pub struct A14(A15);
20+
pub struct A15(A16);
21+
pub struct A16(A17);
22+
pub struct A17(A18);
23+
pub struct A18(A19);
24+
pub struct A19(A20);
25+
pub struct A20(A21);
26+
pub struct A21(A22);
27+
pub struct A22(A23);
28+
pub struct A23(A24);
29+
pub struct A24(A25);
30+
pub struct A25(A26);
31+
pub struct A26(A27);
32+
pub struct A27(A28);
33+
pub struct A28(A29);
34+
pub struct A29(A30);
35+
pub struct A30(A31);
36+
pub struct A31(A32);
37+
pub struct A32(A33);
38+
pub struct A33(A34);
39+
pub struct A34(A35);
40+
pub struct A35(A36);
41+
pub struct A36(A37);
42+
pub struct A37(A38);
43+
pub struct A38(A39);
44+
pub struct A39(A40);
45+
pub struct A40(A41);
46+
pub struct A41(A42);
47+
pub struct A42(A43);
48+
pub struct A43(A44);
49+
pub struct A44(A45);
50+
pub struct A45(A46);
51+
pub struct A46(A47);
52+
pub struct A47(A48);
53+
pub struct A48(A49);
54+
pub struct A49(A50);
55+
pub struct A50(A51);
56+
pub struct A51(A52);
57+
pub struct A52(A53);
58+
pub struct A53(A54);
59+
pub struct A54(A55);
60+
pub struct A55(A56);
61+
pub struct A56(A57);
62+
pub struct A57(A58);
63+
pub struct A58(A59);
64+
pub struct A59(A60);
65+
pub struct A60(A61);
66+
pub struct A61(A62);
67+
pub struct A62(A63);
68+
pub struct A63(A64);
69+
pub struct A64(A65);
70+
pub struct A65(A66);
71+
pub struct A66(A67);
72+
pub struct A67(A68);
73+
pub struct A68(A69);
74+
pub struct A69(A70);
75+
pub struct A70(A71);
76+
pub struct A71(A72);
77+
pub struct A72(A73);
78+
pub struct A73(A74);
79+
pub struct A74(A75);
80+
pub struct A75(A76);
81+
pub struct A76(A77);
82+
pub struct A77(A78);
83+
pub struct A78(A79);
84+
pub struct A79(A80);
85+
pub struct A80(A81);
86+
pub struct A81(A82);
87+
pub struct A82(A83);
88+
pub struct A83(A84);
89+
pub struct A84(A85);
90+
pub struct A85(A86);
91+
pub struct A86(A87);
92+
pub struct A87(A88);
93+
pub struct A88(A89);
94+
pub struct A89(A90);
95+
pub struct A90(A91);
96+
pub struct A91(A92);
97+
pub struct A92(A93);
98+
pub struct A93(A94);
99+
pub struct A94(A95);
100+
pub struct A95(A96);
101+
pub struct A96(A97);
102+
pub struct A97(A98);
103+
pub struct A98(A99);
104+
pub struct A99;

src/test/ui-fulldeps/gated-plugin.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | #![plugin(attr_plugin_test)]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: for more information, see https://github.com/rust-lang/rust/issues/29597
8-
= help: add #![feature(plugin)] to the crate attributes to enable
8+
= help: add `#![feature(plugin)]` to the crate attributes to enable
99

1010
error: aborting due to previous error
1111

0 commit comments

Comments
 (0)