mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 21:16:27 +03:00
Auto merge of #32521 - Manishearth:paramitem, r=eddyb
Doc fixes for ParameterEnvironment r? @eddyb
This commit is contained in:
@@ -1202,6 +1202,7 @@ pub fn with_caller_bounds(&self,
|
||||
}
|
||||
}
|
||||
|
||||
/// Construct a parameter environment given an item, impl item, or trait item
|
||||
pub fn for_item(cx: &'a TyCtxt<'tcx>, id: NodeId) -> ParameterEnvironment<'a, 'tcx> {
|
||||
match cx.map.find(id) {
|
||||
Some(ast_map::NodeImplItem(ref impl_item)) => {
|
||||
@@ -1341,7 +1342,7 @@ pub fn for_item(cx: &'a TyCtxt<'tcx>, id: NodeId) -> ParameterEnvironment<'a, 't
|
||||
}
|
||||
_ => {
|
||||
cx.sess.span_bug(item.span,
|
||||
"ParameterEnvironment::from_item():
|
||||
"ParameterEnvironment::for_item():
|
||||
can't create a parameter \
|
||||
environment for this kind of item")
|
||||
}
|
||||
@@ -1352,7 +1353,7 @@ pub fn for_item(cx: &'a TyCtxt<'tcx>, id: NodeId) -> ParameterEnvironment<'a, 't
|
||||
ParameterEnvironment::for_item(cx, cx.map.get_parent(id))
|
||||
}
|
||||
_ => {
|
||||
cx.sess.bug(&format!("ParameterEnvironment::from_item(): \
|
||||
cx.sess.bug(&format!("ParameterEnvironment::for_item(): \
|
||||
`{}` is not an item",
|
||||
cx.map.node_to_string(id)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user