Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 50c0192

Browse files
committed
Auto merge of rust-lang#73235 - Dylan-DPC:rollup-zp8oxhg, r=Dylan-DPC
Rollup of 11 pull requests Successful merges: - rust-lang#72380 (Fix `is_const_context`, update `check_for_cast`) - rust-lang#72941 (Ensure stack when building MIR for matches) - rust-lang#72976 (Clean up E0642 explanation) - rust-lang#73080 (doc/rustdoc: Fix incorrect external_doc feature flag) - rust-lang#73155 (save_analysis: better handle paths and functions signature) - rust-lang#73164 (Add new E0762 error code) - rust-lang#73172 (Fix more clippy warnings) - rust-lang#73181 (Automatically prioritize unsoundness issues) - rust-lang#73183 (Support proc macros in intra doc link resolution) - rust-lang#73208 (Fix doctest template) - rust-lang#73219 (x.py: with --json-output, forward cargo's JSON) Failed merges: r? @ghost
2 parents 3ddf480 + ba0a8d2 commit 50c0192

File tree

44 files changed

+5807
-415
lines changed

Some content is hidden

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

44 files changed

+5807
-415
lines changed

src/bootstrap/compile.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,13 @@ pub fn stream_cargo(
983983
for line in stdout.lines() {
984984
let line = t!(line);
985985
match serde_json::from_str::<CargoMessage<'_>>(&line) {
986-
Ok(msg) => cb(msg),
986+
Ok(msg) => {
987+
if builder.config.json_output {
988+
// Forward JSON to stdout.
989+
println!("{}", line);
990+
}
991+
cb(msg)
992+
}
987993
// If this was informational, just print it out and continue
988994
Err(_) => println!("{}", line),
989995
}

src/doc/rustdoc/src/documentation-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ without including it in your main documentation. For example, you could write th
416416
`lib.rs` to test your README as part of your doctests:
417417

418418
```rust,ignore
419-
#![feature(extern_doc)]
419+
#![feature(external_doc)]
420420
421421
#[doc(include="../README.md")]
422422
#[cfg(doctest)]

src/libcore/num/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3309,7 +3309,8 @@ Basic usage:
33093309
33103310
```
33113311
", $Feature, "assert_eq!(100", stringify!($SelfT), ".saturating_add(1), 101);
3312-
assert_eq!(200u8.saturating_add(127), 255);", $EndFeature, "
3312+
assert_eq!(", stringify!($SelfT), "::MAX.saturating_add(127), ", stringify!($SelfT), "::MAX);",
3313+
$EndFeature, "
33133314
```"),
33143315

33153316
#[stable(feature = "rust1", since = "1.0.0")]

src/librustc_ast/tokenstream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ impl TokenStream {
392392
break;
393393
}
394394
}
395-
token_trees = out.into_iter().map(|t| TokenTree::Token(t)).collect();
395+
token_trees = out.into_iter().map(TokenTree::Token).collect();
396396
if token_trees.len() != 1 {
397397
debug!("break_tokens: broke {:?} to {:?}", tree, token_trees);
398398
}

src/librustc_ast_lowering/expr.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,10 +1237,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
12371237
) => {
12381238
assert!(!*late);
12391239
let out_op_sp = if input { op_sp2 } else { op_sp };
1240-
let msg = &format!(
1241-
"use `lateout` instead of \
1242-
`out` to avoid conflict"
1243-
);
1240+
let msg = "use `lateout` instead of \
1241+
`out` to avoid conflict";
12441242
err.span_help(out_op_sp, msg);
12451243
}
12461244
_ => {}

src/librustc_builtin_macros/asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ fn expand_preparsed_asm(ecx: &mut ExtCtxt<'_>, sp: Span, args: AsmArgs) -> P<ast
457457

458458
let mut chars = arg.format.ty.chars();
459459
let mut modifier = chars.next();
460-
if !chars.next().is_none() {
460+
if chars.next().is_some() {
461461
let span = arg
462462
.format
463463
.ty_span

src/librustc_codegen_ssa/mir/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
6363
.tcx()
6464
.destructure_const(ty::ParamEnv::reveal_all().and(&c))
6565
.fields
66-
.into_iter()
66+
.iter()
6767
.map(|field| {
6868
if let Some(prim) = field.val.try_to_scalar() {
6969
let layout = bx.layout_of(field_ty);

src/librustc_error_codes/error_codes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ E0754: include_str!("./error_codes/E0754.md"),
440440
E0758: include_str!("./error_codes/E0758.md"),
441441
E0760: include_str!("./error_codes/E0760.md"),
442442
E0761: include_str!("./error_codes/E0761.md"),
443+
E0762: include_str!("./error_codes/E0762.md"),
443444
;
444445
// E0006, // merged with E0005
445446
// E0008, // cannot bind by-move into a pattern guard

src/librustc_error_codes/error_codes/E0642.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Trait methods currently cannot take patterns as arguments.
22

3-
Example of erroneous code:
3+
Erroneous code example:
44

55
```compile_fail,E0642
66
trait Foo {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
A character literal wasn't ended with a quote.
2+
3+
Erroneous code example:
4+
5+
```compile_fail,E0762
6+
static C: char = '●; // error!
7+
```
8+
9+
To fix this error, add the missing quote:
10+
11+
```
12+
static C: char = '●'; // ok!
13+
```

0 commit comments

Comments
 (0)