You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[lang = "sized"]traitSized{}enumResult<T,E>{Ok(T),Err(E),}pubstructLayout{// size of the requested block of memory, measured in bytes.size_:usize,}implLayout{/// Constructs a `Layout` suitable for holding a value of type `T`.#[stable(feature = "alloc_layout", since = "1.28.0")]#[inline]pubconstfnnew<T>() -> Self{Layout{size_:14}}pubfnrepeat(&self,n:usize) -> Result<(Self,usize),()>{unsafe{Result::Ok((Layout{size_:14}, n + 12))}}/// Creates a layout describing the record for a `[T; n]`.////// On arithmetic overflow, returns `LayoutErr`.#[stable(feature = "alloc_layout_manipulation", since = "1.44.0")]#[inline]pubfnarray<T>(n:usize) -> Self{let(layout, offset) = Layout::new::<T>().repeat(n)?;
layout
}}fnmain(){}
crab1: internal compiler error: in lower_generic_args, at rust/hir/rust-ast-lower-base.cc:642
0x249d4f1 Rust::HIR::ASTLoweringBase::lower_generic_args(Rust::AST::GenericArgs&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/hir/rust-ast-lower-base.cc:642
0x249d039 Rust::HIR::ASTLoweringBase::lower_path_expr_seg(Rust::AST::PathExprSegment&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/hir/rust-ast-lower-base.cc:590
0x2496f93 Rust::HIR::ASTLowerPathInExpression::visit(Rust::AST::PathInExpression&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/hir/rust-ast-lower.cc:413
0x228f4fd Rust::AST::PathInExpression::accept_vis(Rust::AST::ASTVisitor&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/ast/rust-path.cc:189
0x249fd5f Rust::HIR::ASTLowerPathInExpression::translate(Rust::AST::PathInExpression&)
../../gcc/rust/hir/rust-ast-lower-expr.h:36
0x24b67d0 Rust::HIR::ASTLoweringExpr::visit(Rust::AST::PathInExpression&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/hir/rust-ast-lower-expr.cc:135
0x228f4fd Rust::AST::PathInExpression::accept_vis(Rust::AST::ASTVisitor&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/ast/rust-path.cc:189
0x24b6126 Rust::HIR::ASTLoweringExpr::translate(Rust::AST::Expr&, bool*)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/hir/rust-ast-lower-expr.cc:40
0x24b6a5b Rust::HIR::ASTLoweringExpr::visit(Rust::AST::CallExpr&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/hir/rust-ast-lower-expr.cc:165
0x21ae790 Rust::AST::CallExpr::accept_vis(Rust::AST::ASTVisitor&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/ast/rust-ast.cc:4479
0x24b6126 Rust::HIR::ASTLoweringExpr::translate(Rust::AST::Expr&, bool*)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/hir/rust-ast-lower-expr.cc:40
0x24b6cfd Rust::HIR::ASTLoweringExpr::visit(Rust::AST::MethodCallExpr&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/hir/rust-ast-lower-expr.cc:191
0x21ae7c0 Rust::AST::MethodCallExpr::accept_vis(Rust::AST::ASTVisitor&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/ast/rust-ast.cc:4485
0x24b6126 Rust::HIR::ASTLoweringExpr::translate(Rust::AST::Expr&, bool*)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/hir/rust-ast-lower-expr.cc:40
0x24b9ca5 Rust::HIR::ASTLoweringExpr::visit(Rust::AST::ErrorPropagationExpr&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/hir/rust-ast-lower-expr.cc:676
0x21ae3d0 Rust::AST::ErrorPropagationExpr::accept_vis(Rust::AST::ASTVisitor&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/ast/rust-ast.cc:4359
0x24b6126 Rust::HIR::ASTLoweringExpr::translate(Rust::AST::Expr&, bool*)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/hir/rust-ast-lower-expr.cc:40
0x24c3e2d Rust::HIR::ASTLoweringStmt::visit(Rust::AST::LetStmt&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/hir/rust-ast-lower-stmt.cc:75
0x21af460 Rust::AST::LetStmt::accept_vis(Rust::AST::ASTVisitor&)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/ast/rust-ast.cc:4851
0x24c3b43 Rust::HIR::ASTLoweringStmt::translate(Rust::AST::Stmt*, bool*)
/home/kagounard/Git/rust-gcc/gccrs/build/gcc/../../gcc/rust/hir/rust-ast-lower-stmt.cc:32
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
the ICE happens because lower_generic_args sees a GenericArg::Ambiguous and calls rust_unreachable. at this point in time, all generic args should have been disambiguated to a type or a const generic - but we don't do that disambiguation in error propagation expressions (<expr> ?)
The text was updated successfully, but these errors were encountered:
I tried this code:
https://godbolt.org/z/he1WPf9G1
I expected to see this happen: no error
Instead, this happened:
the ICE happens because
lower_generic_args
sees aGenericArg::Ambiguous
and callsrust_unreachable
. at this point in time, all generic args should have been disambiguated to a type or a const generic - but we don't do that disambiguation in error propagation expressions (<expr> ?
)The text was updated successfully, but these errors were encountered: