Skip to content

Commit 120b2a7

Browse files
committed
Auto merge of rust-lang#81718 - m-ou-se:rollup-3ftbymt, r=m-ou-se
Rollup of 5 pull requests Successful merges: - rust-lang#80394 (make const_err a future incompat lint) - rust-lang#81532 (Remove incorrect `delay_span_bug`) - rust-lang#81692 (Update clippy) - rust-lang#81715 (Reduce tab formatting assertions to debug only) - rust-lang#81716 (Fix non-existent-field ICE for generic fields.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 186f7ae + 4617418 commit 120b2a7

File tree

149 files changed

+1497
-395
lines changed

Some content is hidden

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

149 files changed

+1497
-395
lines changed

compiler/rustc_errors/src/emitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ impl EmitterWriter {
645645
margin: Margin,
646646
) {
647647
// Tabs are assumed to have been replaced by spaces in calling code.
648-
assert!(!source_string.contains('\t'));
648+
debug_assert!(!source_string.contains('\t'));
649649
let line_len = source_string.len();
650650
// Create the source line we will highlight.
651651
let left = margin.left(line_len);

compiler/rustc_errors/src/styled_buffer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl StyledBuffer {
1515

1616
pub fn render(&self) -> Vec<Vec<StyledString>> {
1717
// Tabs are assumed to have been replaced by spaces in calling code.
18-
assert!(self.text.iter().all(|r| !r.contains(&'\t')));
18+
debug_assert!(self.text.iter().all(|r| !r.contains(&'\t')));
1919

2020
let mut output: Vec<Vec<StyledString>> = vec![];
2121
let mut styled_vec: Vec<StyledString> = vec![];

compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ declare_lint! {
255255
pub CONST_ERR,
256256
Deny,
257257
"constant evaluation encountered erroneous expression",
258+
@future_incompatible = FutureIncompatibleInfo {
259+
reference: "issue #71800 <https://github.com/rust-lang/rust/issues/71800>",
260+
edition: None,
261+
};
258262
report_in_external_macro
259263
}
260264

compiler/rustc_typeck/src/check/check.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ pub(super) fn check_fn<'a, 'tcx>(
203203
// possible cases.
204204
fcx.check_expr(&body.value);
205205
fcx.require_type_is_sized(declared_ret_ty, decl.output.span(), traits::SizedReturnType);
206-
tcx.sess.delay_span_bug(decl.output.span(), "`!Sized` return type");
207206
} else {
208207
fcx.require_type_is_sized(declared_ret_ty, decl.output.span(), traits::SizedReturnType);
209208
fcx.check_return_expr(&body.value);

compiler/rustc_typeck/src/check/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
19741974

19751975
field_path.push(candidate_field.ident.normalize_to_macros_2_0());
19761976
let field_ty = candidate_field.ty(self.tcx, subst);
1977-
if let Some((nested_fields, _)) = self.get_field_candidates(span, &field_ty) {
1977+
if let Some((nested_fields, subst)) = self.get_field_candidates(span, &field_ty) {
19781978
for field in nested_fields.iter() {
19791979
let ident = field.ident.normalize_to_macros_2_0();
19801980
if ident == target_field {

src/test/ui/array-slice-vec/array_const_index-0.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const A: &'static [i32] = &[];
22
const B: i32 = (&A)[1];
33
//~^ index out of bounds: the length is 0 but the index is 1
44
//~| ERROR any use of this value will cause an error
5+
//~| WARN this was previously accepted by the compiler but is being phased out
56

67
fn main() {
78
let _ = B;

src/test/ui/array-slice-vec/array_const_index-0.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LL | const B: i32 = (&A)[1];
77
| index out of bounds: the length is 0 but the index is 1
88
|
99
= note: `#[deny(const_err)]` on by default
10+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
11+
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
1012

1113
error: aborting due to previous error
1214

src/test/ui/array-slice-vec/array_const_index-1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const A: [i32; 0] = [];
22
const B: i32 = A[1];
33
//~^ index out of bounds: the length is 0 but the index is 1
44
//~| ERROR any use of this value will cause an error
5+
//~| WARN this was previously accepted by the compiler but is being phased out
56

67
fn main() {
78
let _ = B;

src/test/ui/array-slice-vec/array_const_index-1.stderr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ LL | const B: i32 = A[1];
77
| index out of bounds: the length is 0 but the index is 1
88
|
99
= note: `#[deny(const_err)]` on by default
10+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
11+
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
1012

1113
error: aborting due to previous error
1214

src/test/ui/associated-consts/defaults-not-assumed-fail.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ trait Tr {
77
// `Self::A` must not be assumed to hold inside the trait.
88
const B: u8 = Self::A + 1;
99
//~^ ERROR any use of this value will cause an error
10+
//~| WARN this was previously accepted by the compiler but is being phased out
1011
}
1112

1213
// An impl that doesn't override any constant will NOT cause a const eval error
@@ -33,6 +34,7 @@ fn main() {
3334
assert_eq!(<() as Tr>::B, 0); // causes the error above
3435
//~^ ERROR evaluation of constant value failed
3536
//~| ERROR erroneous constant used
37+
//~| WARN this was previously accepted by the compiler but is being phased out
3638

3739
assert_eq!(<u8 as Tr>::A, 254);
3840
assert_eq!(<u8 as Tr>::B, 255);

0 commit comments

Comments
 (0)