Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d3299af
transmute: caution against int2ptr transmutation
RalfJung Mar 12, 2024
982918f
Handle str literals written with `'` lexed as lifetime
estebank Mar 9, 2024
4a10b01
Use shorter span for existing `'` -> `"` structured suggestion
estebank Mar 9, 2024
999a0dc
review comment: `str` -> string in messages
estebank Mar 13, 2024
6f388ef
Extend test to trigger on 2015, 2018 and 2021 editions
estebank Mar 14, 2024
ea1883d
Silence redundant error on char literal that was meant to be a string…
estebank Mar 14, 2024
f4d30b1
fix rustdoc test
estebank Mar 17, 2024
f4adb1e
add notes on how to store 'ptr or int'
RalfJung Mar 14, 2024
1fcf2ea
Uniquify ReError on input mode in canonicalizer
compiler-errors Mar 22, 2024
da8a39a
Failing test
compiler-errors Mar 8, 2024
78ebb93
Fix validation on substituted callee bodies in MIR inliner
compiler-errors Mar 19, 2024
12e3629
add test for #99945
matthiaskrgr Mar 23, 2024
2f9a240
add test for opaque type with non-universal region substs #101852
matthiaskrgr Mar 23, 2024
e54bff7
add test for #104779 opaque types, patterns and subtyping ICE: Index…
matthiaskrgr Mar 23, 2024
f1f287f
add test for ICE "raw ptr comparison should already be caught in the…
matthiaskrgr Mar 23, 2024
f8aeac8
add test for #106423
matthiaskrgr Mar 23, 2024
cc422ce
add test for ICE #106444
matthiaskrgr Mar 23, 2024
f2bc9c5
add test for #106874 ICE BoundUniversalRegionError
matthiaskrgr Mar 23, 2024
368bfb2
add test for #107228
matthiaskrgr Mar 23, 2024
0d3ef80
`rustdoc --test`: Prevent reaching the maximum size of command-line b…
GuillaumeGomez Mar 21, 2024
33735d5
Prevent cloning more than necessary `RustdocOptions` fields
GuillaumeGomez Mar 22, 2024
86fe400
Put temporary directory into one common function
GuillaumeGomez Mar 23, 2024
773084f
Rename `RustdocTestOptions` into `IndividualTestOptions`
GuillaumeGomez Mar 23, 2024
9aea37d
address review feedback
matthiaskrgr Mar 23, 2024
246f746
Add test in `higher-ranked`
Luv-Ray Mar 23, 2024
188c46a
regression test for #103626
kadiwa4 Feb 19, 2024
5fab016
Add `Rustdoc` into `run-make-support`
GuillaumeGomez Mar 23, 2024
bc4f169
Add regression test for #122722
GuillaumeGomez Mar 23, 2024
e74b01e
core/panicking: fix outdated comment
RalfJung Mar 23, 2024
5167581
Rollup merge of #121281 - kadiwa4:test_103626, r=estebank,lcnr
matthiaskrgr Mar 24, 2024
3d9ee88
Rollup merge of #122168 - compiler-errors:inline-coroutine-body-valid…
matthiaskrgr Mar 24, 2024
1164c27
Rollup merge of #122217 - estebank:issue-119685, r=fmease
matthiaskrgr Mar 24, 2024
2dcc968
Rollup merge of #122379 - RalfJung:int2ptr-transmute, r=m-ou-se
matthiaskrgr Mar 24, 2024
73038c0
Rollup merge of #122840 - GuillaumeGomez:rustdoc-test-too-many-args, …
matthiaskrgr Mar 24, 2024
cb03714
Rollup merge of #122907 - compiler-errors:uniquify-reerror, r=lcnr
matthiaskrgr Mar 24, 2024
d8c2242
Rollup merge of #122942 - Luv-Ray:master, r=lcnr
matthiaskrgr Mar 24, 2024
2463ad0
Rollup merge of #122943 - matthiaskrgr:ice-tests-9xxxx-to-12xxxx, r=f…
matthiaskrgr Mar 24, 2024
6f16b41
Rollup merge of #122963 - RalfJung:core-panicking, r=m-ou-se
matthiaskrgr Mar 24, 2024
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
Put temporary directory into one common function
  • Loading branch information
GuillaumeGomez committed Mar 23, 2024
commit 86fe40021fdac50ed64e04cdae12f0156e5a8908
16 changes: 7 additions & 9 deletions src/librustdoc/doctest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use rustc_span::source_map::SourceMap;
use rustc_span::symbol::sym;
use rustc_span::{BytePos, FileName, Pos, Span, DUMMY_SP};
use rustc_target::spec::{Target, TargetTriple};
use tempfile::Builder as TempFileBuilder;

use std::env;
use std::fs::File;
Expand All @@ -32,7 +31,7 @@ use std::str;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex};

use tempfile::tempdir;
use tempfile::{Builder as TempFileBuilder, TempDir};

use crate::clean::{types::AttributesExt, Attributes};
use crate::config::Options as RustdocOptions;
Expand Down Expand Up @@ -92,6 +91,10 @@ pub(crate) fn generate_args_file(file_path: &Path, options: &RustdocOptions) ->
Ok(())
}

fn get_doctest_dir() -> io::Result<TempDir> {
TempFileBuilder::new().prefix("rustdoctest").tempdir()
}

pub(crate) fn run(
dcx: &rustc_errors::DiagCtxt,
options: RustdocOptions,
Expand Down Expand Up @@ -165,7 +168,7 @@ pub(crate) fn run(
let externs = options.externs.clone();
let json_unused_externs = options.json_unused_externs;

let temp_dir = match tempdir()
let temp_dir = match get_doctest_dir()
.map_err(|error| format!("failed to create temporary directory: {error:?}"))
{
Ok(temp_dir) => temp_dir,
Expand Down Expand Up @@ -962,12 +965,7 @@ impl RustdocTestOptions {

DirState::Perm(path)
} else {
DirState::Temp(
TempFileBuilder::new()
.prefix("rustdoctest")
.tempdir()
.expect("rustdoc needs a tempdir"),
)
DirState::Temp(get_doctest_dir().expect("rustdoc needs a tempdir"))
};

Self {
Expand Down