Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6ba494b
Point to let when modifying field of immutable variable
estebank Mar 11, 2017
38b5b29
Change label to "consider changing this to `mut f`"
estebank Mar 12, 2017
9ac628d
Add label to primary span for mutable access of immutable struct error
estebank Mar 13, 2017
b43c744
Add feature toggle for rvalue-static-promotion RFC
tbg Mar 11, 2017
20c0f32
Use `&&` instead of `&`
tbg Mar 12, 2017
f06b049
Improve the documentation for `rvalue_static_promotion`
tbg Mar 12, 2017
befeb04
Remove unused param from bootstrap::clean::rm_rf
mbrubeck Mar 15, 2017
9b89274
Fix const not displayed in rustdoc
GuillaumeGomez Mar 16, 2017
910532e
Add a test for issue 34571
topecongiro Mar 16, 2017
50cede0
documented order of conversion between u32 an ipv4addr
Mar 17, 2017
963d4df
minor wording tweak to slice::{as_ptr, as_mut_ptr}
QuietMisdreavus Mar 17, 2017
ec8ecf4
Fix typo in mutex.rs docs
ScottAbbey Mar 17, 2017
cb96ade
Fix regression when `include!()`ing a `macro_rules!` containing a `$c…
jseyfried Mar 16, 2017
2976ddb
Fix a spelling error in HashMap documentation, and slightly reword it…
jswalden Mar 18, 2017
8eaac08
Parse 0e+10 as a valid floating-point literal
topecongiro Mar 17, 2017
b77d31a
Add mention of None as possible return. Closes #40435.
russmack Mar 19, 2017
7add53e
Fix a typo in path.rs docs
s3rvac Mar 19, 2017
7b686ce
Rollup merge of #40441 - tschottdorf:promotable-rfc, r=eddyb
frewsxcv Mar 19, 2017
9032cea
Rollup merge of #40445 - estebank:issue-18150, r=jonathandturner
frewsxcv Mar 19, 2017
8287d0d
Rollup merge of #40562 - mbrubeck:bootstrap, r=alexcrichton
frewsxcv Mar 19, 2017
a04c7de
Rollup merge of #40564 - GuillaumeGomez:rustdoc-const, r=frewsxcv
frewsxcv Mar 19, 2017
c949f49
Rollup merge of #40583 - jseyfried:fix_include_macro_regression, r=nrc
frewsxcv Mar 19, 2017
03a30b5
Rollup merge of #40588 - topecongiro:add-missing-tests, r=alexcrichton
frewsxcv Mar 19, 2017
f2290da
Rollup merge of #40589 - topecongiro:floating-point-literal, r=nagisa
frewsxcv Mar 19, 2017
d74c528
Rollup merge of #40590 - z1mvader:master, r=steveklabnik
frewsxcv Mar 19, 2017
969e625
Rollup merge of #40603 - QuietMisdreavus:slice-ptr-docs, r=GuillaumeG…
frewsxcv Mar 19, 2017
d8c8e01
Rollup merge of #40611 - ScottAbbey:patch-1, r=GuillaumeGomez
frewsxcv Mar 19, 2017
9e11ecb
Rollup merge of #40621 - jswalden:dependant-spelling-fix, r=sfackler
frewsxcv Mar 19, 2017
35cf2f9
Rollup merge of #40646 - russmack:issue-40435-mention-none, r=frewsxcv
frewsxcv Mar 19, 2017
94e346b
Rollup merge of #40648 - s3rvac:fix-path-docs-typo, r=frewsxcv
frewsxcv Mar 19, 2017
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
Prev Previous commit
Next Next commit
Fix const not displayed in rustdoc
  • Loading branch information
GuillaumeGomez committed Mar 16, 2017
commit 9b892745ad1da5ce9fc374da10f0f06174f13e48
2 changes: 1 addition & 1 deletion src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ impl<'tcx> Clean<Item> for ty::AssociatedItem {
decl: decl,
abi: sig.abi(),

// trait methods canot (currently, at least) be const
// trait methods cannot (currently, at least) be const
constness: hir::Constness::NotConst,
})
} else {
Expand Down
8 changes: 5 additions & 3 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ use rustc::middle::privacy::AccessLevels;
use rustc::middle::stability;
use rustc::hir;
use rustc::util::nodemap::{FxHashMap, FxHashSet};
use rustc::session::config::nightly_options::is_nightly_build;
use rustc_data_structures::flock;

use clean::{self, AttributesExt, GetDefId, SelfTy, Mutability};
Expand Down Expand Up @@ -2316,9 +2317,10 @@ fn render_assoc_item(w: &mut fmt::Formatter,
}
};
// FIXME(#24111): remove when `const_fn` is stabilized
let vis_constness = match UnstableFeatures::from_environment() {
UnstableFeatures::Allow => constness,
_ => hir::Constness::NotConst
let vis_constness = if is_nightly_build() {
constness
} else {
hir::Constness::NotConst
};
let prefix = format!("{}{}{:#}fn {}{:#}",
ConstnessSpace(vis_constness),
Expand Down
22 changes: 22 additions & 0 deletions src/test/rustdoc/const.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// 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.

#![crate_type="lib"]

#![feature(const_fn)]

pub struct Foo;

impl Foo {
// @has const/struct.Foo.html '//*[@id="new.v"]//code' 'const unsafe fn new'
pub const unsafe fn new() -> Foo {
Foo
}
}