diff options
Diffstat (limited to 'compiler/rustc_resolve')
| -rw-r--r-- | compiler/rustc_resolve/src/imports.rs | 36 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/rustdoc.rs | 8 |
2 files changed, 18 insertions, 26 deletions
diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs index 42171edf757..1c8ccd2321f 100644 --- a/compiler/rustc_resolve/src/imports.rs +++ b/compiler/rustc_resolve/src/imports.rs @@ -1256,28 +1256,23 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { extern_crate_span: self.tcx.source_span(self.local_def_id(extern_crate_id)), }, ); + } else if ns == TypeNS { + let err = if crate_private_reexport { + self.dcx() + .create_err(CannotBeReexportedCratePublicNS { span: import.span, ident }) + } else { + self.dcx().create_err(CannotBeReexportedPrivateNS { span: import.span, ident }) + }; + err.emit(); } else { - if ns == TypeNS { - let err = if crate_private_reexport { - self.dcx().create_err(CannotBeReexportedCratePublicNS { - span: import.span, - ident, - }) - } else { - self.dcx() - .create_err(CannotBeReexportedPrivateNS { span: import.span, ident }) - }; - err.emit(); + let mut err = if crate_private_reexport { + self.dcx() + .create_err(CannotBeReexportedCratePublic { span: import.span, ident }) } else { - let mut err = if crate_private_reexport { - self.dcx() - .create_err(CannotBeReexportedCratePublic { span: import.span, ident }) - } else { - self.dcx() - .create_err(CannotBeReexportedPrivate { span: import.span, ident }) - }; + self.dcx().create_err(CannotBeReexportedPrivate { span: import.span, ident }) + }; - match binding.kind { + match binding.kind { NameBindingKind::Res(Res::Def(DefKind::Macro(_), def_id)) // exclude decl_macro if self.get_macro_by_def_id(def_id).macro_rules => @@ -1293,8 +1288,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { }); } } - err.emit(); - } + err.emit(); } } diff --git a/compiler/rustc_resolve/src/rustdoc.rs b/compiler/rustc_resolve/src/rustdoc.rs index 976c4acb212..bed3baa30fb 100644 --- a/compiler/rustc_resolve/src/rustdoc.rs +++ b/compiler/rustc_resolve/src/rustdoc.rs @@ -270,12 +270,10 @@ fn strip_generics_from_path_segment(segment: Vec<char>) -> Result<String, Malfor // Give a helpful error message instead of completely ignoring the angle brackets. return Err(MalformedGenerics::HasFullyQualifiedSyntax); } + } else if param_depth == 0 { + stripped_segment.push(c); } else { - if param_depth == 0 { - stripped_segment.push(c); - } else { - latest_generics_chunk.push(c); - } + latest_generics_chunk.push(c); } } |
