mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 15:32:06 +00:00
parent
c9c7be78db
commit
9ad133b4a1
@ -1167,6 +1167,7 @@ fn document(config: &Config, props: &TestProps,
|
||||
testfile: &Path, extra_args: &[String]) -> (ProcRes, PathBuf) {
|
||||
let aux_dir = aux_output_dir_name(config, testfile);
|
||||
let out_dir = output_base_name(config, testfile);
|
||||
let _ = fs::remove_dir_all(&out_dir);
|
||||
ensure_dir(&out_dir);
|
||||
let mut args = vec!["-L".to_string(),
|
||||
aux_dir.to_str().unwrap().to_string(),
|
||||
|
@ -186,7 +186,8 @@ def concat_multi_lines(f):
|
||||
|
||||
firstlineno = firstlineno or lineno
|
||||
if line.endswith('\\'):
|
||||
lastline = line[:-1]
|
||||
if lastline is None:
|
||||
lastline = line[:-1]
|
||||
catenated += line[:-1]
|
||||
else:
|
||||
yield firstlineno, catenated + line
|
||||
|
@ -89,6 +89,7 @@
|
||||
//! of unsafe pointers in Rust.
|
||||
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
#![doc(primitive = "pointer")]
|
||||
|
||||
use mem;
|
||||
use clone::Clone;
|
||||
|
@ -1368,6 +1368,7 @@ pub enum PrimitiveType {
|
||||
Slice,
|
||||
Array,
|
||||
PrimitiveTuple,
|
||||
PrimitiveRawPointer,
|
||||
}
|
||||
|
||||
#[derive(Clone, RustcEncodable, RustcDecodable, Copy, Debug)]
|
||||
@ -1404,6 +1405,7 @@ impl PrimitiveType {
|
||||
"array" => Some(Array),
|
||||
"slice" => Some(Slice),
|
||||
"tuple" => Some(PrimitiveTuple),
|
||||
"pointer" => Some(PrimitiveRawPointer),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@ -1449,6 +1451,7 @@ impl PrimitiveType {
|
||||
Array => "array",
|
||||
Slice => "slice",
|
||||
PrimitiveTuple => "tuple",
|
||||
PrimitiveRawPointer => "pointer",
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -491,7 +491,8 @@ impl fmt::Display for clean::Type {
|
||||
}
|
||||
clean::Bottom => f.write_str("!"),
|
||||
clean::RawPointer(m, ref t) => {
|
||||
write!(f, "*{}{}", RawMutableSpace(m), **t)
|
||||
primitive_link(f, clean::PrimitiveType::PrimitiveRawPointer,
|
||||
&format!("*{}{}", RawMutableSpace(m), **t))
|
||||
}
|
||||
clean::BorrowedRef{ lifetime: ref l, mutability, type_: ref ty} => {
|
||||
let lt = match *l {
|
||||
|
@ -1028,7 +1028,8 @@ impl DocFolder for Cache {
|
||||
clean::Item{ attrs, inner: clean::ImplItem(i), .. } => {
|
||||
use clean::{Primitive, Vector, ResolvedPath, BorrowedRef};
|
||||
use clean::PrimitiveType::{Array, Slice, PrimitiveTuple};
|
||||
use clean::{FixedVector, Tuple};
|
||||
use clean::PrimitiveType::{PrimitiveRawPointer};
|
||||
use clean::{FixedVector, Tuple, RawPointer};
|
||||
|
||||
// extract relevant documentation for this impl
|
||||
let dox = match attrs.into_iter().find(|a| {
|
||||
@ -1064,8 +1065,8 @@ impl DocFolder for Cache {
|
||||
Some(ast_util::local_def(Array.to_node_id()))
|
||||
}
|
||||
|
||||
// In a DST world, we may only need Vector, but for now we
|
||||
// also pick up borrowed references
|
||||
// In a DST world, we may only need Vector, but for
|
||||
// now we also pick up borrowed references
|
||||
Vector(..) |
|
||||
BorrowedRef{ type_: box Vector(..), .. } =>
|
||||
{
|
||||
@ -1077,6 +1078,11 @@ impl DocFolder for Cache {
|
||||
Some(ast_util::local_def(id))
|
||||
}
|
||||
|
||||
RawPointer(..) => {
|
||||
let id = PrimitiveRawPointer.to_node_id();
|
||||
Some(ast_util::local_def(id))
|
||||
}
|
||||
|
||||
_ => None,
|
||||
};
|
||||
|
||||
|
15
src/test/auxiliary/issue-15318.rs
Normal file
15
src/test/auxiliary/issue-15318.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright 2015 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.
|
||||
|
||||
#![doc(html_root_url = "http://example.com/")]
|
||||
|
||||
/// dox
|
||||
#[doc(primitive = "pointer")]
|
||||
pub mod ptr {}
|
21
src/test/rustdoc/issue-15318-2.rs
Normal file
21
src/test/rustdoc/issue-15318-2.rs
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2015 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.
|
||||
|
||||
// aux-build:issue-15318.rs
|
||||
|
||||
extern crate issue_15318;
|
||||
|
||||
pub use issue_15318::ptr;
|
||||
|
||||
// @has issue_15318_2/fn.bar.html \
|
||||
// '//*[@href="primitive.pointer.html"]' \
|
||||
// '*mut T'
|
||||
pub fn bar<T>(ptr: *mut T) {}
|
||||
|
15
src/test/rustdoc/issue-15318-3.rs
Normal file
15
src/test/rustdoc/issue-15318-3.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright 2015 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.
|
||||
|
||||
// @has issue_15318_3/primitive.pointer.html
|
||||
|
||||
/// dox
|
||||
#[doc(primitive = "pointer")]
|
||||
pub mod ptr {}
|
21
src/test/rustdoc/issue-15318.rs
Normal file
21
src/test/rustdoc/issue-15318.rs
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2015 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.
|
||||
|
||||
// aux-build:issue-15318.rs
|
||||
|
||||
#![feature(no_std)]
|
||||
#![no_std]
|
||||
|
||||
extern crate issue_15318;
|
||||
|
||||
// @has issue_15318/fn.bar.html \
|
||||
// '//*[@href="http://example.com/issue_15318/primitive.pointer.html"]' \
|
||||
// '*mut T'
|
||||
pub fn bar<T>(ptr: *mut T) {}
|
Loading…
Reference in New Issue
Block a user