Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1// regression test for issue #151591, where constant evaluating an unsized AnonConst would ICE
2
3#![feature(adt_const_params)]
4#![feature(unsized_const_params)]
5//~^ WARN the feature `unsized_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
6
7#[derive(Clone)]
8struct S<const L: [u8]>;
9
10const A: [u8];
11//~^ ERROR free constant item without body
…lines 12–22 unchanged (11 lines)

After

1// regression test for issue #151591, where constant evaluating an unsized AnonConst would ICE
2
3#![feature(adt_const_params)]
4#![feature(unsized_const_params)]
5
6#[derive(Clone)]
7struct S<const L: [u8]>;
8
9const A: [u8];
10//~^ ERROR free constant item without body
11//~| ERROR the size for values of type `[u8]` cannot be known at compilation time
…lines 12–21 unchanged (10 lines)

Before

source_file
line_comment
// "//"
inner_attribute_item
# "#"
! "!"
[ "["
attribute
identifier "feature"
token_tree
( "("
identifier "adt_const_params"
) ")"
] "]"
inner_attribute_item
# "#"
! "!"
[ "["
attribute
identifier "feature"
token_tree
( "("
identifier "unsized_const_params"
) ")"
] "]"
line_comment
// "//"
attribute_item
# "#"
[ "["
attribute
identifier "derive"
token_tree
( "("
identifier "Clone"
) ")"
] "]"
struct_item
struct "struct"
type_identifier "S"
type_parameters
< "<"
const_parameter
const "const"
identifier "L"
: ":"
array_type
[ "["
primitive_type "u8"
] "]"
> ">"
; ";"
const_item
const "const"
identifier "A"
: ":"
array_type
[ "["
primitive_type "u8"
] "]"
; ";"
line_comment
// "//"
line_comment
// "//"
impl_item (+21 nodes collapsed)
line_comment
// "//"
line_comment
// "//"
impl_item (+21 nodes collapsed)
line_comment
// "//"
line_comment
// "//"
function_item
fn "fn"
identifier "main"
parameters
( "("
) ")"
block
{ "{"
} "}"

After

source_file
line_comment
// "//"
inner_attribute_item
# "#"
! "!"
[ "["
attribute
identifier "feature"
token_tree
( "("
identifier "adt_const_params"
) ")"
] "]"
inner_attribute_item
# "#"
! "!"
[ "["
attribute
identifier "feature"
token_tree
( "("
identifier "unsized_const_params"
) ")"
] "]"
attribute_item
# "#"
[ "["
attribute
identifier "derive"
token_tree
( "("
identifier "Clone"
) ")"
] "]"
struct_item
struct "struct"
type_identifier "S"
type_parameters
< "<"
const_parameter
const "const"
identifier "L"
: ":"
array_type
[ "["
primitive_type "u8"
] "]"
> ">"
; ";"
const_item
const "const"
identifier "A"
: ":"
array_type
[ "["
primitive_type "u8"
] "]"
; ";"
line_comment
// "//"
line_comment
// "//"
impl_item (+21 nodes collapsed)
line_comment
// "//"
line_comment
// "//"
impl_item (+21 nodes collapsed)
line_comment
// "//"
line_comment
// "//"
function_item
fn "fn"
identifier "main"
parameters
( "("
) ")"
block
{ "{"
} "}"