Skip to content

Rollup of 15 pull requests #52958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 32 commits into from
Aug 1, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8e88d64
Added test for #49579.
davidtwco Jul 28, 2018
6d5694a
fix memrchr in miri
RalfJung Jul 30, 2018
d5f1f70
Fix Alias intra doc ICE
GuillaumeGomez Jul 29, 2018
f985e6c
tests/ui: Add missing mips{64} ignores
Jul 31, 2018
38e311e
Use SetLenOnDrop in Vec::truncate()
lnicola Jul 31, 2018
d94bdf8
Put back original field discovery
GuillaumeGomez Jul 31, 2018
84dc485
Allow borrow conflicts for promoted length 0 arrays
matthewjasper Jul 31, 2018
0babbf1
Don't count MIR locals as borrowed after StorageDead when finding loc…
Zoxc Jul 31, 2018
dbc0cd9
rustc_resolve: record single-segment extern crate import resolutions.
eddyb Aug 1, 2018
e462c06
Another SmallVec.extend optimization
llogiq Aug 1, 2018
b5ed39f
Implement custom read_to_end for io::Take
ljedrz Aug 1, 2018
1d64b24
Switch syntax attribute tracking to BitVector
Mark-Simulacrum Jul 30, 2018
9bc4fbb
Split out growth functionality into BitVector type
Mark-Simulacrum Jul 30, 2018
27b3cb5
rustc: Trim down the `rust_2018_idioms` lint group
alexcrichton Jul 31, 2018
c2d57db
1.27 actually added the `armv5te-unknown-linux-musleabi` target
Susurrus Aug 1, 2018
8bbf042
Added test for #49824.
davidtwco Jul 27, 2018
f685142
async can begin expressions
cramertj Aug 1, 2018
334da29
Rollup merge of #52793 - davidtwco:issue-49824, r=pnkfelix
pietroalbini Aug 1, 2018
42243f8
Rollup merge of #52799 - Mark-Simulacrum:attr-id-bitvecs, r=michaelwo…
pietroalbini Aug 1, 2018
4d1ddfe
Rollup merge of #52809 - davidtwco:issue-49579, r=pnkfelix
pietroalbini Aug 1, 2018
d5fcd27
Rollup merge of #52834 - matthewjasper:allow-zst-conflicts, r=pnkfelix
pietroalbini Aug 1, 2018
f52ef3b
Rollup merge of #52835 - GuillaumeGomez:ice-rustdoc-links, r=eddyb
pietroalbini Aug 1, 2018
e3928cc
Rollup merge of #52854 - RalfJung:memrchr, r=Kimundi
pietroalbini Aug 1, 2018
3ae03e9
Rollup merge of #52899 - draganmladjenovic:ui_tests64, r=alexcrichton
pietroalbini Aug 1, 2018
1997c70
Rollup merge of #52908 - lnicola:vec-truncate-opt, r=alexcrichton
pietroalbini Aug 1, 2018
b40b899
Rollup merge of #52915 - Zoxc:refine-gen-borrow-analysis, r=eddyb
pietroalbini Aug 1, 2018
110b71a
Rollup merge of #52926 - alexcrichton:trim-idioms-lints, r=oli-obk
pietroalbini Aug 1, 2018
2893bd0
Rollup merge of #52930 - eddyb:issue-52489, r=cramertj
pietroalbini Aug 1, 2018
eeb7b6a
Rollup merge of #52939 - ljedrz:fix_51746, r=kennytm
pietroalbini Aug 1, 2018
6e7e385
Rollup merge of #52942 - llogiq:smallvec-opt, r=Mark-Simulacrum
pietroalbini Aug 1, 2018
b2392fa
Rollup merge of #52947 - Susurrus:patch-1, r=alexcrichton
pietroalbini Aug 1, 2018
3e7897f
Rollup merge of #52954 - cramertj:async-parse, r=petrochenkov
pietroalbini Aug 1, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 25 additions & 21 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,8 @@ fn resolve(cx: &DocContext, path_str: &str, is_val: bool) -> Result<(Def, Option
})?;
match ty.def {
Def::Struct(did) | Def::Union(did) | Def::Enum(did) | Def::TyAlias(did) => {
let item = cx.tcx.inherent_impls(did).iter()
let item = cx.tcx.inherent_impls(did)
.iter()
.flat_map(|imp| cx.tcx.associated_items(*imp))
.find(|item| item.ident.name == item_name);
if let Some(item) = item {
Expand All @@ -1205,26 +1206,29 @@ fn resolve(cx: &DocContext, path_str: &str, is_val: bool) -> Result<(Def, Option
};
Ok((ty.def, Some(format!("{}.{}", out, item_name))))
} else {
let is_enum = match ty.def {
Def::Enum(_) => true,
_ => false,
};
let elem = if is_enum {
cx.tcx.adt_def(did).all_fields().find(|item| item.ident.name == item_name)
} else {
cx.tcx.adt_def(did)
.non_enum_variant()
.fields
.iter()
.find(|item| item.ident.name == item_name)
};
if let Some(item) = elem {
Ok((ty.def,
Some(format!("{}.{}",
if is_enum { "variant" } else { "structfield" },
item.ident))))
} else {
Err(())
match cx.tcx.type_of(did).sty {
ty::TyAdt(def, _) => {
if let Some(item) = if def.is_enum() {
def.all_fields().find(|item| item.ident.name == item_name)
} else {
def.non_enum_variant()
.fields
.iter()
.find(|item| item.ident.name == item_name)
} {
Ok((ty.def,
Some(format!("{}.{}",
if def.is_enum() {
"variant"
} else {
"structfield"
},
item.ident))))
} else {
Err(())
}
}
_ => Err(()),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/visit_ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
}

pub fn visit_variant_data(&mut self, item: &hir::Item,
name: ast::Name, sd: &hir::VariantData,
generics: &hir::Generics) -> Struct {
name: ast::Name, sd: &hir::VariantData,
generics: &hir::Generics) -> Struct {
debug!("Visiting struct");
let struct_type = struct_type_from_def(&*sd);
Struct {
Expand Down
16 changes: 16 additions & 0 deletions src/test/rustdoc-ui/intra-doc-alias-ice.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![deny(intra_doc_link_resolution_failure)]

pub type TypeAlias = usize;

/// [broken cross-reference](TypeAlias::hoge) //~ ERROR
pub fn some_public_item() {}
13 changes: 13 additions & 0 deletions src/test/rustdoc-ui/intra-doc-alias-ice.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error: `[TypeAlias::hoge]` cannot be resolved, ignoring it...
--> $DIR/intra-doc-alias-ice.rs:15:30
|
15 | /// [broken cross-reference](TypeAlias::hoge) //~ ERROR
| ^^^^^^^^^^^^^^^ cannot be resolved, ignoring
|
note: lint level defined here
--> $DIR/intra-doc-alias-ice.rs:11:9
|
11 | #![deny(intra_doc_link_resolution_failure)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`