rust/tests/crashes/124151.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
318 B
Rust
Raw Normal View History

2024-04-19 20:23:17 +00:00
//@ known-bug: #124151
#![feature(generic_const_exprs)]
use std::ops::Add;
pub struct Dimension;
pub struct Quantity<S, const D: Dimension>(S);
impl<const D: Dimension, LHS, RHS> Add<LHS, D> for Quantity<LHS, { Dimension }> {}
pub fn add<const U: Dimension>(x: Quantity<f32, U>) -> Quantity<f32, U> {
x + y
}