You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: stage.rs
    path of file: ./repos/shame/shame/src/rec
    
    the code of the file until where you have to start completion: //! runtime type annotations for representing the shader stage in which a value
//! is available (per-vertex, per-fragment, uniform).

use super::*;
use shame_graph::Any;
use shame_graph::Ty;
use shame_graph::Error;
use crate::assert;

/// runtime type annotation for [`Rec`] types, used to tag "per-vertex", 
/// "per-fragment" or unrestricted "uniform" values.
/// 
/// using "per-vertex" values in expressions with "per-fragmen
    
pub fn narrow_stages_or_push_error(stages: impl IntoIterator<Item=Stage>) -> Stage {
    stages.into_iter().fold(Stage::Uniform, |acc, x| {
        let narrowed = acc & x;
        if let Stage::NotAvailable = narrowed {
            assert::rec_error(Error::AssertionFailed(format!("trying to use a {:?} shader expression together with a {:?} shader expression", acc, x))); //TODO: improve error message (e.g. by adding arg types)
        }
        narrowed
    })
}